Sign in to follow this  
  • entries
    51
  • comments
    129
  • views
    82441

"How Not to Program in C++: ..."

Sign in to follow this  
Muhammad Haggag

278 views

Saw How Not to Program in C++: 111 Broken Programs and 3 Working Ones, or Why Does 2+2=5986 on the "Top list" on the ACM online bookshop thing (Members only). I was dumb enough not to read reviews first, and took a look. Basically, it's very disappointing. I've read 4 chapters so far, hoping that I'm going to find advanced tips and tricks on how to better write C++ code. All I found is lousy programs with lousy bugs that only the most lousy programmers would do. One of them would even ONLY happen if you're using notepad or some similar editor without syntax highlighting (Basically, A C-style comment /* */ that hasn't been closed, so was closed by the next C-style comment, rendering the code in between useless. Yeah, these are the kinds of "puzzles" the book is filled with).

What I have enjoyed so far (and one of the reasons that kept me reading, besides desperately searching for something useful) was quotes like this, scattered throughout the book:

Quote:
From a FORTRAN manual for Xerox computers
The primary purpose of the DATA statement is to give names to constants; instead of referring to ? as 3.141592653589793 at every appearance, the variable PI can be given that value with a DATA statement and used instead of the longer form of the constant. This also simplifies modifying the program, should the value of ? change.


Maybe I'll write a review once I finish the thing (I've started it already) so that other people AVOID it.

EDIT: Heck, maybe I'll actually end up recommending the book, just for its funny quotes:
Quote:
One plotting program I know of has the most obsequious error messages ever programmed:

This humble and worthless program is devastated to report to you that I can not accept your scale value of 1000 because the base and thoughtless programmer who wrote me has restricted the value of this variable to between 1 and 100.
Sign in to follow this  


2 Comments


Recommended Comments

Yeah, it was pretty devoid of challenging puzzles when I flipped through it in the bookstore.

However, my time reading it was cut short by bookstore ninjas, coming forth from the coffee store to decimate my fragile self esteem. Vaulting over their heads, I fled into the street and into the night.

Nice quotes, though.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now