Trigger warning: This post assumes that racism should be avoided.
Despite being a student, I already know how time-consuming it can be to dig thro...
For further actions, you may consider blocking this person and/or reporting abuse
Awesome title :D
Over the years I've relaxed my brace and paren attitudes. If someone has been consistent, after a few minutes I can get the feel of their style and focus on the logic of their code and get hacking.
What still ties me up in knots, and this is about my own coding habits, not other people's code, is long lists of function parameters. I can never decide which is more appealing to the eyes, easier to read, and all while conserving vertical space. So...
or
or
or
Probably the last one is better. For me, I try to prevent my eyes travelling far to the right. That makes me lose focus easily.
Agreed. Also, I don't mind having multiple parameters in one line, but I really need them to be on the left side.
Thanks :D
Another readability hint, don't pass operations as arguments (the glovesAreAvailable). I've stopped doing this a long time ago and it really helps maintenability.
It's nitpicking, I know. But it really helps writing clearer code
I agree for languages where named arguments are not available.
In Go we don't have problems like these, we're Zen ๐.
I'll not that familiar with go - could you please explain how go solved that syntax problem? :)
Sure, the core dev team, who made the language, also made tools for static analysis,linter, code formatting and incorporated some of the rules in the compiler too, this you get these advantages:
blog.golang.org/go-fmt-your-code
A Go "proverb" is "Gofmt's style is no one's favorite, yet gofmt is everyone's favorite", meaining each dev will not like something about the Go standard way, but overall you like it's benefits, because everyone obeys it.
Cool. But how does it indent function calls with many parameters? :D
The rust language has a similar thing, but unfortunately, it will indent many arguments far to the right.
That's the beauty, it doesn't matter and we do not care. We solve problems, we are engineers, coding is just a 20% of our jobs and we shouldn't focus on things that the IDE should do for us.
Unless someone makes a PR to the official Go tool and convince the community that is better his way.
I tried closing braces at the end of the line, 1st alternative syntax, made the code look more "pythonic". Soon gave it up though because of the inconvenience of always having to fix code when removing or adding lines, and removing lines with braces wasn't just a mark line then push backspace anymore if you still needed the braces.
Thankfully, I've rarely seen the parenthesis indentation you consider common, so hopefully I won't have to share this article too often ;)
That's great :)