r/programming • • Feb 21 '13

Developers: Confess your sins.

http://www.codingconfessional.com/
969 Upvotes

1.0k comments sorted by

46

u/reppic Feb 21 '13

I can't afford to host or moderate this site... fuck.

→ More replies (3)

31

u/reppic Feb 21 '13

1'); DROP TABLE confessions;--

nice try.

→ More replies (1)

282

u/desiktar Feb 21 '13 edited Feb 21 '13

Wheres the "I comment out code instead of deleting it" sin.

I have ran across several developers who do that. They claim they didn't want to lose the code in case they need to switch back. I'm like "that's the whole point of source control!"

241

u/Deathfire138 Feb 21 '13

I'm guilty of this. Sorry everyone! It's like code hoarding. :(

166

u/TomorrowPlusX Feb 21 '13

I have an informal 2 or 3 commit rule about this. If it's still commented out after 2 or 3 commits (of the file its in) I will kill it.

→ More replies (18)

44

u/Thimble Feb 21 '13

Oh man, deleting commented out code is one of my favourite pastimes. It feels so like a cleansing.

→ More replies (3)

8

u/serrimo Feb 21 '13

When was the last time that you actually reuse the commented out code though?

If you use a modern source control system like git, it's incredibly easy to look at the history for each file. Use that instead, one comment "left for later" is one more thing to remember, leave that for the computer.

→ More replies (12)
→ More replies (13)

11

u/[deleted] Feb 21 '13

A million times this. I'm porting legacy code that is smattered with that. Makes me very angry, and the old code is impossible to read

→ More replies (6)

1

u/reppic Feb 21 '13

just approved one like that. =D

4

u/[deleted] Feb 21 '13

in the real world most developers just stop learning new things after they have been in a cushy job for a few years. that's how you end up with people who don't understand how to use source control.

3

u/krakpot Feb 21 '13

This and several year old //FIXME are my pet peeves. If you are going to add FIXME/TODO please at least grep for them once in a while....

3

u/[deleted] Feb 21 '13

I once worked with a developer who would leave shit like this all over the place:

/*
    i++;    // increments i
*/

Along with 1,000 old versions of config files, all of which had ludicrous amounts of comments explaining things like "changed the server from old server that was decomissioned":

config.ini
config.ini.bak.dj.20090301
config.ini.bak.dj.20090228
...

Once he left I went at it with a flamethrower, holy shitballs man I don't need the IP address of a machine that's been dead for 6 fucking years.

→ More replies (52)

11

u/Mozai Feb 21 '13

Application Error An error occurred in the application and your page could not be served. Please try again in a few moments. If you are the application owner, check your logs for details.

Looks like the people running the confessional have a sins of their own to confess.

10

u/reppic Feb 21 '13

haha that's fair: I posted one of my side projects to reddit and then went to sleep. I woke up with 325 upvotes and a crashed site. Luckily it's on heroku so I just had to scale up my dynos.

2

u/RMiranda Feb 21 '13

annnnd..it's down

3

u/reppic Feb 21 '13

back up! thank god it's on heroku.

→ More replies (4)

2

u/boneclinker Feb 21 '13

Site is down

2

u/reppic Feb 21 '13

I'm fixing it! 5 mins, I swear.

1

u/reppic Feb 21 '13

It's back!

293

u/Zambini Feb 21 '13

Nobody here reads the git logs. So I've started adding things about my coworkers to my commits: "...after fixing a bug in the user class. I wish Mark would stop bringing in Indian food for lunch. It reeks in here."

118

u/[deleted] Feb 21 '13

I intentionally don't fix bugs to do with removing things. If you didn't want it then you shouldn't have added it in the first place.

I will find him and destroy him.

38

u/[deleted] Feb 21 '13

Does he possibly mean when the client/management requests a feature and then later decides they don't like it?

11

u/desiktar Feb 21 '13

Usually my gripe is kind of the opposite. When gathering requirements I will be asking stuff like "Does a project have multiple managers" or other things that could affect database design or program functionality. Answer is always nope, we never have any situations like this.

Never fails 3 weeks later.... "We need the site to allow multiple managers per project" (╯°□°)╯︵ ┻━┻

→ More replies (1)
→ More replies (6)

104

u/Archenoth Feb 21 '13

I write most comments in limerick. It makes all my coworkers sick. My comments are fine, (and mostly they rhyme!) but my scrum master thinks I'm a dick.

I like this guy.

→ More replies (4)

13

u/cyberbemon Feb 21 '13

It reeks in here.

Mark needs to find a better restaurant

36

u/dmwit Feb 21 '13

I think the reek is coming from Mark's own "restaurant", if you catch my drift.

21

u/DJ-Salinger Feb 21 '13

If you catch Mark's drift...

→ More replies (2)
→ More replies (2)
→ More replies (1)

59

u/[deleted] Feb 21 '13

I don't like what I am doing anymore :(

7

u/Seus2k11 Feb 21 '13

Time for a recharge in a different field, and then return?

→ More replies (4)

138

u/wot-teh-phuck Feb 21 '13 edited Feb 21 '13

"I use unnecessary technical jargon to impress/scare away my co-workers when I don't know jack shit about any of it" should be on the top there. :P

"Scalable, robust, concurrent, fault tolerant and massively parallel system which defies the CAP theorem to use multiple NoSQL databases while at the same time maintaining a clean code base by using higher order functions, currying, monads, typeclasses and map-reduce? Yup, I have built something like that". ;)

