3 ms·
I'm not sure if I understood the article fully, so I would appreciate if someone could give me an explanation. From what I understood, and by reading the comme
by saganus 12y ago
I'm not sure if I understood the article fully, so I would appreciate if someone could give me an explanation.
From what I understood, and by reading the comments, it seems like there are certain patterns in code that could be somewhat-universally flawed? Like seeing a lot of indentation without meaningful code in between?
Or am I getting this wrong? Is it really possible to establish a "score" of sorts for how the code looks without actually looking at what it does?
If it is, then it would seem like an interesting idea to build a code "shape-analyzer" that would give you the same type of analysis. Or is this too hard to describe in terms of patterns that we can see but can't explain?
I think I need my morning coffee... am I making any sense?
- Cthulhu_ 12y agoYou are, but maybe the article isn't :p. I can identify with the post, but maybe a bit differently; when I read code, especially in a language I'm familiar with, I see patterns instead of individual lines of code. So when a piece of code breaks the patterns, or breaks a rhythm, or looks different from the other code, my spider sense tingles and I frown upon the code. There could be nothing wrong with it, but it looks different so I end up refactoring it until it fits the rest of the codebase and I understand it.
- saganus 12y agoThese patterns you speak of, are they on your own code or could you do the same with some one else's code? I ask this because I think I could do it with my own, but not sure if I could with another one's. Or maybe to the odebase of a particular product instead?
- goblin89 12y agoOP presents a few common anti-patterns in a humorous way. The shapes are how these anti-patterns might look in Ruby code, but anti-patterns themselves are language agnostic. Shapes are really just for illustration, but they also emphasize the irony: “you’re part of a preternaturally enlightened dev team” yet you review your coworkers' code without even reading. Perhaps there's something to be read between the lines. :)
- saganus 12y agoAh. Much more clear now. Thanks.