Worst Programming/Technical Advice And Fads - Trends that do more harm than good.

  • 🇵🇦 Nuestro primer dominio localizado está en español en kiwifarms.pa. Our first localized domain is on Spanish on kiwifarms.pa.
  • Want to keep track of this thread?
    Accounts can bookmark posts, watch threads for updates, and jump back to where you stopped reading.
    Create account
Do not forget about the ALWAYS mantras either.
> always write tests before writing any code (TDD)
> always comment your code
> always mark member variables as private
> always commit after an edit

Etc.
Compsci is no place for dogma.
I had to read some book on code architecture for a CS class a few years back and it was just 200-300 pages of this shit. Academics push dogma because they have never shipped successful software or been exposed to the real world so it's all they know. I specifically remember one chapter where the author discussed how, under tight deadlines, software developers are more likely to write hacky code. His solution? Don't write bad code and always take the time to write good code even if you're on a deadline.

My eyes rolled into the back of my fucking skull. Wow! Just write clean code all the time! Why had nobody ever thought of that before!? I hate academics.
 
My eyes rolled into the back of my fucking skull. Wow! Just write clean code all the time! Why had nobody ever thought of that before!? I hate academics.
Right, another very similar example would be regarding Extreme Program (something which btw is an amalgamation of other loose practice sets with bow over so it sells, but no one involved will ever define it to you).
XP was designed to shit out software as fast as possible. (Well no, it was designed to rip off tech companies and sell more SCRUM master certificates, but I digress.)
So how do you do that without horrific quality problems?
Just consult the 4 pillars!:
>planning
>coding
>testing
>attention

Attention.
Attention.
Never mind how dumb it is to call the rest pillars, but bloody "attention"???
< Bro, like, stop being bad bro. Have you considered like, not typing bugs?
 
Don't write bad code and always take the time to write good code even if you're on a deadline. [...] I hate academics.
2 things:
1) academics write the worst dogshit code I've seen. period. They get something that works, and call it a day. Maybe that's all they want. More power to them i guess. Don't expect anyone to help maintain it.
2) AGILE is the exact opposite of this and it tickles me. Make it work, then make it good. That's an actually decent professional standard in nearly every case. Sadly many people of the H1B persuasion often disregard the second half of that.
 
I'm going to put my foot in shit and say that comments are generally bad and should not be used at all. Comments are from the ancient age of computers when programs were done with punch cards and code didn't express at all what the fuck it did beyond math and load and store. Comments made sense in the age of BASIC and pre-ANSI C where you actually had a limit on how long your names could be, or for assembly code, or just to deal with working on a tiny monitor with blurry text, no tabs or internet to look at documentation on another page. We live in a much more readable era where a line of C# code practically reads like English, we can reference other documents very quickly on the same screen (that is more easily updated and can be done by people who are not at all involved in the code if necessary), and we can even put code into an AI and ask it to tell us what it does if we really need that help (never tried that, but I'm sure there are plenty of retards out there doing it).

The one thing I think comments should be used for are for purely selfish reasons, i.e. you know what you're doing is weird/fucked up and you know the future self is going to have no idea wtf you were doing. That's really the only time I would use a comment these days.

EDIT: I think I should emphasize that back in the 80s and earlier people were printing out pages of code and writing code by hand as a way of saving it, troubleshooting, working out ideas, etc. The tools used now are so vastly different from what people even had access to when the basic concept of a 'code comment' was invented. A code comment is like a cave painting: no place for it in the modern world.
 
Última edición:
2 things:
1) academics write the worst dogshit code I've seen. period. They get something that works, and call it a day. Maybe that's all they want. More power to them i guess. Don't expect anyone to help maintain it.
2) AGILE is the exact opposite of this and it tickles me. Make it work, then make it good. That's an actually decent professional standard in nearly every case. Sadly many people of the H1B persuasion often disregard the second half of that.

Problem is this is all personal interpretation and experience. Technically what you're calling agile is wrong. It's the bastardized version everyone hates. Especially people who cleanup agile teams bullshit for a living. And believe me, it's perfectly possible to go an entire career without knowing people are cleaning up behind you. So take that into consideration.

My only point though is everyone uses these words differently. Even "academic". No one reads the manifesto or understands what the fuck the point of a scrum master and sprints are. And they'll hate on that too.

Software culture reminds me of extremist politics. Like "anarcho-X" stuff. People arguing over definitions for days, never taking the time to actually explain what they mean, or likely don't actually know the discipline to begin with. Google level arguing basically.
 
Problem is this is all personal interpretation and experience. Technically what you're calling agile is wrong. It's the bastardized version everyone hates. Especially people who cleanup agile teams bullshit for a living. And believe me, it's perfectly possible to go an entire career without knowing people are cleaning up behind you. So take that into consideration.

