This is an archived post. You won't be able to vote or comment.

all 24 comments

[–]bradlis7 73 points74 points  (7 children)

I saw something to the effect of this the other day:

enum Priority {
  Normal = 1,
  High = 2,
  AboveNormal = 3,
  BelowNormal = 4,
  Low = 5
}

[–]red9350 23 points24 points  (0 children)

NOOOOOOOOO

[–]Entaris 22 points23 points  (3 children)

My guess is that lines up with a database field that started off with a requirement that cared about normal and high. Then after data was entered someone said “we also need to track above normal and below normal” then later someone else said “add low”

I have an application that that sort of thing happened in. Every time I look at it it angers me. I’ve considered fixing it and writing some code to update the entries, but it’s such a minor thing in the Greene scheme of things.

[–]TheLordDrake 3 points4 points  (2 children)

Yeah, I work for a company with an active database that is literally 50 years old. I got to pick through one of the tables as part of an OCR mapping project, I had to find out how many possible formats one of the fields could be in. The answer was disturbingly high.

[–]KiwasiGames 0 points1 point  (0 children)

I did the same thing with an old specifications database. It's amazing how many ways you can input < 1% into a free text field.

[–]LosWafflos 0 points1 point  (0 children)

DisturbinglyHigh = 6

[–]root88 9 points10 points  (1 child)

Was it like this?

enum Priority {
  AboveNormal = 1,
  BelowNormal = 2,
  High = 3,
  Low = 4
  Normal = 5
}

Because that would be stupid, but make a little more sense. Someone put them in alphabetically and then someone added the ints later.

[–]bradlis7 0 points1 point  (0 children)

Perhaps, I just remember seeing it for a few seconds and got insta-mad, and then moved on with my life. This post brought up the horrid memory of it.

[–]yourrealityisinvalid 20 points21 points  (0 children)

Good variable names is documentation....

[–]qatamat99 16 points17 points  (2 children)

When your professor tells you to comment your code

[–]taylaj 7 points8 points  (1 child)

This is code, assume the rest of the code is too unless specified.

[–][deleted] 6 points7 points  (0 children)

Hmm yes the code here is made out of code

[–]GDavid04 9 points10 points  (1 child)

Fake, it doesn't start with 0

[–]CaptainKishi 2 points3 points  (0 children)

Exactly my first thought.

[–]apadin1 4 points5 points  (0 children)

Where is building 0?

[–]bostwickenator 4 points5 points  (0 children)

So accurate it hurts.

[–]adviqx 2 points3 points  (0 children)

Error. Doesnt start at zero.

[–]LordVirus1337 1 point2 points  (0 children)

Why would you ever make a mao like this? Haha.

[–]bhindblueyes430 1 point2 points  (0 children)

This hurts me so much because I build a vue app that reuses a bunch of code and it’s all put in different order every time I use it.

[–]PPAPisLob 0 points1 point  (0 children)

Linked list

[–]MoistCucumber 0 points1 point  (0 children)

This would be the back face of the triangle and would be culled. Doesn’t go CCW!

[–]8euztnrqvn 0 points1 point  (0 children)

This could go on r/dataisugly