
Is writing compact code a good idea please explain your answer?
Some programmers like to write code that is as compact as possible, for instance, using the increment (or decrement) operator in the middle of another statement or using very short, cryptic variable names. Typically, these programmers document their program with very few comments. Explain whether this is a good idea, keeping in mind that a program “lives” through a certain period of time.
I would appreciate ur ans
thank you all for taking time to ans this question.
It really is not a good idea. The fact is, the code still generates the same amount of instructions, so it is only compact in the way it is written.
Some people decide to do it so that others cannot read their code. Others just do it to annoy people.
Whatever the reason they do it, the only thing it really changes is the size of the source file, and perhaps some typing time.
A code that is written out in a non-compact way is much easier to read, understand, and if needed, to update (change).
Due to the life cycle of a program, you may need to update your code. If you have made it compact, then it may be harder for you to find where to change it. This is usually because you made the code a while ago and have done other things since making it, so you will prbably need to read through the whole code to find what you are looking for to change.
Whereas, a well written code, that has meaningful variable names, etc, can be a lot easier for you, or someone else, to know what you have done, and if you need, or someone else needs, to change the code, it is a lot easier.
Remember the fact that people change jobs a lot more these days, or even positions in the same company. So the code you wrote a few months ago may not be the code you are updating today. It might be someone else updating the code. They may not understand what you have written, and it could take longer to get the updates done.
Also, you may have moved to another company, and some person at your old company now needs to check your code. If it is unfortunate enough that the person doing the updating is not experienced enough to understand compact code, their job may be at risk, even though it is your fault, and really not theirs.
So think about yourself, and others, when writing code.
What about this scenario. You need to go for an interview at another company and they want to see some code that you have written. The person doing the interview may not have much experience in coding and sees a compact piece of code. how could they know what you are doing? You probably would not get the job.
How To Upgrade Rebel Simcard II Firmware using the compact and pro full size rebel Programmer