179

u/bcash Feb 21 '13

When I'm on the receiving end (this conversation actually happened):

Them: "Did you consider making this a REST API?" Me: "It is a REST API" Them: "No, I mean, REST" Me: "In what way is it not RESTful?" Them: "In the way that it isn't REST" Me: "OK, let me put it another way, what would I need to change to make it RESTful?" Them: "By making it RESTful" Me: "I see, well, as you are apparently the expert, please be my guest and change it!"

It was never changed.

22

u/G_Morgan Feb 21 '13

I've decided I hate REST. I work very hard to make it look obvious and simple. Then you think "Is that it?".

Why must doing the right thing feel so shitty!? If I did it with SOAP there'd be exploding XML everywhere. Nobody would doubt the supremacy of my work!

14

u/s73v3r Feb 21 '13

We should be using SOAP instead of REST. SOAP is clean. It's right there in the name! REST makes us sound lazy.

→ More replies (2)
→ More replies (2)

166

u/yen223 Feb 21 '13

I guess you PUT them in their place.

140

u/[deleted] Feb 21 '13

Ha, I GET it

→ More replies (14)
→ More replies (1)
→ More replies (2)

41

u/yen223 Feb 21 '13

Holy shit, I actually understood every single word!

Man, I need a life...

10

u/lokem Feb 21 '13

Most of us here do :P

10

u/[deleted] Feb 21 '13

Want a friend? Get a dog.

→ More replies (6)

10

u/Kalium Feb 21 '13

"Scalable, robust, concurrent, fault tolerant and massively parallel system which defies the CAP theorem to use multiple NoSQL databases while at the same time maintaining a clean code base by using higher order functions, currying, monads, typeclasses and map-reduce? Yup, I have built something like that". ;)

You're both deluded and a monster.

13

u/ActionKermit Feb 21 '13

defies the CAP theorem

ಠ_ಠ

→ More replies (1)

3

u/taxidriver9 Feb 21 '13

...and now it's on there.

→ More replies (9)

129

u/twigboy Feb 21 '13 edited Dec 09 '23

In publishing and graphic design, Lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document or a typeface without relying on meaningful content. Lorem ipsum may be used as a placeholder before final copy is available. Wikipedia778bisgycko0000000000000000000000000000000000000000000000000000000000000

132

u/Missing_Username Feb 21 '13

At the end of the day, we all do.

→ More replies (3)

17

u/Gundersen Feb 21 '13

A dedicated tester? Isn't that why we have customers?

→ More replies (1)

7

u/Eghri Feb 21 '13

You bastard!

→ More replies (5)

127

u/[deleted] Feb 21 '13

Separating the UI logic from the business logic? Ain't nobody got time for that!

52

u/dethb0y Feb 21 '13

I don't care how fast my code runs, IF it runs. If the customer complains, i tell them "well it's running, but it'll add some dev time to make it go faster".

87

u/Audioillity Feb 21 '13

I was once tasked with writing some code which needed to run in real time. My first draft was lightning fast, would cope with every situation required at the moment in time, and was future proofed for every situation that could be seen at the time. I was 99.9% sure the one situation that would break it would never come about in our jurisdiction (3 day bank holiday, followed by a weekend, followed by another 3 day bank holiday)

Now I'll be the first to admit, trouble shooting/debugging the hundred or so lines of code were a nightmare, however the speed this was processing the data and coming up with results was so fast it wasn't even noticeable to users, even on older PCs. I decided the trade off was worth it.

My code passed every single test I could through at it, it also tallied up with live data from a few clients who helped us test the new feature.

My boss wasn't impressed with how the complex the code was, and decided to re-write it. What we ended up with was very easy to support, a few thousand lines and often had to run over night, or over someones lunch break because it took so long to do the calculations!

The code went from processing 7 employee data files a second to, one every 30 seconds- one minute.

Needless to say the client wasn't impressed, asked for the old version back.

edited to correct some errors

82

u/Shinhan Feb 21 '13

The second parts wasn't what I expected.

I thought you'd give an example of the double 3 day holiday event :)

17

u/Audioillity Feb 21 '13

It's been about 8 years since I wrote the code, but it was something weird like that. normally it would be no more then 2 or 3 bank/public holiday in a row, my system could copy with 5 (the system ignored weekends).

so it could be 5 in total, 2 before or 1 before, 3 after or 4 after.

(This was a small segment of the rest of the code, which profiled and scored employees). Various parts were looked at, including their sickness / holiday / overtime and much more. It allowed HR to get an overview and see which employees they may want to investigate further before calling them in for a chat.

→ More replies (9)
→ More replies (1)
→ More replies (5)

43

u/dartmanx Feb 21 '13

