Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Jabor
Jul 16, 2010

#1 Loser at SpaceChem
Well for a start there's using a class as though it were a namespace.

Adbot
ADBOT LOVES YOU

QuarkJets
Sep 8, 2008

Ithaqua posted:

What are the horrors?

All of the compiler errors, to start

MrBadidea
Apr 1, 2009
code:
enum Rank { 1, ... A };
This, right here, is the part I keep looking at and cringing about. Has this person legitimately never handled a deck of cards? :stare:

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

MrBadidea posted:

code:
enum Rank { 1, ... A };
This, right here, is the part I keep looking at and cringing about. Has this person legitimately never handled a deck of cards? :stare:

"Ace can be one *and* 11? What kind of God would allow that!"

raminasi
Jan 25, 2005

a last drink with no ice
I'm also not quite understanding where the horrors are. "Bad" and "wrong," no question, but horrific?

O Tempora! O Mores!
Dec 24, 2008
At my work, one of the projects I'm on is a J2EE web application where a large portion of the dev team outsourced through an Indian consulting firm. Insofar as I can tell, the servlets they pump out work fine, but I keep running across weird code in the JSPs that makes me think they don't understand how Javascript works:
code:
<% boolean someBool = true; %>
<script type="text/javascript">
	// someVar is defined elsewhere in the document
	if (someVar) {
		<% someBool = true; %>
	} else {
		<% someBool = false; %> 
	}
</script>
:cripes:

O Tempora! O Mores! fucked around with this message at 22:34 on Mar 23, 2013

hobbesmaster
Jan 28, 2008

GrumpyDoctor posted:

I'm also not quite understanding where the horrors are. "Bad" and "wrong," no question, but horrific?

Writing C in C++ is a horror.

Rottbott
Jul 27, 2006
DMC
And bothering to make an enum and then having single letter names. Revolting.

However I will defend the 'using a class as a namespace'. I nest enums inside classes all the time and I'm not sorry.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Rottbott posted:

And bothering to make an enum and then having single letter names. Revolting.

However I will defend the 'using a class as a namespace'. I nest enums inside classes all the time and I'm not sorry.

In C++11, you can use enum class to force people to qualify your enumerators with the name of the enum. (It also removes the implicit conversion to the underlying integral type.)

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

O Tempora! O Mores! posted:

At my work, one of the projects I'm on is a J2EE web application where a large portion of the dev team outsourced through an Indian consulting firm. Insofar as I can tell, the servlets they pump out work fine, but I keep running across weird code in the JSPs that makes me think they don't understand how Javascript works:
code:
<% boolean someBool = true; %>
<script type="text/javascript">
	// someVar is defined elsewhere in the document
	if (someVar) {
		<% someBool = true; %>
	} else {
		<% someBool = false; %> 
	}
</script>
:cripes:

I'd be charitable and assume that they just made a mental error.

The first time. :catstare:

QuarkJets
Sep 8, 2008

Lumpy posted:

"Ace can be one *and* 11? What kind of God would allow that!"

But you'd have no way of knowing that given the way in which this was coded. Each suit in this class has 14 cards, including a 1 and an A. It really is as though the coder had never seen a deck of cards before

evensevenone
May 12, 2001
Glass is a solid.
Maybe they're just not into cards, or it's a cultural thing. Why is there no one card? It's just some weird tradition from 300 years ago. I mean you probably don't know offhand how many pits there on a mancala board either.

Arcteryx Anarchist
Sep 15, 2007

Fun Shoe

O Tempora! O Mores! posted:

At my work, one of the projects I'm on is a J2EE web application where a large portion of the dev team outsourced through an Indian consulting firm. Insofar as I can tell, the servlets they pump out work fine, but I keep running across weird code in the JSPs that makes me think they don't understand how Javascript works:
code:
<% boolean someBool = true; %>
<script type="text/javascript">
	// someVar is defined elsewhere in the document
	if (someVar) {
		<% someBool = true; %>
	} else {
		<% someBool = false; %> 
	}
</script>
:cripes:

Stuff like this and inescapable cargo cult programming/engineering is why I currently dread going to work every day :(

O Tempora! O Mores!
Dec 24, 2008

lancemantis posted:

Stuff like this and inescapable cargo cult programming/engineering is why I currently dread going to work every day :(

Cargo cult? I've never heard that term before.

Edit: I should drink less

O Tempora! O Mores! fucked around with this message at 14:01 on Mar 24, 2013

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

O Tempora! O Mores! posted:

Cargo cult? I've never heard that term before. It always seems that I'm the only one who understands what's going on. Is that how it always feels in software development, or should I be tearing my coworkers apart in code reviews?

"Cargo cult" is not a programming term.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Not originally, but it gets used a lot in programming discussions.

ChickenOfTomorrow
Nov 11, 2012

god damn it, you've got to be kind

Generally goes hand-in-hand with the Tim Buckley anti-pattern.

MrMoo
Sep 14, 2000

It amusing works misinterpreted as cargo-pant cult programming.

All the neo-hipsters want to wear cargo pants to be hip, and fail miserably.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Just a few hours ago I heard the weirdest use. I asked about some custom logging library and got "Oh yeah, Peter cargo culted that around to all his projects".

I didn't know it meant "copy/pasted".

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

Suspicious Dish posted:

Just a few hours ago I heard the weirdest use. I asked about some custom logging library and got "Oh yeah, Peter cargo culted that around to all his projects".

I didn't know it meant "copy/pasted".

It's more than just "copy/pasted". It's when you do something in order to fix things without actually knowing what it does. "This piece of code is a magic talisman that fixes problems and I don't know why."

Hughlander
May 11, 2005

prefect posted:

It's more than just "copy/pasted". It's when you do something in order to fix things without actually knowing what it does. "This piece of code is a magic talisman that fixes problems and I don't know why."

I always use the term 'Gully Dwarf' for that from the retarded inbred fantasy race in the Dragonlance Chronicles. When the brain drain of a long running project has been so bad that not only are there no more original implementers left on the team, but those that are left for maintenance have no idea why anything does what it does, they instead wave the dead rat at the wall and push the button that opens the secret door.

For me cargo cult programming is more of adapting the latest hot technology because twitter is a successful company and they use Rails, so rails makes them successful so we should use rails! (I believe this is how I wound up seeing a heterogeneous tech stack involving, netty, jetty, java, scala, nodejs, wicket, express, coffeescript, ruby, python, javascript, C, C++, Objective-C, apache, PHP, and I'm sure others that I'm just blocking now. And yes I realize I'm mixing languages, frameworks, and platforms but there's at least 2 if not 3 of each at different points in the chain.)

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

MrMoo posted:

It amusing works misinterpreted as cargo-pant cult programming.

All the neo-hipsters want to wear cargo pants to be hip, and fail miserably.

Cargo pants give you a place to put all of your things and there is nothing wrong with that :colbert:

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

prefect posted:

It's more than just "copy/pasted". It's when you do something in order to fix things without actually knowing what it does. "This piece of code is a magic talisman that fixes problems and I don't know why."

OK, then this guy was using it wrong, maybe? He just meant some standard logging code that Peter copy/pasted from project to project. Peter fully wrote it, so he fully understood how it works.

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?
"Cargo cult" means to confuse the outwards manifestations of something with its essence. The original cargo cults copied the outward manifestations of military supply networks (landing strips, aircraft, radios) not recognizing that those things don't work without an actual network to produce and deliver the cargo. Creationist science is cargo cult science because it copies the outward manifestations of scientific research (papers, journals, conferences, "universities") with the actual essence of what makes up science. In programming, cargo culting is using some technique, design pattern or style where it's inappropriate because one doesn't understand the motivation for its use in the first place. Like creating an unnecessary inheritance hierarchy because in school they told you that's how you do OOP. Or when I see a class where every private member has been exposed through getters and setters.

Arcteryx Anarchist
Sep 15, 2007

Fun Shoe
Or not taking the time to understand how a framework/library works and just copy/pasting something else that is using it as part of an implementation and tweaking stuff to try to make it 'work'. Then when it doesn't work asking questions that make the person on the receiving end of the questions feel like they're on a bad mailing list. It gets even worse when they copy some messy hack or some rushed, unclean section and when they're informed that they can implement their particular item in a much simpler way they continue with the hack to 'see if they can just get it working this way.'

I think 'J2EE' just aggravated this problem by sometimes requiring a good chunk of boilerplate so a bunch of guys now think this is what writing software is.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

HappyHippo posted:

Creationist science is cargo cult science because it copies the outward manifestations of scientific research (papers, journals, conferences, "universities") with the actual essence of what makes up science.

Creationist "science" isn't really cargo cult science, because the goal isn't to try to duplicate scientific study and discourse; the goal is to create a thin veneer of credibility which they can lay on top of the Bible to say "there is controversy about evolution and the origins of the universe, therefore we should not teach evolution in schools."

Cargo cults are fundamentally about not understanding how something works, and trying to reproduce behaviors by rote ritual. Creationist "science" is fundamentally about lying to people, a lot, for political gain.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Coding horrors: post the code that makes you laugh (or cry)

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

Volmarias posted:

Creationist "science" isn't really cargo cult science, because the goal isn't to try to duplicate scientific study and discourse; the goal is to create a thin veneer of credibility which they can lay on top of the Bible to say "there is controversy about evolution and the origins of the universe, therefore we should not teach evolution in schools."

Cargo cults are fundamentally about not understanding how something works, and trying to reproduce behaviors by rote ritual. Creationist "science" is fundamentally about lying to people, a lot, for political gain.

Yeah fair enough. I still think it's a cargo cult because what they seek is the credibility of science and if you read the wedge document you can tell they somehow feel it comes from the papers and conferences.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

HappyHippo posted:

Yeah fair enough. I still think it's a cargo cult because what they seek is the credibility of science and if you read the wedge document you can tell they somehow feel it comes from the papers and conferences.

But that's not what cargo cult is at all. Cargo cult is seeing X cause Y, and then trying to do X a lot hoping it will do Y, such as Pacific island tribes making dirt airfields because they think it will make aircraft come without understanding or knowing WHY aircraft come.

Creation science is trying to dress up the Bible in trappings of scientific rigor and calling it science. It's taking creationist texts and performing ctrl-H to replace "creator" with "intelligent designer."

At the levels of people who can critically think, no one is fooling anyone. This is being done because it's hoped that pseudo scientific things can be used to confuse enough naive, credulous people into saying "but isn't this science too?", not because creation scientists are actually looking for a credible reason to discount evolution.

It's people who don't understand cause and effect, vs literal scam artists who want to keep us at a middle ages level of science.

Volmarias fucked around with this message at 21:30 on Mar 24, 2013

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
And I'm proven once again wrong about whatever stupid argument we had last week being the dumbest one. I didn't think we'd reach D&D poo poo in here.

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?
I guess I should have stuck to programming examples

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Suspicious Dish posted:

And I'm proven once again wrong about whatever stupid argument we had last week being the dumbest one. I didn't think we'd reach D&D poo poo in here.

I thought the lesson of this thread is that we are the horrors.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

HappyHippo posted:

I guess I should have stuck to programming examples

People who try to make things objectively worse for everyone just for personal gain get me riled up like nothing else. Sorry for the awful digression, let's get back to talking about horrible beep boop button press things :(

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

pokeyman posted:

I thought the lesson of this thread is that we are the horrors.

But it was all right, everything was all right, the struggle was finished. He had won the victory over himself. He loved Big Brother.

QuarkJets
Sep 8, 2008

Suspicious Dish posted:

And I'm proven once again wrong about whatever stupid argument we had last week being the dumbest one. I didn't think we'd reach D&D poo poo in here.

We've at least not reached as low as GBS yet

O Tempora! O Mores!
Dec 24, 2008

lancemantis posted:

I think 'J2EE' just aggravated this problem by sometimes requiring a good chunk of boilerplate so a bunch of guys now think this is what writing software is.

Dear god, this. Maybe it's just the (godawful) framework we're using that's left a bad flavor in my mouth, but my God, every drat JSP is in excess of 1,000 lines long, even just the ones which spit out a handful of lines of HTML. Freakin' nightmare.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
I once patched an output encoding bug that I had no way to reproduce, by copying and pasting the offending library routines into the app, 3 calls deep, then modifying the innermost function to discard the problem characters.

And I'd do it again. That ticket was OLD.

Gazpacho fucked around with this message at 07:25 on Mar 25, 2013

Malloc Voidstar
May 7, 2007

Fuck the cowboys. Unf. Fuck em hard.
http://jefferai.org/2013/03/24/too-perfect-a-mirror/
The KDE project very nearly managed to lose all 1500 of their git repositories, if not for one of their servers getting lucky on timing so the sync timed out. The other four servers saw that the main server had been corrupted, so they faithfully deleted their copies. There were no backups.

Athas
Aug 6, 2007

fuck that joker

Aleksei Vasiliev posted:

http://jefferai.org/2013/03/24/too-perfect-a-mirror/
The KDE project very nearly managed to lose all 1500 of their git repositories, if not for one of their servers getting lucky on timing so the sync timed out. The other four servers saw that the main server had been corrupted, so they faithfully deleted their copies. There were no backups.

Well, doesn't every developer have a full copy of the repository they're working on?

Adbot
ADBOT LOVES YOU

The Gripper
Sep 14, 2004
i am winner

Athas posted:

Well, doesn't every developer have a full copy of the repository they're working on?
They do, but then you have to deal with there being no authoritative repository and all the bullshit that comes with that (mostly just verifying that the copy you choose to start from is pristine).

In KDE's case everything would be recoverable no matter how broken things were (as you said, each developer has a copy), the horror is mostly that a project that large considered Git a key part of their backup plan.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply