jens bendig
Posts: 9
Nickname: jensbendig
Registered: Jul, 2006
|
|
Re: What is the Worst Code You've Ever Seen?
|
Posted: Jan 11, 2007 7:20 AM
|
|
Hello Darryl,
yes, the thread ist great. Unfortunately I don´t agree with you:
The first example: I think, it´s a good idea, always to formulate the else-branch, even if not necessary and there i.e. through an Error. Just in Case, some other coder changes the if-Branches or adds some other conditions, you cannot know that. The construction as a whole will keep stable. I don´t think it´s an attitute if you look at that in a bigger context and specify plan X to "throw an Error".
The second example: If I agree or not does strongly depend upon the context we are programming in: If g stands for a well understood concept, it´s a good idea to name g in a separate variable, just to let everybody know, that we are not only talking about f-1 but we identify this value as the well-known g-thing. In some cases, this maybe bad code, in some other cases, where g means something commonly understood, it´s very good code.
Yours,
Jens
|
|