3 ms·
> More difficult to read Subjective, and I do not find it more difficult to read. On the contrary, I often find shorter and denser expressions (especially aro
by thrwaeasddsaf 5y ago
> More difficult to read
Subjective, and I do not find it more difficult to read. On the contrary, I often find shorter and denser expressions (especially around obligatory fluff that doesn't actually do much) to improve readability and make it easier to focus on the interesting part.
> more difficult to edit
Subjective, and I do not find it more difficult to edit.
In general, as long as you're not using a magnetized needle as your editor, creating new declarations or moving declarators around shouldn't be a challenge. It is trivial.
Nevertheless, if we want to consider the relative difficulty of various trivial edits, it can go both ways as far as multiple declarators per line are concerned. It can be easier to edit when you have a set of related variables and you need to change the type once. If you split them on a bunch of lines, you need to remember to change every line, which is more work and larger diffs. Oh the horror...
> but the worst thing is how difficult it makes diffing code.
I agree that it can make diffs a little harder to read but I have not found that to be a big issue in practice (having worked on both styles of code professionally and as a hobby for more than two decades).
If diffs were such a major concern, then we probably should adopt an assembly-style syntax with one instruction per line and no nested indentation. That would keep lines inherently short, so you don't have to locate and read the small change on a longer line. And you'd never have to pick small changes from a large hunk that is large mainly due to changed indentation. (At this point, I'd like to make a point about how splitting everything to more and more lines isn't always good for readability but I think I made that point already.)
By the way, you might wanna try out one of these modern diff tools that can hilight the actual change on a diff line.
> You should try using some kind of code versioning, git is a popular choice.
I can assure you that "multiple variables per declaration" have never been a problem for me with git. Coincidentally, the source code of git itself does have multiple declarations per line so looks like it wasn't a big problem for the authors of git either. (Obligatory example: https://github.com/git/git/blob/89b43f80a514aee58b662ad606e6352e03eaeee4/tree.c#L97 https://github.com/git/git/blob/89b43f80a514aee58b662ad606e6...)
- monsieurbanana 5y ago> with one instruction per line I shouldn't be surprised, of course you're also the kind of person who writes terribly long lines of code. We have ultra-wide screens nowadays, better put them to good use. Anyways, you might think you're making a point by repeating "it's all opinions", but that doesn't mean your single opinion is equal to everyone else. And on the subject of one vs multiple declarations, you're overwhelmingly in the minority.
- thraway123412 5y agoFor personal project my hard limit is 80 cols. For work stuff, mandated by employer, we do something like 120 cols with clang-format. Four or five columns of code side by side, so I can see hundreds of lines of code at once. I still prefer not to waste too much vertical space on fluff. It doesn't sound like you understand the difference between block structured code with a function call syntax and assembly. Thanks for the attempted ad hominem btw ;-) > Anyways, you might think you're making a point by repeating "it's all opinions anyways", but that doesn't mean your single opinion is equal to everyone else. You keep missing the point. Did I say "that's just nasty and bad habits" about your preferred style? Nope! All I'm saying is that it'd be nice if people stopped presenting their preference as objectively good style and telling that everything else is nasty and wrong. We don't need to share the same preferred color either. The first comment in this thread would've been a lot more palatable if it just said "I don't like this style." That would also give the comment the right weight: it is just an opinion after all. I don't think popularity of opinion should matter for discourse. Of course I know I'm in the minority, and that's why I think it's all that much more important to state my opinion. Or do you want to live in an echo chamber where only the popular opinion gets said and everything else is painted nasty and wrong and downvoted to hell? Well, that is pretty much what HN is today. I hope you're not contributing to that.
- klibertp 5y ago> you might think you're making a point by repeating "it's all opinions", but that doesn't mean your single opinion is equal to everyone else. You're very wrong. Readability is currently impossible to measure precisely. All the opinions are grounded in impossible to quantify and define personal skills, predispositions, and habits. "It" may be "more readable" to you. And your friends. That is still just your (and your friends') opinion, describing a feeling you have. It's not measurable. It's not provable. It's just what you think is happening, but that's it - just a thought. No facts. No measures. No definitions. As long as your opinion has these qualities, yes, it's equal to everyone else's. The problem with that is that it's narrow-minded. You should try to understand that, in different circumstances and for different people, the feeling of what's readable and not readable can be drastically different from your own. There are people who swear by ⍝P⌊ or K and say they're the most readable languages ever. Others will-tell-you-there's-nothing-wrong-with-kebab-case and that (parens (are (not (a) problem) either))))))). Some will tell you that any language will do, as long as you drown it in text (like Knuth's literate programming). Yet others will try to make prose be executable, like in Inform. Some will tell you $igil$ improve readability, some will say they don't. Some will be horrifiedSeeingCamelCase, others will_see_underscores_as_ugly. Some will fight for apps hungarian, some will lead a crusade against hungarian notation as a whole. The opinions are varied, exactly because there is no hard data to support any single position. Your opinion is yours to have, and you may live in a time and place where people you interact with share the same opinion, giving you an illusion of importance. One step outside of your bubble will show you otherwise - it's just an opinion, one of many, and not magically better just because it's yours.