My only point though is everyone uses these words differently. Even "academic". No one reads the manifesto or understands what the fuck the point of a scrum master and sprints are. And they'll hate on that too.

Software culture reminds me of extremist politics. Like "anarcho-X" stuff. People arguing over definitions for days, never taking the time to actually explain what they mean, or likely don't actually know the discipline to begin with. Google level arguing basically.
True Agile programming has never been tried!
 
I think a lot of classes cause aversion to c functionality that is preferable to streamlining in c++. Also I dislike "using namespace std" because I'd rather write std:: than get fucked by accidentally calling the wrong function.
I'm going to put my foot in shit and say that comments are generally bad and should not be used at all. Comments are from the ancient age of computers when programs were done with punch cards and code didn't express at all what the fuck it did beyond math and load and store. Comments made sense in the age of BASIC and pre-ANSI C where you actually had a limit on how long your names could be, or for assembly code, or just to deal with working on a tiny monitor with blurry text, no tabs or internet to look at documentation on another page. We live in a much more readable era where a line of C# code practically reads like English, we can reference other documents very quickly on the same screen (that is more easily updated and can be done by people who are not at all involved in the code if necessary), and we can even put code into an AI and ask it to tell us what it does if we really need that help (never tried that, but I'm sure there are plenty of retards out there doing it).

The one thing I think comments should be used for are for purely selfish reasons, i.e. you know what you're doing is weird/fucked up and you know the future self is going to have no idea wtf you were doing. That's really the only time I would use a comment these days.

EDIT: I think I should emphasize that back in the 80s and earlier people were printing out pages of code and writing code by hand as a way of saving it, troubleshooting, working out ideas, etc. The tools used now are so vastly different from what people even had access to when the basic concept of a 'code comment' was invented. A code comment is like a cave painting: no place for it in the modern world.
If you can't read what the code does from function and variable names then comments is just a bandaid. It should mainly be for arbitrary looking code order that switching would fuck things up, and algorithms/important optimizations where trying to pretty it up would fuck performance but you'd really want to know why you did something in a few months.
 
I think a lot of classes cause aversion to c functionality that is preferable to streamlining in c++. Also I dislike "using namespace std" because I'd rather write std:: than get fucked by accidentally calling the wrong function.
That evokes 1998 energy to me. The C++ STL was largely irrelevant for a long time and the C standard library is small and the names are weird and unlikely to result in a conflict. By the time of C++11, the STL was massive and it became very useful to know where exactly these functions were coming from (in addition to avoiding conflicts).

Anyone 'using namespace std' nowadays is either some boomer professor or an Indian copy/pasting shitty/ancient code.
 
Anyone 'using namespace std' nowadays is either some boomer professor or an Indian copy/pasting shitty/ancient code.
or a newbie who doesnt know any better

for example if you use codeblocks as your IDE it will put using namespace std into every new projects Main.cpp file by default
and if you're a beginner you dont know what it means other than "wow it lets me just write cout instead of std::cout! how nice!"
 
True Agile programming has never been tried!
This might seem off topic, but I'm reminded of Ayn Rand.

I don't have the exact quote to hand, but the gist is that their moral code keeps failing, but instead of criticizing the moral code, they condemn people and human nature for not being good enough to practice it.

I usually see this with true OOP. Everybody fails to do OOP correctly, including it's proponents. What good is it if it never works outside of a theoretical setting?
 
I'm going to put my foot in shit and say that comments are generally bad and should not be used at all. Comments are from the ancient age of computers when programs were done with punch cards and code didn't express at all what the fuck it did beyond math and load and store. Comments made sense in the age of BASIC and pre-ANSI C where you actually had a limit on how long your names could be, or for assembly code, or just to deal with working on a tiny monitor with blurry text, no tabs or internet to look at documentation on another page. We live in a much more readable era where a line of C# code practically reads like English, we can reference other documents very quickly on the same screen (that is more easily updated and can be done by people who are not at all involved in the code if necessary), and we can even put code into an AI and ask it to tell us what it does if we really need that help (never tried that, but I'm sure there are plenty of retards out there doing it).
Comments are good for other people who have to maintain your code but I agree that overcommenting is a nuisance. My personal rules are:

