Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
Get a devDuck
Rubber duck debugging has never been so cute! Get your favorite coding language devDuckBuy Now
Search - "wk190"
Spaces produce bigger binary when compiled from code then tabs.
Ladies and gentleman, this was my friend who studied computer science at University.33
Like fuck off with that.25
No, listen to me. I cannot approve this PR because your code does not comply with our code style. All the imports and annotations must be sorted in ascending order by length. They must all make fir-like blocks of code. Because it looks nice.
Now go and fix your code
I just smiled and walked away to obfuscate my code with firs . I had no idea what to even say to that... I still don't13
Let's comment out this block of code so later we know we have this feature and bring it back if we need it.
Later: commented code everywhere, literally everywhere!!! Shit7
Was forced to code like this:
Instead of this
Also I should mention that this happened 4 years ago and my mentor (27 years old economy major at the time) did not know how to use git, we stored projects on a shared networking folder.16
my previous boss once told me [ ] array initializing syntax will be depricated in php 7 (few years ago) so i should only use array() instead.
couple months back after i got used to always using the latter i found out the first was never depricated but he just prefered how array() looks6
during code review...
peer: "you should pass this variable, and extract the logger from it"
me: "why? it is a 3 line logging function. why not pass the logger instance?"
peer: "because that is our best practice. It is the way we do things"
me: "why is it a best practice?"
peer: "because it is. We use it everywhere!"
me: "No we don't. And I still don't understand why is this a best practice. can you explain?"
peer: gives ups, did not look at the mr, and was not going to.
mr stays open. probably forever.12
Literally tabs vs. spaces. The joke is everywhere, and the people taking stances have clearly never used find+replace.9
Code style arguments are stupid and waste of time, thus I never have them.
But fuck I hate yoda conditions, most stupid shit someone could come up with. It’s not even about the style, it’s about the way how one must change their thinking to evaluate condition from the opposite side...7
No arguments.. just me bitching over
that some guy thought would be nice to have in same file..
Just pick one, even if it's incorrect for the language, ffs!!6
"If you don't return something in the catch block it will crash"
Isn't it interesting how a sentence can be true yet so infuriatingly wrong.3
all of them. countless wasted hours.
as fate decided to turn me from $random-dev-geek into "the guy that calls the shots in tech", one of my earliest decisions was to automate formatting.
everywhere, automated at CI.
gofmt was an inspiration for the industry.
js?/ts? use prettier
C++? use ClangFormat
always default settings.
enforced by pre-commit hooks and CI.
never a single argument about bracket style, I don't care if someone likes single or double quotes better.
"fucks given" counter is fixed at 0.
everybody prefers it (ok, sometimes after a while sometimes)
of course there is still some more conventions to do for us humans.
IMHO the most critical ones.
like naming or even casing (camel, snake, kebab, - which one works where), but taking out most of the "so what" decisions takes discussions to a much more resonable level.6
Never had a coding style argument because my workplace doesn't have any standards, mix of C# and VB sure why not, 2K line VB service with 6 comments total? Sure no problems there.
The only styling we have is our personal preferences, except when it's my projects, then every adheres to the styles I set because I won't merge their 800 line monstrosity of a file with 18 classes.9
I don't really get it why my co-male dev does not like ternary operator as a shorthand operator for if/else statements.16
Hello, I'm so nerd.
I want to build my avatar here. And even don't know what is a 'Rant' 😅.
But, I can tell a little story...
I'm learning js with an online teacher who has the most adorable Argentinian accent and now I talk like him.7
I'm shitting there hammering out some code butchering some real problems when I suddenly realise I'm surrounded. I look around and yes it's the bloody committee.
The committee is what I call the rest of the department and it is dominated by the old guard which comprises of the programmers that have been around for longer.
None of the old guard can program particularly well but because they had been around the longest they'd all grown senior. The committee had free reign but anyone else doing anything differently has to get approval from the committee.
The only way to code otherwise was to copy and paste existing code then to primarily rename things. If anyone did anything that hadn't been seen before then it would have to be approved by the committee. Individual action was not permitted unless you were old guard.
I swept my headphones away expecting it to be something unimportant. It was.
First things first they announce. We're going to add extraneous commas to the last element of all possible lists separated by comma including parameters or so they say. Ask but why so I do.
Because the language now supports it. They added support for it so it must be the right way someone proclaimed. Does it? I didn't realise we were waiting for it. Why do we want it though?
Didn't you hear? It's all over the blogosphere. It massively improves merge requests. But how I ask?
Five minutes later I grow tired of the chin stroking, elbow harnessing, slanted gazes into the yonder and occasionally hearing maybe its because and ask if they mean when you for example add an element the last element registers as changed from adding a comma. Turns out that's all it is.
How often do we see that tiny distraction and isn't it pointless to make the code ugly just for a tiny transient reduction in diff noise I ask. Everyone's stumped. This went on and on and got worse and worse. But it makes moving things around easy half of them say in unison like the bunch of slobs that they are. I mean really. It doesn't make expanding and contracting statements from multiline to single line easy and it's such a stupid thing. Is that all they do all day? Move multi-line method parameters up and down all day? If their coding conventions weren't totally whack they wouldn't have so many multiline method prototypes with stupid amounts of parameters with stupidly long types and names. They all use the same smart IDE which can also surely handle fixing the last comma and why is that even a concern given all the other outrageously verbose and excessive conventions for readability?
But you know what, who cares, fine, whatever. Lets put commas all over the shop and then we can all go to the pub and woo the ladies with how cool and trendy we are up to date with all the latest trends and fashions then we go home with ten babes hanging off each arm and get so laid we have to take a sick day the following to go to the STD clinic. Make way for we are conformists.
But then someone had to do it. They had to bring up PSR. Yes, another braindead committee that produces stupid decisions. Should brackets be same line or next line, I know, lets do both they decided. Now we have to do PSR and aren't allowed to use sensible conventions.
But why, I ask after explaining it's actually quite useful as a set of documents we can plagiarise as a starting point but then modify but no, we have to do exactly what PSR says. We're all too stupid apparently you see. Apparently we're not on their level. We're mere mortals. The reason or so I'm told, is so that anyone can come in and is they know PSR coding styles be able to read and write the code. That's not how it works. If you can't adjust to a different style, a more consistent style, that's not massively bizarre or atypical but rather with only minor differences from standard styles, you're useless. That's not even an argument, it's a confession that you've got a lump of coal where your brain's supposed to be.
Through all of this I don't really care because I long ago just made my own code generators or transpilers that work two ways and switch things between my shit and their shit but share my wisdom anyway because I'm a greedy scumbag like that.
Where the shit really hit the fan is that I pointed out that PSR style guide doesn't answer all questions nor covers all cases so what do we do then. If it's not in PSR? Then we're fucked.4
So my MCU teacher said I should use a long ass ternary to determine which pins should be set high for a given number on a seven segment display. Cause the display was on a single 8-bit port on the mcu I decided to generate a bitmask with a switch statement and set the port directly.3
Tabs vs Spaces.
Not because one of them is definitely better than the other, but because it's 2020, we have editorconfig and everybody should just use what he personally prefers.8
Spaces vs tabs has kind of become a non-argument for web tech and the former has won (at least in every place I've worked or observed in open source projects).
Although I don't really care (just stick to one for the same codebase) I don't get why spaces won. Given the argument is mostly about how we like to read code individually, and tab width can be configured per editor while space cannot, why did spaces win?9
I tried once to convince an ex-python dev not to write 100 lines long shitty indented functions and seperate that stuff but no it works just fine why should I or anyone else be able to read it.
Worst coding style argument has to do with self-declaring a development style based on brand loyalty.
“I’m a Microsoft programmer” means I do whatever Visual Studio allows me to do while letting me avoid learning how the framework works. Okay everybody. Reset your IDE to the default styles so we can all be the same. Also mandatory IDE usage.3
I haven't really had any. That is to say, I haven't worked for a company with a coding standard :/3
Where should starting brackets be positioned if/else and function definition in C? Same line or the next line. Have not seen pure cosmetic bullshit like this.10
No one should ever argue over ANY coding style unless they're just starting out and thus have to come up with their organization's coding standards for the first time.
Once the standards are set, everyone should just comply with it irrespective of their personal preference. Or alternatively, include back-and-forth code formatting into the development workflow.
The only thing that's important is that by the time code is pushed into the codebase, it is formatted according to the defined standards so that the whole thing looks consistently written, which is basically the point of setting a coding standard.2
When people try to tell me that spaces are better than tabs and that PascalCase is better than snake_case :-310
"We don't need redux with immutability in our react-native app."
True dat, home-slice bread-slice. The benefits of immutability are on a case by case basis. But you see that one API query you have there which runs on initialize and fetches a complex JSON object that goes at least 8 nests deep? That's one of those cases. I hope you choke when you swallow your pride.
I saved myself headaches and whenever some one talks about this thing, I leave ...
Code gets complicated? Blame the one who forced that coding style in front of management and go to sleep peacefully.
Either work like an adult and accept criticism or go away and let me do what I'm paid for ...2
I have no one to argue about this with, I'm the only developer in my place of work, but I can say that the arrangement of the import statements sucks my nuts no PR is accepted just because they want to see first inbuild imports, then third party, then imports from current projects, why why why!!! that doesn't harm anyone in the world!!!! but just my time!!!3
PM: 'the project is going down but the client is so happy from you.. he is inviting you to a new similar one'
Giving me work for more than a year and still doing... opening new positions and boosting the company a little1