Quality of code is getting lower and lower?

Started by
81 comments, last by Raloth 19 years, 9 months ago
What if "a" changes a few times in the middle of the code?
Besides, my way, you can add the a variable in the for code, otherwise it has to be declared before, which makes the code less readable.
Advertisement
It's not necessarily getting lower at all. Read these articles about "real programmers" and you'll see how the art of optimizations in assembly and using special tricks was once "teh cool" while now instead OOP and virtual machines are used.

http://wcp.sdf-eu.org/realprogrammers.html

The best part is at the bottom ;)

Quote:
Perhaps my greatest shock came when I found an innocent loop that had no test in it. No test. None. Common sense said it had to be a closed loop, where the program would circle, forever, endlessly. Program control passed right through it, however, and safely out the other side. It took me two weeks to figure it out.

The RPC-4000 computer had a really modern facility called an index register. It allowed the programmer to write a program loop that used an indexed instruction inside; each time through, the number in the index register was added to the address of that instruction, so it would refer to the next datum in a series. He had only to increment the index register each time through. Mel never used it.

Instead, he would pull the instruction into a machine register, add one to its address, and store it back. He would then execute the modified instruction right from the register. The loop was written so this additional execution time was taken into account -- just as this instruction finished, the next one was right under the drum's read head, ready to go. But the loop had no test in it.

The vital clue came when I noticed the index register bit, the bit that lay between the address and the operation code in the instruction word, was turned on -- yet Mel never used the index register, leaving it zero all the time. When the light went on it nearly blinded me.

He had located the data he was working on near the top of memory -- the largest locations the instructions could address -- so, after the last datum was handled, incrementing the instruction address would make it overflow. The carry would add one to the operation code, changing it to the next one in the instruction set: a jump instruction. Sure enough, the next program instruction was in address location zero, and the program went happily on its way.
Quote:Original post by Raduprv
What if "a" changes a few times in the middle of the code?
Besides, my way, you can add the a variable in the for code, otherwise it has to be declared before, which makes the code less readable.


Well, if that's the case then it would look some other way, but the discussion is getting a bit silly I think most good programmers agrees that powerful loop and conditional constructs are important and properly used lead to better code, that you failed to show the importance of break with three lines doesn't mean it's not the best option in many cases just that the details aren't that clear cut that's what experience and good judgement is for. The OP clearly has a quite limited understanding or has been spoon feed catch phrases like "gotos are evil" and "each function should have only one exit point" etc, they're common in academic settings as is training students to not use their brains.
HardDrop - hard link shell extension."Tread softly because you tread on my dreams" - Yeats
Yes, I agree.
The thing is, while goto should generally be avoided, there are some situations where avoiding using it can make the code less readable, and add some errors.
Nothing is "evil", it's all about preferences.
The quality isn't nessicarily declining (although with the increase in non-programmers using RAD tools, it might be on avarage), but the focus is.

With the trend towards faster, bigger computers, and programs getting more complex the focus has changed from speed hacks and clever tricks, instead reliability and maintainability are more important. Of course, games still strive for all of those, which is possibly why 'unsafe' coding and 'clever' hacks are more widely accepted.
Quote:Original post by DigitalDelusion
they're common in academic settings as is training students to not use their brains.

Bingo!

If I had to make a comment about programer quality decreasing, this would be it. Although, as the above poster pointed out, the raw number of "good" programers is probably incresing, the number of "bad" programers is increasing more rapidly. So on average, the quality of programers is decreasing.
Quote:Original post by Raduprv
Yes, I agree.
The thing is, while goto should generally be avoided, there are some situations where avoiding using it can make the code less readable, and add some errors.

name one

[Formerly "capn_midnight". See some of my projects. Find me on twitter tumblr G+ Github.]

Somebody hunt down the sample in the DX SDK that had a goto in it. I'm not sure if it was in 9, but it was definitely in 8.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Quote:Original post by capn_midnight
name one


Like, for example, if you have many nested fors/whiles, and an error on the lowest for calls for a total quit of that for group. Yes, I know, there are alternatives, but using goto makes the code cleaner (if used wisely).
I think someone here was on to something--the quality of code is completely dependent on the quality of the coder. I personally believe that the quality of coders has declined significantly.

This is a direct result of programming and programming languages becoming more accessible to people. Would there be as many coders today if we could only use assembly language? Probably not.

However, this decline in code quality really shouldn't be a bad thing. I see it as a good thing that more people are getting exposure to computer programming, etc... maybe the world wouldn't be so messed up if people thought more logically about things.

This topic is closed to new replies.

Advertisement