code aesthetics
-
Theodore M. Seeber wrote:
I can READ CODE, rather than READ COMMENTS.
Right there with you, however, I'm learning that I'm in the minority on this one. Another thread (or it might have just been an article - don't remember now) in recent months discussed how programmers tend to "think" in the first programming language they learn. While Pascal was technically the first language I learned, C++ was the first I used to any real purpose. I can "read" C/C++ written by another C++ programmer, quite easily. C++ written by someone who "thinks" in VB is gobbledegook to me, I struggle to follow un-commented VB code and I'm pretty sure that any VB code that I write without comments is indecipherable to a VB programmer! The educational background of one of my colleagues has been very theory-based so he actually "thinks" in pseudo-code - which means it's almost imperative that he write comments first (to lay out the pseudo-code) before he can translate into program code!
T-Mac-Oz "When I'm ruler of the universe ... I'm working on it, I'm working on it. I'm just as frustrated as you are. It turns out to be a non-trivial problem." - Linus Torvalds
True to a certain extent. Those of use who started out in "no style" languages though, like early 1980s line number basic or Motorola Assembly, can get to the point where we read in any language. It also helps that I had training in a large variety of languages in college; usually takes 2-3 days for me to switch between, and then I'm comfortable again. SQL, VB, Forth, Fortran, Cobol, C-derived, Lisp, single-or-multi threading; there are only so many combinations. And to think it used to be said that anybody who started out in a language with a freestyle jmp or goto instruction was ruined forever! I think it just made me much more tolerant of different styles in the long run- debugging spaghetti code makes you ready for *anything*.
-
Vikram A Punathambekar wrote:
I wish VS had a similar shortcut for stripping out Hungarian notation!
Take out the annoying MS "redundant data type - already known from declaration" Hungarian
John M. Drescher wrote:
I want a shortcut for adding it to code that does not use it!
And put in the proper "this prefix indicates how the variable is expected to be used" Hungarian?
T-Mac-Oz "When I'm ruler of the universe ... I'm working on it, I'm working on it. I'm just as frustrated as you are. It turns out to be a non-trivial problem." - Linus Torvalds
Being that I have written 500K lines of MFC I have grown very accustomed to using Hungarian notation and I like it. Many times if some one sends me a small code sample without Hungarian notation I will add it myself...
John
-
I take care to ensure the aesthetics of my code. That spacing and formatting is consistent. I don't care if I'm writing throw away code or production code. The code should always look neat and tidy. Why don't other programmers do the same??? OK, I'm sure there are some out there. And yes, there are code beautifiers, so who really cares, right? What's your thoughts on whether code should look good, in terms of spacing, formatting, structure, etc.? Marc
My code is beautiful. By definition. :-D
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]