Programming pet peeves

...

...

that‘s just the 80/20 rule in effect

Space users should be shot and killed. Tabs for indents, space for alignment. Anything else is absolute cancer and fucks the shit out of formatting and isn't well-handled by most editors.

...

You are a danger to programmers everywhere and need to be terminated for the greater good.

It's like there are programmers with autism super powers who know exactly what it connected to what.

More programmer austism

For fuck's sake, I'm not asking for a complete thesis, but give me some pointers.

Installation, changelog, bugs, contributors, license... let's just throw it all in there. And let's not write a table of contents.

You have severe autism. Get yourself checked. Caution: your brain may also be hard to find.

What's wrong with that?

...

It's a good indicator that the only one who knows what the fuck is going on with the code is the guy who single handedly programmed the thing. Thus making it hard for newcomers to contribute anything non trivial.

Literally 99% of all projects on github are like this.

Sure, because most repos are hobby projects. I was mainly talking about big projects that are actually being used.

Underscores bother me no matter where they're used. It's not not a convenient key to press.

They're quite comfy on Azerty keyboards.

Like what?

The fuck babby language are you using that underscores are a noticeable inconvenience over every other single symbol.

It's a matter of keyboard, not language, /g/.

It's not a language feature, it's part of that retarded pseudo "hungarian" notation where faggots name all of their variables with the variable type attached to the front and put underscores in there because the original way was retarded and nobody could read that shit. The language doesn't need jack shit, people CHOOSE to use underscores.

foo_bar_foobar_bazfooBarFoobarBaz
Which is more readable?

First one no questions asked.

Don't care lol

You should pick the second because it's more difficult for non-English speakers to read.

Seeing my own horrible code :'(

...

...

I find them equally readable. In fact second one slightly more readable at a distance. Moreover the underscores version is longer onscreen.

You should have done something like mood = moods[imax(*moodP)] instead tbh fam, where moods is an array of moods.Whatever in the same order as moodP which is an array of mooP's.

You can choose a different keyboard layout any time you want.

FOo-BaR-FoOBaR-BaZ

What language accepts dashes in variable names?

Lisps

Shit nigger my only coding knowledge comes from a one-week crash course in Python and I could still do better than that.

No, *YOU* are the fucking retard here. I hope you die of cancer. I can't tell how many projects I tried to open in my editor to hack on, only for the code to look like an absolute mess because the original programmer used a different tabwidth than I did. Use fucking spaces, you mongoloid.

You are still the retard using two or four times as many key presses as necessary and just throwing automatic alignment out of the window just so you can use your shitty rice easier.

Stop acting retarded on purpose. You know that tab expanding exists.

Doesn't work when working with other people's code. Can't even automatically change the display to suit your preferences without affecting the source, meaning you have to manually reconvert before committing or create ad-hoc hooks to do it for you. But you don't care about these since you're a professional solo fizzbuzz programmer, and will never work with anyone else in your life.

solo neet devs = tabs
professional team devs = spaces

...

Chosen Language. Why so anti-american?!

It's more like:
>2000 people contributed logo changes by making comments gender neutral

neutral? I thought we always should refer to users as "she" or "her"? It seems to be the fad.

here's a suggestion
why don't you write your own program that reads source you want to hack, if it finds a tab, replace them with the amount of spaces that you demand everyone else use.

Don't be silly, all spacefags know how to do is add comments.

It's an allegory for post-scarcity society.

...

...

...

singletons piss me off soooo much. You have some stupid language with global variables, then some stupid newgrads follow a bunch of official design patterns to copy/paste a bunch of bullshit into every single class they make (which are really just namespaces for a bunch of functions that manipulate global state), so they can pretend their classes which only have a single instance (which are instantiated god knows when) are some kind of modular concept.

I'm not a CS fag so I don't get it, what's the point of singletons? If you have a class and you want to instantiate it only once, just don't instantiate it more than once.

they are a meme, forget about them

The point is that there is a maximum of one instantiation of a class without the need to explicitly pass the object through the code.

The "m" or "m_" prefixes should only be for private or protected member variables.

One usecase I remember from back when I learned C++ game programming is to have a Singleton to hold the pointer of the current/active game state (level/scene) or whatever. The idea is to just have one instance per process and enforce that too (although I forgot the syntax to do that in C++). It's probably wrong and retarded and also irrelevant now since I'm a webcuck.

Making a utility class which isn't a singleton is just retarded. It's pointless to have to initialize an object just so you can use Util.manhattanDistance(loc1, loc2)

But that shit is getting instantiated anyways? It's no different.

durr

a better way to differentiate member variables is to append "_" to them.
e.g. foo_

Yes, but the language handles creating nad passing it around implicitly.

Yes, but the language handles creating and passing it around implicitly.

