4 ms·
I wonder how much this varies by programming language. In Go, gofmt ensures that most stylistic choices are similar for everyone (Go code tends to look alike) a
by rustyfe 9y ago
I wonder how much this varies by programming language. In Go, gofmt ensures that most stylistic choices are similar for everyone (Go code tends to look alike) and patterns and rules are fairly well codified (Go variable and function names tend to follow certain rules). The more codified the code is, the less fingerprints each developer can leave.
It'd be interesting to see the most and least identifiable languages!
- ycmbntrthrwaway 9y agoIt is not about tabs, spaces and variable names. The main difference is how long your functions are, how many functions they call, how deep control structures within functions are etc.
- lucb1e 9y agoWould be interesting to tie that to ratings. Have a diverse set of people read lots of code (samples from projects large and small, in different languages, etc.) and rate it on things like "easy to understand" and "easily extendible", then correlate that with styles. I'd be very interested in how I score and what I can improve.
- hathawsh 9y agoIt sounds like you're talking about cyclomatic complexity. https://en.wikipedia.org/wiki/Cyclomatic_complexity https://en.wikipedia.org/wiki/Cyclomatic_complexity There are tools out there for most major programming languages for measuring cyclomatic complexity. They can tell you whether typical coders will be able to help you work on your program at its current complexity level.
- lucb1e 9y agoI heard of this but haven't seen it used anywhere outside of school. Do you have any experience whether this correlates with how readable people find code to be?
- WalterBright 9y agoMy style changes over time.
- staunch 9y agoAs long as it changes gradually, or partially, that might not matter.
- amelius 9y agoI'm also wondering if this transfers between programming languages, and to what degree.
- amelius 9y agoIs it good or bad if a programming language leaves room for personal style?