Anyone who says "code should be self-documenting" probably doesn't comment their code enough
-
-
Arguably a sign that it should be refactored into smaller functions named for each step.
-
This would add unnecessary indirection and make it way harder to follow along with how the result of this function is being built
- 4 more replies
New conversation -
-
-
This code looks like part of a simple shell interpreter that interpolates certain segments of a command with other values. This particular code looks like it takes the segments of a command, and leaves it intact (if its type is a string) or interpolates it (if its type...
-
... something else). The something else looks like it could executing a subshell (which itself may contain commands or other subshells), variable references (e.g. by name, by position), uses # to denote expanding to the number of positional parameters in use, and * to ...
- 4 more replies
New conversation -
-
-
Because it can be better. Clear variables aren't enough
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Run the tests and read them, they are a living spec of what the code does. You don’t need comments for that unless you generate docs for your consumers out of them.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I’m sorry but don’t think it’s fair to argue for putting comments in code and supporting it with such a horrendous piece of code. Nested, long switch statements? C’mon! They could have the best var names in t world but it looks like they have a bigger problem there.
- End of conversation
New conversation -
-
-
The problem with that code isn't lack of comments, its Cyclomatic complexity is astronomical. There are nested loops, breaks, switchs, ifs, side effects and exceptions. It wouldn't matter if every line is confirmed, there is no way anyone can load that in there head!
-
Oh and concurrency to boot
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
he/him 