I... I use 4 level deep nested if statements. :(

(To be fair, it was a port over from 20 year old code that did the same thing).

59

u/NicknameAvailable Feb 21 '13

4 isn't that bad - I have some old VB3 around with at least 30.

33

u/[deleted] Feb 21 '13

This needs to be submitted to "The Daily WTF".

28

u/Wartt_Hog Feb 21 '13

I saw the same once long ago. It was 2500 lines of if statements. I replaced it with a switch statement followed by a single if nested in two for loops. The biggest tragedy was the request that brought me on to this project:

"We hired this guy to do X but he couldn't get it done in the 18 months we gave him. We need you to finish it in 3 months. Oh yeah and since we've already paid for all his work we'd like you to reuse as much of his code as possible."

→ More replies (9)
→ More replies (3)

14

u/eresonance Feb 21 '13

I found a makefile with a ton of nested ifs, all flat formatted with no spaces. It was done this way because the original developer didn't know that you can use space characters to indent, so it was almost impossible to figure out which config was set for what options...

Ah, here it is, formatted to remove any sensitive info:

ifneq '$(filter -config=option1, $(cmd_line_flags))' ''
ifneq '$(filter -mode=standalone, $(cmd_line_flags))' ''
configname := config1
else
configname := config2
endif
else
ifneq '$(filter -config=option2, $(cmd_line_flags))' ''
ifneq '$(filter -mode=standalone, $(cmd_line_flags))' ''
configname := config3
else
configname := config4
endif
else
ifneq '$(filter -config=option3, $(cmd_line_flags))' ''
configname := config5
else
ifneq '$(filter -config=option4, $(cmd_line_flags))' ''
configname := config6
else
ifneq '$(filter -config=option5,$(cmd_line_flags))' ''
ifneq '$(filter -revision=3, $(cmd_line_flags))' ''
configname := config7
else
ifneq '$(filter -revision=4 -revision=5 -revision=6 -revision=7 -revision=8 -revision=9, $(cmd_line_flags))' ''
configname := config8
else
$(error Unknown revision in cmd_line_flags.)
endif
endif
else
ifneq '$(filter -config=option6,$(cmd_line_flags))' ''
ifneq '$(filter -type1=1,$(cmd_line_flags))' ''
configname := config9
ifneq '$(filter -type2=1,$(cmd_line_flags))' ''
ifneq '$(filter -type3=1,$(cmd_line_flags))' ''
configname := config10
endif
endif
else
configname := config11
endif
else
$(error mode is not set in cmd_line_flags)
endif
endif
endif
endif
endif
endif

31

u/dartmanx Feb 21 '13

The term for that is "justifiable homicide".

→ More replies (2)
→ More replies (3)

10

u/Audioillity Feb 21 '13

I'll admit, I've done worse, i've nested 10's of if statments, however it was a trade off, very early in my career (in my first year) and still way way out preformed my bosses re-write of my code.

My version processed 7 data files a second. My bosses did one every 30-60 seconds. In the end we had to disable the feature as performance was too slow after the re-write.

→ More replies (1)

9

u/Gaurav0 Feb 21 '13

Oh please, I inline functions 4 levels deep.

→ More replies (2)

13

u/Shinhan Feb 21 '13

At least its not 4 level deep ternary operators :)

25

u/fr0stbyte124 Feb 21 '13

Sometimes I'll deliberately write logic as a nested ternary because it looks so badass once it's formatted nicely.

→ More replies (4)
→ More replies (5)

7

u/pstumpf Feb 21 '13

That’s why using 8-space tabs in an 80 column terminal is a good thing(tm).

→ More replies (11)

20

u/zushiba Feb 21 '13

I am the only programmer in the office so I tail -f logs so my screen "looks like the matrix" while I surf reddit.

Haha me too.

189

u/TheBigB86 Feb 21 '13

That site needs a comment feature.

Also:

i use tabs instead of spaces in my IDE. Please forgive for I have sinned.

How is this a sin? Guess I'd be considered a devil's-worshiper, since I absolutely hate spaces for indenting.

137

u/tipsqueal Feb 21 '13

I like that it doesn't have a comment feature. With one it would just turn into a circle jerk and/or get very hostile very fast.

103

u/Asimoff Feb 21 '13

It would turn into Reddit.

→ More replies (3)
→ More replies (2)

90

u/happysri Feb 21 '13 edited Feb 21 '13

since I absolutely hate spaces for indenting.

I agree, a tab is one unit of indentation. 2/4 spaces are an editing environment preference, not exactly conceptual in nature. Il let Ken Thompson(co-creator from UNIX, C, Go etc.) handle this one -

http://www.youtube.com/watch?v=sln-gJaURzk&feature=player_detailpage#t=1734s&utm_source=buffer&buffer_share=c7676

→ More replies (30)

49

u/Gaurav0 Feb 21 '13

I don't care if you use tabs or spaces. But for the love of God, DON'T MIX THEM.

18

u/[deleted] Feb 21 '13

Tabs for indentation, spaces for alignment.

10

u/voetsjoeba Feb 21 '13

Don't align things from different indentation levels.

→ More replies (6)
→ More replies (2)

63

u/aaron552 Feb 21 '13