Too much implicit behavior leads to confusion and a lack of understanding when something needs to be debugged.
The "language" does no such thing. Singletons are a pattern of code, not a feature of the language.

I was talking about a specific use case for a class that includes only static methods with no members.
It is obvious when a static method is being used, because it is using a function that belongs to a class instead of a function that belongs to a variable.
Singletons themselves are a pattern of code, but I was talking about how most languages handle a class with static methods.

My biggest pet peeve is when I'm working with someone else's shit and it's obvious they never read the book Clean Code: A Handbook of Agile Software Craftsmanship.

Fucking this.

The whole point of mixing tabs and spaces like said is so that the code looks right regardless of your chosen tab width.

that's enough for me

...

what's that like?
explain in detail

Systems Hungarian is fucking cancer and anyone using it unironically should be drowned in napalm

Container-managed singletons are just fine.

Wait you use spaces for indenting? The fuck? I thought you just meant tabs instead of spaces as in when someone writes "int x" they use a tab between int and x.

is fortran for women and poc? for some reason i notice a lot of the diversity hires are using fortran on lots of projects.

yes, you small-brained unwashed barbarian cave-man reject who sacrifices human babies to copper statues of bulls when you aren't ass-fucking real bulls, spaces are used for indentation. tabs do not belong in source code.

Isn't napalm ediple if hes not on fire? i ate napalm and its basically inflammable orange juice.

...

Anything involving OOP in the loo crap. Anything involving "patterns" or some dumb fucks idea about engineering lmao code.

oop is a shitty overused meme but if you're stuck doing oop, being able to recognize, write, copy/paste, and adapt patterns to fit the problem is essential tbh

Couldn't you just have a global variable? I know global state is evil, but it's not as evil as a singleton.

A global variable is a singleton though

nah the languages are going to be dead in 10 years and it's a total loss of effort. Like someone in 2008 deciding to learn Perl. Waste of time.

What's the language of the future?

erlang

...

Some version of javascript.

Either use spaces or tabs exclusively, or hang yourself.

i didnt know turkesy has teeths

Jesus christ, if you can't wrap your head around something as simple as a singleton you shouldn't even be working with code.

Please let it not be so.

Not even trips will protect you from a future of shitscript

Maintainers that don't fix fucking problems in their projects.


I'm supposed to spend days figuring out how your project works just to do something you can do in 15 minutes? Fuck you. Your little project can die in a fire for all I care. I'd rather write my own tools than contribute to your shitty project.


My sides. That's why Ruby is dead.

The point of singletons is implementing interfaces. Class methods can't serve as interface implementations, nor can you pass a class as parameters where interfaces are expected. That's why people make a "singleton" object and go to autistic lengths to ensure there is only one copy.

Factories are similar. They exist to hide the new keyword. New introduces hard coupling at the ABI level. Factories hide new behind methods that return interfaces, allowing you to swap out the actual concrete classes at will.

Design patters exist because Java is complete and utter crap and they are needed to get around the limitations of the language. Of course, copy-pasting code monkeys simply don't understand what they are doing and why they're doing it. Eventually, everybody started using design patterns by default and it became a meme.

Hash tables. Anything that can be done with one can be done more effectively with a DAG

What kind of absolute moron presses space some arbitrary number of times to indent?

inb4 space AND tabs

...

...

this is bait

Watching them program reminds me of rats pressing the button to stimulate their pleasure center.

not even once

feels sad man

Yeah I know that feel. Many of my projects weren't popular but I had a few libraries that got 500k+ downloads. They saw some use, if the rubygems site is any measure of popularity. I got many issues on github. I was always happy as fuck when people came to me to talk about my project and how to improve it. It was a gift. I tried to be as accomodating as possible. It pisses me off when other developers don't even try to do the same. They don't even have a HACKING file that explains how the project works, how it's organized, how subsystems are related and interconnected. People end up having to breadth-first search the code base starting from the main function in order to figure out the repository and contribute to it. It's a massive disrespect for the contributor's time.

If people don't want to maintain things anymore they can just say so. It's fine. Just don't make me come into the bug tracker full of expecations and leave empty handed after researching the issues and presenting them to the developer. At some point I went to college and had to dedicate more time for study. I couldn't maintain my software anymore. Someone forked it and took over. I talked to the guy and he agreed to maintain it as the main branch. I started directing people towards the maintained fork. I even transferred the package manager credentials to him. Even now, despite all this, I still get email about it and still respond to those people. Software is like a child, honestly. Our creations never really leave us.

Anyway...

