Linked by Thom Holwerda on Tue 15th Jan 2013 21:24 UTC
General Development "I was really excited to write this article, because it gave me an excuse to really think about what beautiful code is. I still don't think I know, and maybe it's entirely subjective. I do think the two biggest things, for me at least, are stylistic indenting and maximum const-ness. A lot of the stylistic choices are definitely my personal preferences, and I'm sure other programmers will have different opinions. I think the choice of what style to use is up to whoever has to read and write the code, but I certainly think it's something worth thinking about. I would suggest everyone look at the Doom 3 source code because I think it exemplifies beautiful code, as a complete package: from system design down to how to tab space the characters." John Carmack himself replies in the comments.
Permalink for comment 549026
To read all comments associated with this story, please click here.
Comment by Nelson
by Nelson on Wed 16th Jan 2013 16:11 UTC
Nelson
Member since:
2005-11-29

I think people focus too much on naming conventions, curly braces, semi colons, and camel casing. There's not enough focus on the act of engineering something that's sustainable a few months down the road.

Too little attention is paid to the design of your object model (if you're oo inclined), the decisions made around multi-threading, and the relative costs of what you use in the language.

I've seen countless examples of people obsessing over for example how comments would be formatting, only to end up producing this over engineered bullshit code that is unmaintainable. But I guess itll keep them from scrolling vertically (on their text terminal I presume, because we magically traveled two decades back in time where that kind of shit matters)

And whats worse is that these questions are even more important in C++ where the compiler and run time make less security, resource, and correctness guarantees.

Its more important to know who owns what reference to what object, or what threads will call this method, what synchronization primitives we're going to use, how will we handle dependencies, or component failures, etc. This is the real bread and butter of programming.

Reply Score: 2