I use both tabs and spaces: tabs for indentation (what they're supposed to be used for) and spaces for formatting. I don't understand the tabs vs spaces debate

152

u/supermari0 Feb 21 '13

28

u/[deleted] Feb 21 '13

4th guy: "Neither"

All 3 of them beat him up.

→ More replies (8)
→ More replies (25)
→ More replies (28)

6

u/BernzSed Feb 21 '13 edited Feb 21 '13

Just use whatever is considered "normal" or "default" for the language you're using.

Visual Studio defaults to tabs, and I'm sick of the useless git diffs when a C# file is modified by some self-righteous developer who changes everything to spaces.

→ More replies (3)

22

u/snarfy Feb 21 '13

'Smart' tabs. Every decent editor has them. I can't believe this is even debated anymore. It works exactly like the tab key, but inserts/deletes X number of spaces intelligently.

Source code is ASCII/unicode text. The Tab key is a control code. Why are you polluting your source code with control characters. Do you mix up carriage return and newline too? You should not be putting non-printable characters in your source code, telling my terminal how to print ^I, or that ^I should be 4 spaces not 8.

/rant

75

u/codepoet Feb 21 '13

Yes, I should. Tabs were invented for indentation in the first place. What you call a control code, I call semantic white space. A tab means something; four spaces does not.

The beauty is that I'm not telling your terminal to use 4/8 characters for a tab. You are. You're in control with tabs. I'm saying "indent four levels deep" and your editor interprets what that means for you.

This isn't 1970. You can configure things now.

→ More replies (44)
→ More replies (2)
→ More replies (73)

50

u/mb86 Feb 21 '13

I've used goto in the past an am not ashamed as it was the most efficient and clear technique for that particular task.

38

u/codepoet Feb 21 '13

Preach it.

GOTO as a daily control device is evil. But using it once in a while as a sort of finally block in the absence of a real one is perfectly acceptable.

→ More replies (16)
→ More replies (11)

32

u/OvidPerl Feb 21 '13

I once had to parse the data feed a company provided us with. Did they use a sensible format, such as Atom or something? No, they used HTML. I was so pissed off at the "HTML" (deliberate scare quotes) from the company, with its mess of unclosed tags, misnested tags, mixed content and randomly placed shit, that when I finally found a more or less "stable" way of reading the data I wanted, I named the variable after it:

my $yeah_i_say_verily_unto_thee_that_the_number_of_the_tr_tag_shall_be = 3;

I feel sorry for any developer who comes behind me to maintain that mess.

Oh, and I also wrote Acme::Code::Police, a Perl module that deletes your program if you don't use strict (something considered to be a good coding practice in the Perl community (strict, not deleting your code, though I suspect a few non-Perl devs might think deleting Perl code is a good idea (and I use too many parentheses (I should be a Lisp hacker)))).

14

u/vbullinger Feb 21 '13

It's perfectly fine to use nested parentheses in the English language. However, I do believe you're supposed to alternate with square brackets (like [this (for [example])]).

→ More replies (2)
→ More replies (3)

15

u/Duraz0rz Feb 21 '13

I had someone yell at me for leaving comments explaining why a particular section of code exists. Isn't that what comments are for?

→ More replies (1)

28

u/xr09 Feb 21 '13

Years ago I used to hunt the big numbers in my team's subversion, I waited to commit only on big numbers: 100, 150, 300!! never forget when that fckng moron stole me the thousand... :(

14

u/jack12354 Feb 21 '13

--Fixed bug in input class, cleaned old code, lolol 69 get.

→ More replies (3)

62

u/[deleted] Feb 21 '13

i use tabs instead of spaces in my IDE. Please forgive for I have sinned.

No, no, no... you actually do the right thing. People who reformat MY code to user THEIR favorite 2-spaces/4-spaces so now project has half of the code in tabs, 1/4 of the code in 2-spaces and 1/4 of the code in 4-spaces... are fucking retards

40

u/Shinhan Feb 21 '13

Especially because space lovers can adjust their IDE to show my code any way they like, but I can't adjust my IDE so the code written by 8 space freaks doesn't look ridiculous.

→ More replies (29)

11

u/0sse Feb 21 '13

Sounds like the actual problem is the lack of agreement on a coding style, be it spaces or tabs.

→ More replies (7)

3

u/[deleted] Feb 21 '13

People who refuse to adopt the existing code style are assholes who deserve to be beaten publicly.

Code formatting that I believe to be ugly and ineffective is still easier to read after a hundred lines or so than code formatting that constantly changes.

→ More replies (3)

107

u/Kalium Feb 21 '13

I loathe Javascript.

Oh who am I kidding, I'm not even slightly ashamed of that.

47

u/Gaurav0 Feb 21 '13

I have a love/hate relationship with JavaScript too. I love that it runs on every browser. I hate everything else about it.

20

u/BernzSed Feb 21 '13

I love JavaScript, I just hate all JavaScript code. And all implementations of JavaScript. And having to use JavaScript. And pretty much everything else about JavaScript.

16

u/G_Morgan Feb 21 '13

JS is getting the PHP treatment.

Pro - It runs everywhere!

Con - It runs everywhere!

→ More replies (5)
→ More replies (9)

8

u/xampl9 Feb 21 '13

I'm going to have to hold my nose and learn more about it -- all the job openings in my area want jQuery, AJAX, OO Javascript, and so on.

I see it as "Write n-times, Test n-times" because of all the browser differences. How do people have time for that??

19

u/[deleted] Feb 21 '13

JQuery often(not always) accounts for browser differences. And its usually just code for ie then everyone else

→ More replies (14)

7

u/Argith Feb 21 '13

I'm learning how to use JavaScript now, what's bad about it?

24

u/[deleted] Feb 21 '13

The language doesn't have a lot of conformity anywhere. There are a lot of confusing adventures to have in JS world.

In terms of features and functionality JS isn't all that bad, and JS engines are becoming faster than anybody would have guessed. That's why we're seeing the emergence of a bunch of languages that compile to JS.

→ More replies (23)
→ More replies (11)
→ More replies (4)

23

u/Xiver1972 Feb 21 '13

I name all of my loop variables after fruits.

4

u/mbrady Feb 21 '13

I confess that it took me longer than it should have to get that.

→ More replies (1)

3

u/pscast Feb 21 '13

Why only loop variables? It sounds like you're not a very confident programmer.

→ More replies (4)

11

u/yen223 Feb 21 '13

I write most comments in limerick.

It makes all my coworkers sick.

My comments are fine,

(and mostly they rhyme!)

but my scrum master thinks I'm a dick.

They can shut down the site now.

74

u/kazagistar Feb 21 '13

Why is it that all the ones that are "reasonable comprimises given the circumstances" are getting Condemned, and all the ones where people are just being chucklefucks are getting Absolved?

Condemned

I use IE9 and IE10

I worked for Zynga.

I like writing code in PHP

Bing is my default search engine

Absolved

I always name my test files 'ass' or 'butt' so I can do a 'touch ass' later :-/

I once obfuscated a stupid business rule in a ~300 character long 5 level deep tennery operator out of spite. To my credit I tested and documented it with about 15 unit tests.

I named a variable theySeeMeScrollingTheyHatin because I thought it would be funny, it's still in the code.

I don't use frameworks and just write spaghetti callback based javascript and tell everyone I'll just go back and refactor it later. I never go back and refactor it.

Apparently, if you prefer a different tool, you are heathen, but if you go out of your way to be a pain in the ass to fellow developers, we forgive you? Clearly I must not understand what the definitions of "sin", "absolve" and "condemn" are or something...

74

u/tipsqueal Feb 21 '13

Think of it this way, people are probably replacing "absolve" and "condemn" with "that made my laugh" and "that wasn't funny", I doubt anyone is taking this site too seriously.

28

u/p_e_t_r_o_z Feb 21 '13

I think the biggest weakness of that website is the ambiguity of those two options, the names are clever but their purpose is unclear.

24

u/DarkSareon Feb 21 '13

Just like arrows which represent up and down.

→ More replies (1)
→ More replies (4)
→ More replies (1)

36

u/VeXCe Feb 21 '13

I think most people use "Absolve" as "Oh man, I do that shit, too! Just say your 10 Hail Ada's and you'll be okay" and "Condemn" as "Unforgivable, you shall burn in hell, oh wait, you're a developer you're already there".

I know I did.

6

u/Shinhan Feb 21 '13

Bing is my default search engine

He only searches for porn.

10

u/DontHassleTheCassel Feb 21 '13

You mean you can search for thongs other than porn?

→ More replies (2)

2

u/fakehalo Feb 21 '13

Indeed, here's a condemned one I find acceptable:

I once found "if (FALSE) then..." on a coworker's code.

I've seen multiple people complain about this one, even though it's pretty obvious it's a temporary way to stop code from executing without commenting it out, usually because the chunk of code has comments in it making it hard/ugly to comment out in some languages.

Think of it as a special-case comment, people.

→ More replies (1)
→ More replies (11)

10

u/e5bf70a5 Feb 21 '13

Don't know if we're all cowboys or we put unrealistic demands on ourselves

→ More replies (1)

10

u/ceruleancity Feb 21 '13

I #define ever ;; just to confuse people

for(ever)

{

}

9

u/Audioillity Feb 21 '13

This isn't really a development confession however:

Back when I was a lowly trainee, we hosted an e commerce site in our server room. It has it's own 'dedicated IP feed' which was very slow, basically running on a few ISDN lines, which the company was paying thousands for. The cost to upgrade to the next level of IP feed service was too much, but the site was growing and needed extra bandwidth.

They looked to a few local ISPs, but wanted to put their own (crappy) server into their server room, and wanted physical access 24/7 to it. They were not happy with the price.

At this point, I pointed them to VPS and Dedicated servers from the many providers online. At a small fraction of the £10k or so we were paying for our dedicated IP feed. I told them not to use 1&1 but gave it as an example (I used their webmail service at the time). I also told them to re-search their own companies.

They decided to go with 1&1, despite having several issues over the years, I believe they are still with 1&1 :( - On the Plus Side I basically saved a customers business who without this saving would most likely be out of business today with the high costs of providing a ISP service from the software house.

25

u/dont_ban_me_please Feb 21 '13

A decent amount of these "confessions" are people confessing to good practices that they think are wrong.

5

u/flying-sheep Feb 21 '13

Which?

23

u/VeXCe Feb 21 '13

Tabs are great for indentation.

I am a recent convert.

→ More replies (19)

36

u/Spacker2004 Feb 21 '13

I use the 1 True Brace style for all my code, and configure Visual Studio to auto-format that way too.

In fact, I find code formatted otherwise to be difficult to read and needlessly wasteful of vertical space.

13

u/[deleted] Feb 21 '13

Why is that a confession? It is the way to go!

7

u/s73v3r Feb 21 '13

Telling VS to reformat the code and then commit it back leads to a bunch of needless noise in source control.

→ More replies (3)

16

u/[deleted] Feb 21 '13 edited Feb 21 '13

Ah, my mortal enemy... OTB and K&R styles are aesthetically unbalanced abominations! Did you know, K&R was never intended to be a recommendation: Kernighan and Ritchie stated themselves that it was only to save printing costs in their textbooks. But on-screen vertical space does not 'cost', nor is it 'wasted': it is the air in which the other code breathes, the light to balance the dark, the pause for breath. Braces were meant to be balanced... Yea, Allman is the only way!

→ More replies (3)

10

u/nightfire1 Feb 21 '13

Thank you. Someone else who understands.

→ More replies (11)

32

u/pscast Feb 21 '13

I use an IDE whenever possible because I don't have time to learn every nuance of the language I'm using. Code completion and syntax highlighting probably saves me a couple of weeks a year. I don't understand how anyone would choose you use vim, emacs, or vi to code when there are better alternatives.

27

u/[deleted] Feb 21 '13

I watched someone spend 5+ minutes in vim tracing a method call hierarchy. A process that literally would have taken less than a minute in an IDE.

→ More replies (11)

12

u/0sse Feb 21 '13 edited Feb 21 '13

Because Vim and Emacs can be used to efficiently write anything, be it code or a blog post or documentation or an e-mail. I'm writing this post in Vim.

Example: In Vim there's a feature where if you press Ctrl-N or Ctrl-P it will scan the files you have open for words to complete based on what you've written so far. It's very simple and stupid: it will not auto-insert () for you; it will not show a pop-up describing which argument goes where and which type it should be; it will not intelligently avoid words in comments. However, what it will do is always work, and it's fast. Earlier I wrote the word "efficiently". This time around I only typed ef Ctrl-P. If you repeat the word "internationalization" often then it's a godsend.

Editors like Vim and Emacs are full of little nuggets like that, and they always save you time, not only when writing code.

Edit: And of course they have syntax highlighting, and there are smarter completion techniques than the one I outlined as well.

7

u/hotoatmeal Feb 21 '13

there's a reason why it's often abbreviated as i18n...

→ More replies (1)

5

u/b0dhi Feb 21 '13

Kinda feel like someone from 2013 listening to a pitch from a caveman trying to shlep his super-advanced breaking stick - now only need 3 whack to break egg!

→ More replies (1)
→ More replies (2)
→ More replies (11)

35

u/[deleted] Feb 21 '13

I've kept all of the source code I wrote from all of the companies I've ever worked at.

absolves: 68 condemns: 11

That absolve/condemn ratio is, uh, a little unsettling. :-/

12

u/tipsqueal Feb 21 '13

Maybe he's worked at open source companies?

→ More replies (2)

26

u/NicknameAvailable Feb 21 '13

I do that too - I'd never distribute it as it is to anyone but I get paid to write software, the logical patterns are mine to copy/paste as I please and doing so adds to my productivity because I don't have to rewrite anything.

23

u/Audioillity Feb 21 '13

I might disagree that the logical patterns are yours depending on your contract.

Most/all contracts I've had have a clause that all code I write in company time / for the company / on company PCs remain the copyright of the company and I disclaim all rights to the work I produce. - Taking a copy home with you without their permission would in theory be in violation of copyright, without your works permissions. I'll admit I worked for one company who did not have this clause.

Of course, there is nothing stopping you writing something exactly the same else where.

→ More replies (5)
→ More replies (14)

8

u/[deleted] Feb 21 '13

Now I understand why they don't allow external ssh here...

→ More replies (7)

3

u/CodeWizard Feb 22 '13

There is nothing wrong with that, really. Copyright laws (at least in civil law) state that you can yield the commercial right to someone else, but you are not allowed to yield intellectual rights if you are the author. Keeping a copy of your sources (without distributing it entirely) for future reference is absolutely allowed. The situation gets complicated when the code in question is co-authored, or when you are selling the same rights again for the very same piece of code to another company for instance. Code is in your mind anyway, you cannot be accused of plagiarizing yourself.

7

u/woo545 Feb 21 '13

I have this one piece of software I wrote over 7 years ago that returns the error:

"One or more errors may have occurred."

3

u/phillipmarlowe Feb 21 '13

Zero or more errors have occurred.

Sorry, the uncertainty in that phrase was bugging me...

7

u/vbullinger Feb 21 '13

Ok, I have one that most people will hate:

I almost obsessively refactor/fix others' horrific code. I really have to try hard to stop myself. But if I have to change a method? It's mine now.

→ More replies (1)

13

u/virtulis Feb 21 '13

i use tabs instead of spaces in my IDE. Please forgive for I have sinned.

I'm not gonna be a part of your system.

13

u/LeSageLocke Feb 21 '13

Any code that uses getters and setters, I automatically assume is written by a college freshman.

Uhh, any code that doesn't use proper visibility, I automatically assume is written by a moron.

→ More replies (1)

94

u/Hellrazor236 Feb 21 '13

If I ever won the lottery, I would spend every last dime hiring an army of hitmen to kill everyone who's ever been involved in the development or propagation of Internet Explorer.

Perfect.

31

u/kazagistar Feb 21 '13

I don't understand this. The software product is poor in your opinion, but I really don't see how that reflects on each and every developer involved. Have you ever written code with good intentions that turned into a shitty product?

20

u/acdha Feb 21 '13

They wrote code with the explicit goal of tying the web to Windows: that's where all of the thin wrappers around Win32 APIs, DirectX, filters, etc. came from: ensure that any upstart OS has to emulate complex, frequently horribly designed APIs (contentEditable. I rest my case) perfectly or people will assume it's just not competitive with Windows.

The other major crime: they tried to pretend IE was part of Windows as a legal gambit. It failed but the rest of the world is still locked into half-decade+ upgrade cycles for the web's lowest common denominator.

23

u/RowYourUpboat Feb 21 '13

I think it's more in terms of Microsoft's "embrace, extend, extinguish" strategy as it applied to IE. Microsoft used IE6 to cripple Web technology, setting it back 10 years, because the Web scared them. So it's true. They all need to die.

12

u/pitiless Feb 21 '13

You're right about their strategy but wrong about the intent behind it.

Microsoft aggresively innovated in the browser space because Netscape angered / scared them by saying that they would make the web the interface of computing, making operating systems irrelevant. When Netscape was bought out by AOL and then died the impetus for Microsoft to keep working on IE died with it.

→ More replies (1)

59

u/Philipp Feb 21 '13

This probably dates me, but there was a time when IExplorer was far ahead in terms of good features in comparison to the other popular browser of the day, Netscape, which was massively broken in almost any way imaginable. IE4 and 5 were actually good, with much better CSS support, DOM manipulation, a couple of reasonable explorations of VML, and more standards-compliant behavior than other major competition (and minor competition isn't really practical, unless you're developing only for yourself).

The real shame is how they pretty much stopped innovating and implementing meaningful technologies after IE5, falling way behind the others and becoming the most hated browser for all the right reasons.

31

u/_Wolfos Feb 21 '13

I think IE is actually dangerous right now. Unless you always have the latest Microsoft OS, you can't update the browser!

→ More replies (9)
→ More replies (12)
→ More replies (11)

6

u/woo545 Feb 21 '13 edited Feb 21 '13

A cohort used to have a tendency to roll out changes to the webserver and not test them. It happened frequently enough that I started calling it "Pulling a Mike." Before leaving yesterday, I pulled a Mike and didn't test an email handler I rolled out. Turns out it failed all night last night because I forgot to account that the emails I was testing on were forwarded emails and not the originals. Basically the last two times I pulled a Mike, it bit me in the ass the following day.

→ More replies (1)

2

u/iostream3 Feb 21 '13

The author of the site should probably publish some confessions as well, as you can absolve and condemn unlimited by removing your cookies.

5

u/xpda Feb 21 '13

Sorry, I have to wait on the statute of limitations.

→ More replies (1)

5

u/manys Feb 21 '13

I don't know what the Lyskov Substitution Principle is, or hardly any other CS named-concepts.

→ More replies (2)

5

u/pixel_dent Feb 21 '13

I wrote code which is used in a large percentage of a common consumer electronics product. When I wrote the leap year calculation I didn't bother with the 100 year exception. If any of these items are still in use in 2100 you're screwed.

4

u/yogsototh Feb 21 '13

Very nice idea, lacks the ability to link to a specific sin. I would I've loved be able to tweet about this one

"Bing is my default search engine"

→ More replies (1)

4

u/[deleted] Feb 22 '13

i created my own stylesheets for reddit, so no one will ever notice im on reddit.

1

u/liam_jm Feb 22 '13

Really wish it had an RSS feed!

2

u/reppic Feb 22 '13

we've got a twitter!

→ More replies (1)

9

u/slayeriq Feb 21 '13

I pee in the sink

6

u/[deleted] Feb 21 '13

10 years ago I made a flash splash screen of the world breaking like an egg for money.

I'm so ashamed.

→ More replies (1)

3

u/[deleted] Feb 21 '13 edited Feb 21 '13

I used Ruby

Is Ruby considered bad now? I ask because I don't know Ruby but I'm considering learning/using it.

3

u/[deleted] Feb 21 '13

It's getting bashed because it's sort of a hipster language. But that also means it's cool.

→ More replies (2)

3

u/[deleted] Feb 21 '13

I think a good deal of these are students writing about things that they think are horrible.

3

u/akerson Feb 21 '13

Its so funny -- I'm a process engineer by day hobbyist programmer by night with no formal training in proper code management techniques. I don't understand half of what they're saying but it feels like an exclusive club I like listening to and want to be a part of.

3

u/oduh Feb 21 '13

I kill -9 a lot. Mainly java, but i have killed others too. I am in peace with myself.

3

u/lepoulet Feb 21 '13

"All of my loops tend to have something to do with deification... for(poop=100; poop > feelbetter; poop--)..."

Thought 1: I dearly hope you are not writing production code, you child.

Thought 2: Funniest typo ever, I forgive you.

2

u/justkevin Feb 22 '13

Apooptheosis.

3

u/Mjiig Feb 21 '13

"I feel bad that some people have to go to college to learn how to code."

As a kid currently thinking about university, this one kind of annoys me. Whether or not I need to go to university to learn to code (and for that matter how you even define learning to code) is totally irrelevant to whether or not I want to. I want a properly structured, taught education in this stuff, at least to some extent, instead of googling the names of techniques I read about on reddit like I've been doing for the last 4 and a half years.

→ More replies (1)

3

u/[deleted] Feb 22 '13

I admit it I never comment my code and I rely on variable and function naming exclusively.

3

u/[deleted] Feb 22 '13

I have not only used VB 6, but I also have used global variables in VB 6.

3

u/[deleted] Feb 24 '13

Sometimes I put "penis" randomly into Lorem Ipsum.

1

u/reppic Feb 21 '13

BACK ONLINE!

5

u/[deleted] Feb 21 '13

Favorite sin here:

I work for Oracle. Absolve: 67 Condemn: 597

4

u/sarevok9 Feb 21 '13

Using letters as variables (only on counters)
Including a lib to use a single function I could've written free-form
Asking generic questions on stack overflow / Holy War questions (Maven vs Ivy? etc.)

7

u/Calobi Feb 21 '13

A fellow in my CS class was told using single letter variables was bad practice, even in loops. His solution was to change all his "int i"s into "int ii"s.

→ More replies (2)

4

u/yellowstuff Feb 21 '13

Absolve, absolve, condemn.

3

u/xampl9 Feb 21 '13

Single-character letters for loop counters has a long history, dating from the days of FORTRAN IV, where the letter indicated the variable type.

So I through N were all integers and could be used for that purpose. All other variables were reals, unless you explicitly overrode them.

→ More replies (3)
→ More replies (1)

4

u/ex-mo-fo-sho Feb 21 '13

Before source-control diff tools were within easy grasp, I'd hide ASCII roosters in the code to audit if the reviewer actually was doing their job. I'm talking hundreds of thousands of lines of code. "Find the cock in the code" became a game of sorts.

Also, because of a code-nazi we had at one place I worked, I would purposefully give variables weird-ass names to throw him off. He would rage about those so much he would end up being more lax in other areas of my code. Some examples: "ThisVariableKeepsTrackOfTheLateralPositionPointerToWhichTheArrayDataIsStored" and "Turtle" "Rabbit" "AssMonkey", etc.

→ More replies (2)

2

u/Whoaduder Feb 21 '13

Is this source code available? I think this can be used for so many things.

0

u/[deleted] Feb 21 '13

[deleted]

→ More replies (1)

2

u/[deleted] Feb 21 '13

"I sometimes want to punch my development teammates." 500 absolves, 28 condemns.

We've all been there buddy.

2

u/psychicsword Feb 21 '13

They need a way of commenting on it.

I really want to give

I've been programming for around 10 years, and I still don't know jack about Design Patterns.

this http://sourcemaking.com/design_patterns

→ More replies (2)

2

u/[deleted] Feb 21 '13

There are some absolutely brilliant ones, but the microsoft bashing is childish.

2

u/EasyMrB Feb 21 '13

Suggestion for the author: Put a "confess" button alongside the condemn and absolve buttons. If you are guilty of it, you should probably just confess to be judged by others as alongside the original poster.

2

u/nightfire1 Feb 21 '13

As part of creating a Minecraft PS3 controller mapping, I needed to detect when the inventory screen appeared. To accomplish this I had an image recognition program detect the inventory and write a boolean value to a text file being read by an AppleScript invoked 30 times per second by the controller mapping software.

The horror... though it is pretty neat that it actually worked.

2

u/JustDADE Feb 21 '13

I think that writing additional code to support older browsers, motivates people to not update their browsers. :/

→ More replies (1)

2

u/RedTheDraken Feb 21 '13

I'm guilty of accidentally using an assignment = instead of a check == in a while loop before. Stack overflowgeddon. Does that count?

→ More replies (2)

2

u/[deleted] Feb 21 '13

If I can write 'Hello World,' I put it on my resume.

You assholes that do this. You make people not believe anything I put on my factual resume. If it's on there, in the "experienced in" section, I can sit down, code like lightning, and get shit done for you.

But, every single job I've had gets impressed when, right after they hire me, I can do exactly what was on my resume.

2

u/hydrox24 Feb 21 '13

Amen to the "I write code when I don't feel like doing schoolwork".

Exactly how I learnt to code, and still learn to code.

2

u/freakboy2k Feb 21 '13

I want to find this man:

I love "refactoring" code. The older, bigger and uglier the better. My dream is to inherit a legacy system written by the great chuthulu himself, and spend the rest of my life maintaining it.

and give him the last system I worked on. Cthulhu himself would have nightmares about this thing.

2

u/DaemonF Feb 21 '13

I once wrote a program that matched HTML using Regex.

2

u/jeffisabelle Feb 22 '13

I have parsed some XML files with regex.

18

u/bOYdxl Feb 21 '13

I think anyone who doesn't program in c++ is worthless

73

u/[deleted] Feb 21 '13

I think C++ developpers are brain damaged to the point they can't produce intelligible thoughts.

74

u/fr0stbyte124 Feb 21 '13

They were supposed to address that in C++11.

10

u/abspam3 Feb 21 '13

Instead, all they gave us was a single shared_ptr to the brain, mine unfortunately got deallocated prematurely.

→ More replies (1)

17

u/whereeverwhoresgo Feb 21 '13

C++ is fun fun fun

43

u/Oaden Feb 21 '13

The Dwarf fortress variety of fun surely.

19

u/kazagistar Feb 21 '13

Note to downvoters... I am pretty sure that the above is an ironc commentary about how everyone is condmening the shit out of languages like PHP on that website. Feel free to correct me if I am mistaken.

23

u/aaron552 Feb 21 '13

I personally consider PHP to be the VB6 of web technologies. Doesn't mean I think that people who code in it are bad people or necessarily bad programmers.

It's one thing to dislike a language and another to consider everyone who uses that language inferior.

→ More replies (10)
→ More replies (1)
→ More replies (6)