Have a look at this:

I sort of agree with him. See the comments on Java and whatnot I’ve been making here recently.

But I don’t see why we need to care about inefficencies in structures in ‘C’. If you care about this then use the alignment technique I gave earlier. I like structured data, probably because I’m a database programmer by training and inclination. I can’t stand writing code like this:

select a, b, c, d
into var_a, var_b, var_c, var_d
from bingo where …

gimme

select a, b, c, d
into bingo_rec
from bingo
where ….

This looks trivial. But you try it when there are 20 or 30 columns you are selecting and you (in a fit of editing) inadvertently transpose a couple of lines. Like I say, you have to be disciplined, but why be too disciplined?

Aother thing is I like syntatic sugar around things, I like using structures to pass structured data around. I know (I was trained to program in the 1980’s) that all of the data structures you’ve ever wanted can be modelled using arrays, but I don’t want to. I don’t want to have to think about silly bugs I may have put there when I reinvented my linked-list or stack as a home-grown array for the fiftieth time. A well-crafted utility library (with thousands of users) will be more reliable (eventually) than anything I write myself.

This approach to coding also doesn’t work well with teams and different levels of ability. To write code in the ‘C’ and no datatypes style requires a good memory and lots of discipline. This isn’t a bad thing, just very challenging to find enough people with that mind set (and talent, to be honest). Java is very much a big-corp, lots of specifications, language. It lends itself to that approach because of the built-in support for interfaces and polymorphism that object-orientation gives you.

It’s just that I’d like the whole purple spotted o-o bus to be optional (or gradual) when I need it.