1. No inline comments unless I'm doing something particularly clever/stupid. Or if it's amusing to me.
2. Descriptive variable names and obvious control flow is always better than inline comments (I use #defines out the ass)
3. Functions should always get descriptive header comments, like javadocs or whatever.

If you can't read what the code does from function and variable names then comments is just a bandaid.
I can't find it now but I once stumbled across a Java codebase for an open source game that was heavily commented to "help newbies get into modding the game!" Every single line was commented. I saw unironic "adds 1 to i" comments in there. It was terrifying.
 
I once stumbled across a Java codebase for an open source game that was heavily commented to "help newbies get into modding the game!" Every single line was commented. I saw unironic "adds 1 to i" comments in there. It was terrifying.
I remember one game that had a link to the source code. But the code linked was nothing like the tutorial. What I assume happened is it was made open source, and people added a bunch of shit to it over time, so instead of being a simple game you could browse to see how it worked, it was a tangled mess of bullshit.

I can't remember any specific examples or even what the game was, but it was something simple like space invaders that had been bloated to page after page after page of code in the name of increasing performance or fixing a theoretical bugs. Like having the high score table in assembly and adding some kind of code in case somehow a long wasn't enough to hold the score.
 
This might seem off topic, but I'm reminded of Ayn Rand.

I don't have the exact quote to hand, but the gist is that their moral code keeps failing, but instead of criticizing the moral code, they condemn people and human nature for not being good enough to practice it.

I usually see this with true OOP. Everybody fails to do OOP correctly, including it's proponents. What good is it if it never works outside of a theoretical setting?
Or "praxeology" which anarcho-capitalism depends on.

In terms of languages, everything modern is hybrid. Go, Rust, Typescript, all hybrid functional OOP. Far less dogma than the Java days. Very easy to do just what's needed.

But organizations really need some sort of structure. You can't survive on being "scrappy" and "fast paced" forever. That shit is just as much a dogma as agile.

Google has great things to learn from. I forget what their metrics are. Lead time, time to recovery, and two others. PM's, QA, and developers are expected to work on the same team, not separate teams herded like cats by Jira shit.

Dave Farley writes about a lot of this under Continuous Delivery.

Read enough and you see extremely clear standards that are empirically proven to work.

The problem is most of what we hear is Internet bitching and children arguing over their favorite programming language. They confuse this with "standards."

These people can shut the fuck up, do their little agile tickets and complain all day I guess. Like a janitor ranting to his mop. But they're missing a bigger picture and a bigger, more interesting world.
 
Última edición:
3. Functions should always get descriptive header comments, like javadocs or whatever.
Absolutely not. Fuck off asshole. We have Intellisense. We don’t need this bullshit anymore. Either it’s going to be so short that it isn’t useful, or it’s so long that it bulks up the code and makes scrolling hell. It has to be kept up-to-date, and you need access to the code (or at least the header) to update it.

Putting your documentation in code is like putting style in HTML tags. You’re mixing domains that shouldn’t be mixed. Code should be code and documentation should be documentation. They should not be put together. We look down on hardcoded numbers, why the hell do we not look down on hardcoded descriptions of what we think the code is doing?
 
I had to read some book on code architecture for a CS class a few years back and it was just 200-300 pages of this shit. Academics push dogma because they have never shipped successful software or been exposed to the real world so it's all they know. I specifically remember one chapter where the author discussed how, under tight deadlines, software developers are more likely to write hacky code. His solution? Don't write bad code and always take the time to write good code even if you're on a deadline.
sicp is a better code architecture book than this kind of "ALWAYS DO THIS THING NEVER DO THAT THING JUST WRITE GOOD CODE TO GOOD CODE WRITE" shit
it's called structure and interpretation of computer programs for a reason
generally bad and should not be used at all.
this statement can be found on the "top 10 most dangerous things to say" list on watchkiwi.farms
If you can't read what the code does from function and variable names then comments is just a bandaid. It should mainly be for arbitrary looking code order that switching would fuck things up, and algorithms/important optimizations where trying to pretty it up would fuck performance but you'd really want to know why you did something in a few months.
correct. i don't think they're as bad as this thread seems to be making them out to be, however. "a++; // adds 1 to a" is retarded but most comments are far less superfluous. while the ideal piece of code is perfectly readable with 0 comments, note how rare ideal pieces of code happen to be in the real world. banning them would be the most retarded "style rule" since the nigger who invented the "multiple returns BAD" rule

they are nice at the top of function declarations, so that text editors can display a short snippet of online help to jog people's memory and maybe clarify a few things. sometimes, even the best naming can still not provide certain information:
Similar a C:
/* Create a squad. The value of maxUnits should be 6 or less,
since the enemy soldier AI is awfully quadratic and ends up far more
expensive than we want for big squads. */
Squad createSquad(TeamFlags team, int maxUnits);
// ... (doesn't need a comment (or can have something trivial))
void addUnitToSquad(Squad squad, Entity unit) throws SquadFull or whatever;
these are a couple functions for a hypothetical video game that lets the player have up to 3 allies and spawns enemies in squads of up to 6 members, but it could spawn bigger ones for certain set pieces or something like that. i personally believe comments like these are quite acceptable

they are also pretty good in situations where you're doing complicated setup or something, and there are multiple distinct "phases" in the code; while you could make a new function, it's usually a functionality only used in 1 place and so you can instead just make a comment with what the function's name would be if it was a function
of course the above remark is tailored for c-like languages: if you're using a language with first-class lexical closure, you could just declare a few well-named functions inside the big function and then call them in sequence, accessing the various variables directly, which would be about as easy as just using comments and then it becomes a matter of your personal taste in aesthetics really

tl;dr: i think comments are quite nice in certain situations
relatedly, i think the "ideal style" actually can vary a lot depending on the language you're using and even with the specific problem you're solving. strictly following some rules dictated by some nigger who isn't currently solving your specific problem is only smart when the rules are always right at all times (rules about style and how a program is laid out for ease of understanding? probably not!)
some of the rules are always right though (such as "yes, you have you indent your code, at the very least consistently throughout single functions")
Absolutely not. Fuck off asshole. We have Intellisense. We don’t need this bullshit anymore. Either it’s going to be so short that it isn’t useful, or it’s so long that it bulks up the code and makes scrolling hell. It has to be kept up-to-date, and you need access to the code (or at least the header) to update it.

Putting your documentation in code is like putting style in HTML tags. You’re mixing domains that shouldn’t be mixed. Code should be code and documentation should be documentation. They should not be put together. We look down on hardcoded numbers, why the hell do we not look down on hardcoded descriptions of what we think the code is doing?
some people like the inline documentation popups
cease this nonsense it is like a spaces vs tabs flamewar
 
these are a couple functions for a hypothetical video game that lets the player have up to 3 allies and spawns enemies in squads of up to 6 members, but it could spawn bigger ones for certain set pieces or something like that. i personally believe comments like these are quite acceptable
In a language like C where you have very little expression for defining your parameters, I can tolerate the declaration comments because there’s not much else you can do and everyone who uses C is used to doing that as opposed to some novel idea like having documentation on one half of your screen and coding on the other. However, in your example you limit the units to 6, and any invariants in a language like C should be handled immediately. Either this is a public API or it’s an internal function understood by a maintainer. If it’s a public API, there should be proper documentation. If it’s not, we can look at the code and immediately see the invariant handling because we’re the ones maintaining it anyway. IDEs now make this very easy to handle.

The reasoning behind encapsulation is now largely flawed and unnecessary. We don’t need to hide implementation details from programmers. We now have good source control and pull request practices that should ensure code is not turning into spaghetti without needing hyper enforced encapsulation. Some encapsulation is good, on the level of C, Python, C#. The level of encapsulation enforced by certain languages like Java is overbearing in my opinion.

That tangent aside, more recent languages like Python and C# have tools to express the function definitions more elegantly. Annotations are a great use for this. I personally would like to see things like DocStrings discouraged and descriptive function annotations encouraged.

The header comments would also be okay for a small program that has no other documentation. If it’s literally just a single file, it’s better to keep everything in that one file (including the README and license).
 
However, in your example you limit the units to 6
oh but it's not exactly limited to 6
it's usually less than 6 but there's a part in the game where somebody used 12 because the scene complexity was specifically known to be quite low and they
obviously if the hard limit was 6 it would return an error or throw an exception or something like that
If it’s not, we can look at the code and immediately see the invariant handling because we’re the ones maintaining it anyway. IDEs now make this very easy to handle.
there's no such thing as a "fully private api"
also some people don't like jumping around to every function they ever use and might miss this one since people don't schizophrenically jump to every file in the project while writing an ambush attack or something and accidentally causing lag on potato systems because they carelessly spawned a squad of 8 expensive soldier enemies
The reasoning behind encapsulation is now largely flawed and unnecessary. We don’t need to hide implementation details from programmers. We now have good source control and pull request practices that should ensure code is not turning into spaghetti without needing hyper enforced encapsulation. Some encapsulation is good, on the level of C, Python, C#. The level of encapsulation enforced by certain languages like Java is overbearing in my opinion.
i think it can be nice sometimes, like strong static typing. you can't fuck up and rape an unstable internal structure if you aren't even allowed to. there should still be some easy escape hatches though
I personally would like to see things like DocStrings discouraged and descriptive function annotations encouraged.
yes expressive type systems and function precondition specification tools are great

personally i really like to have short helpstrings for things with the most important notes so that i don't even have to glance over at documentation
and god forbid looking over at other sources to read precondition checks, no matter how fast the "jump to definition" key is
so i just disagree: docstrings are based
of course maybe your favorite language has a type system that is so op it can say "1..16, soft limit at 6..16"
but most languages are far from that powerful, especially for the soft limit thing
 
Atrás
Top Abajo