V
V
Vladimir Grabko2016-06-12 07:11:33
Programming
Vladimir Grabko, 2016-06-12 07:11:33

Do you believe McConnell?

I'm reading Steve McConnell's Perfect Code 2nd Edition. On the fly I came across b48c6a513b3a49a2b76a2ac0c378a4d4.png
He is talking or to score?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
cijiw, 2016-06-12
@VGrabko

The point is that your code should be clear to another programmer on the go, without grinding his brain.
If your code needs detailed commenting, then this is bad code.
In large teams, when creating complex projects, there is a rule - write easier .
Multiplayer server?
I've been working on a huge PHP project (one of fifty developers in the company), and I don't even imagine it in the Python or Ruby ecosystems. And writing this in Node.js or Go is just suicide.
By the way, any code optimizations that were detrimental to readability were forbidden ;)
Even if less optimized, but simpler, clearer, more understandable. It eventually pays off when one programmer helps another, when one programmer replaces another, when one programmer tests another. In the end, even when the same programmer edits his own code , but did not get enough sleep or was tired or sick or in a bad mood.
However, without commenting at all (for example, on exported / public elements) is also impossible.
IMHO, it is normal to explain how the module logic works for using it from the outside (public interface, public API). Inside the module, you need to explain only occasionally, only non-obvious points. Such moments should be at least.
Formatting provides eye addictiveness and ease of reading. Therefore, large offices even have uniform formatting rules when - when everyone is required to write the same way. This raises the productivity of programmers when performing code reviews of someone else's code and when looking for any necessary information in someone else's code.
This is so important that in recent languages ​​(like Go) certain code formatting is a common language standard.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question