Contributing to Node.js is another example of a fucked up process where you get ignored if you're not working on the things the company financing the development care about. I saw some great features get suggested, worked on and sent in for merging while some faggot directors sat around and didn't make any decisions. I got excited for nothing. Eventually, the branch drifted so far away from master it was easier to start over. I asked about the status of the feature and they gave me non-answer after non-answer until eventually owning up and saying it wasn't happening...When suddenly the web standards changed in order to include my feature and the V8 team did their hard work for them. Even then it still hasn't landed; the V8 improvements only served to optimize other areas of Node. The JS environment Chrome provides is superior to Node in every way, the only drawback is there's a browser attached to it.

Open source is fucked up. Contributing to many of these projects is a complete waste of your time and hard work. People are better off reinventing the wheel, honestly. It's actually easier to roll your own tools than deal with the fucking people in charge of the other tools that already exist. Also, you never know -- your wheel might turn out to be better than the rest. Another pet peeve of mine is exactly this: retards who parrot the "don't reinvent the wheel" saying. Current wheels suck, we don't control their development and have to beg on issue trackers for the wheel gods to please please fix the bug or add the desired feature, and then watch their uncaring shrug for 5 years, even when faced with literal patches that they can simply merge in. People who invented the wheels are mortals just like us; we can do it ourselves just as well. Fuck those people.

...

camelCase

This. snake_case_superior.

whatsss going on in thissss thread?

happening(what='snek')maximum_overload(Snek())

Best possible future would be Erlang (~97% of code) + C (~3% of code, optimized for speed of execution).

If your meme language got that popular you'd hate it with a passion, because you can't stand popular things.

Your reasoning is wrong. C is one of most used languages ever and I still like it.

pathetic

no

How the fuck do you know that if you haven't spent days figuring out how his project works?
NIH syndrome wins yet again.

yes, inb4 indeed

...

But that doesn't fucking work. I use a three space tabstop: there is no code that is formatted for eight space tabstops that looks right with such a small tabstop.

TABS FOR INDENTATION
SPACES FOR ALIGNMENT

This is what invariably happens: (let's see if this shit works, I don't think I can post tabs)
while (IAmNotACIANigger && (youAreAFaggot || youSuckCocks))
When tabs are used, they are invariably treated as the set tab width size number of spaces.
while (IAmNotACIANigger && (youAreAFaggot || youSuckCocks))

...

After reading your code I thought of how to improve it. I assumed code this shitty was Java, but here's what I got. There's a better way to do this, but it involves re-writing your mood system and I have no idea how your mood system works or much worse the rest of your code is. (Also, I didn't want to spend more than 5 minutes on this.)

After reading your code I thought of how to improve it. I assumed code this shitty was Java, but here's what I did in maybe 5 minutes. There's a better way to do this, but it involves re-writing your mood system and I have no idea how your mood system works or how much worse the rest of your code is.

Underscores are there to keep lazy niggers like you out of my codebases.

At least your code looks much cleaner. When did Holla Forums stop designing logos and start programming again?

Are you really saying the developer of a 200kLOC project doesn't know exactly how to implement a simple feature request? That he doesn't even know where to start?


As it should. It's a free software world. If you see a wheel with neat features you like, go read its code, understand it and add it to your own wheel.


At least with methods you have the freedom to add logic later in the nebulous future without modifying the API, right?

...

Like you said, it depends on how the rest of the program works, but this is likely the proper, Don't Repeat Yourself way to do it (in Python):
moods = { 'happy': 3.2, 'glitchy': 1.2, 'angry': 3.4, 'lovey': 2.2, 'depressed': 0.4, 'scared': 0.9, 'zealous': 2.9}mood, value = max(moods.items(), key=lambda item: item[1])print("Mood: {} ({})".format(mood.capitalize(), value))
A rule of thumb here is that if adding a mood requires changing code in multiple places you're doing something wrong.

there's your problem

It's not supposed to be "formatted for x-space tabs". Tabs are supposed to be a logical indentation level, nothing more. Vertical alignment is supposed to be done with spaces

I use three-space tabs too, muh nigga

Maybe he knows and it isn't exactly as simple to do as it looks with the architecture in place. Maybe it would require significant refactoring to do right, and the author isn't fond of brittle kludges.

Maybe the author should say so if that's the case?

Agreed. He just told me it was a low priority fix, and even that was a lie since it implied it was gonna get fixed someday.


I'd understand if that was the case. However, the general infrastructure was already in place. I actually tried to make a patch and in the process I discovered he had created metaprogramming systems to generate everything. He had already written lots of code using it to handle two other specific cases that apparently were useful to him. My issue essentially involved handling a third and fourth cases.

I tried making it work myself but there was just too much stuff I didn't know about the project and there was no documentation. I even joined the fucking project's IRC and the motherfucker doesn't even respond to messages there.

Eventually I just gave up because I had better things to do.

I have similiar cases. I just ended up forking it and making the changes myself because i dont think the original is maintained anymore.