
Permalink for comment 463603
Bad habits coming back to haunt you
by saso on Tue 22nd Feb 2011 22:22 UTC
Member since:

Many of the points in this article seem related to dealing with problems caused by poor programming practices:

3. Data Access

Anybody who writes a struct directly from memory to disk deserves to have their fingers broken... (joking).

4. 64-bit Programming Rules and Skills

The problem is that managed environments, training and schools have encouraged an attitude that programming is just manual labor of writing lots of text, and essentially downgraded programmers to simple code monkeys.

5. Operating System Feature Access

The example with the Windows registry here is just a plain example of bad habits proliferating. App developers used the registry in a clearly stupid way (putting binary-format dependant data in it), forcing Microsoft to come up with an even stupider approach to dealing with 64-bit apps and the registry.

7. Trick Code

Sometimes unavoidable, such as when writing a very hot inner code loop in assembly, but every such occurrence should be clearly separated out in the application into a platform-specific section of the source tree (e.g. Linux's source tree contains an arch/ subdirectory holding all architecture-specific code). Sprinkling these gems around in generic code just reeks of utter ignorance.

9. Supporting Hardware

No shit, Sherlock. Each time you interact with data sources external to your own address space, you CONVERT the damn data. You don't just read the bits and put them in memory - case in point, ever wonder what that "network-byte-order" thing is?

What I see in most of my peers is that they genuinely lack any sort of detailed understanding of how computers operate at a low level. To make matters worse, many managed environments nowadays hide all the complexities in programming (like pointer arithmetic), leaving inexperienced programmers at a loss when they actually do encounter a low-level problem that the management environment didn't manage quite as well as they'd hoped. I think schools and employee training programs should (re)introduce courses in assembly programming, best across a wide variety of platforms (CISC/RISC, endianness, word-size differences, large memory environments down to microcontrollers). Or maybe I'm wrong and just happen to run into the wrong people all the time.

Reply Score: 5