D
Don Y
Guest
On 1/9/2022 2:34 AM, Jeroen Belleman wrote:
Any programmer worth his salt should know (fill in the blank)!
I don\'t think you realize the quality (lack thereof) of \"programmers\"
being churned out by diploma mills. **Anyone** can learn to write code.
**Anyone**!
At school, the standing joke was that the Physics majors would get
their BS, find they were unemployable and return for an MS. Then, find
they were STILL unemployable and return for a PhD. And, when they
discovered there were a shitload of PhDs out there competing for
the same FEW physics jobs, they\'d go get a job writing code!
[To their credit, the Math majors would come to that realization after
their BS!]
But, getting code to compile/run doesn\'t mean it is well written (or
\"correct\") code. If you look at code written by \"programmers\" (esp
those \"self taught\"), it\'s often really amateurish. Their goal is often
just to get it to (appear to) work. Then, move on to something else.
They don\'t care how *well* it works or how maintainable it might (not!) be.
I saw a piece of code *count* (literally!) the bytes in a file to
determine its size. \"Um, didn\'t it occur to you that knowing the
size of a file is something MANY folks would want to do and, thus,
might have a mechanism in place to yield that value directly?\"
I saw a piece of code that stored three copies of a 128 bit value
as a way of ensuring it\'s integrity. No knowledge of the math
behind such efforts. (\"Hamming distance? What\'s that??\")
People tend to think the way they have always *expected* numbers to
behave and forget they aren\'t in the \"real world\" anymore.
[Everyone knows that N/3. * 3. = N, right?]
I\'ve seen experienced programmers make these mistakes when converting
integer-based algorithms to FP. They see that it works in its
integer form and think just typedef-ing everything as floating
point will *continue* to work (\"But I haven\'t changed any of
the code!\")
[I implement BigRationals in my applet language so average joes
don\'t have to worry about rounding errors, overflows, etc. when
*they* \"write code\"]
Given:
then = 22:50:00
now = 23:10:00
there must be 20 minutes in the delimited interval, right?
Simple modular arithmetic problem... (oops!)
I watched a CNC router cut a perfect circle in a sheet of steel -- save
for the discontinuity as it *closed* the circle (\"oops! *that\'s* not
supposed to happen. That wasn\'t an expensive piece of steel, was it?\")
And, if you let the IDE present pretty-printed values to you, you
likely won\'t see the underlying values and wonder why everything
LOOKS correct...
On 2022-01-09 02:10, Dennis wrote:
On 1/8/22 4:28 PM, Don Y wrote:
On 1/8/2022 10:55 AM, Martin Brown wrote:
The classic one when I was at university was that inevitably a
new graduate student would grind the Starlink VAX to a standstill
by transposing what was then a big image of 512x512 with nested
loops.
x[i,j] = x[j,i]
You don\'t even need to be transposing a large object to see this
problem. Just initializing an N-dimensional array is fraught with
pitfalls for a \"programmer\" (who likely has only knowledge of the
language and not the hardware, OS, etc.).
for (i = 0; i < MAX; i++) for (j = 0; j , MAX; j++) foo[i,j] = 0;
vs.
for (i = 0; i < MAX; i++) for (j = 0; j , MAX; j++) foo[j,i] = 0;
[In any of the equivalent forms}
And C and FORTRAN store multi-dimensional arrays is opposite order,
so translating one to the other can cause cache problems.
will stump most \"programmers\". Much the same as:
double x, y; ... if (x == y)...
I once had a colleague come to me when he had this sort of \"failure\".
[...]
Any programmer worth his salt should know that comparing floating
point values for equality doesn\'t work.
Any programmer worth his salt should know (fill in the blank)!
I don\'t think you realize the quality (lack thereof) of \"programmers\"
being churned out by diploma mills. **Anyone** can learn to write code.
**Anyone**!
At school, the standing joke was that the Physics majors would get
their BS, find they were unemployable and return for an MS. Then, find
they were STILL unemployable and return for a PhD. And, when they
discovered there were a shitload of PhDs out there competing for
the same FEW physics jobs, they\'d go get a job writing code!
[To their credit, the Math majors would come to that realization after
their BS!]
But, getting code to compile/run doesn\'t mean it is well written (or
\"correct\") code. If you look at code written by \"programmers\" (esp
those \"self taught\"), it\'s often really amateurish. Their goal is often
just to get it to (appear to) work. Then, move on to something else.
They don\'t care how *well* it works or how maintainable it might (not!) be.
I saw a piece of code *count* (literally!) the bytes in a file to
determine its size. \"Um, didn\'t it occur to you that knowing the
size of a file is something MANY folks would want to do and, thus,
might have a mechanism in place to yield that value directly?\"
I saw a piece of code that stored three copies of a 128 bit value
as a way of ensuring it\'s integrity. No knowledge of the math
behind such efforts. (\"Hamming distance? What\'s that??\")
People tend to think the way they have always *expected* numbers to
behave and forget they aren\'t in the \"real world\" anymore.
[Everyone knows that N/3. * 3. = N, right?]
I\'ve seen experienced programmers make these mistakes when converting
integer-based algorithms to FP. They see that it works in its
integer form and think just typedef-ing everything as floating
point will *continue* to work (\"But I haven\'t changed any of
the code!\")
[I implement BigRationals in my applet language so average joes
don\'t have to worry about rounding errors, overflows, etc. when
*they* \"write code\"]
Given:
then = 22:50:00
now = 23:10:00
there must be 20 minutes in the delimited interval, right?
Simple modular arithmetic problem... (oops!)
I watched a CNC router cut a perfect circle in a sheet of steel -- save
for the discontinuity as it *closed* the circle (\"oops! *that\'s* not
supposed to happen. That wasn\'t an expensive piece of steel, was it?\")
And, if you let the IDE present pretty-printed values to you, you
likely won\'t see the underlying values and wonder why everything
LOOKS correct...