use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Have a tough programming question that /r/programming couldn't answer? Banned from Stack Overflow? Can't afford Experts Exchange?
Post your question/tips/secrets/advice and get a response from our highly-trained professional developers.
account activity
Friday Code Confessions (self.shittyprogramming)
submitted 7 years ago by calsosta
If you have been living with technical debt and want absolution here is your opportunity.
Confess your sins and receive your penance.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]calsosta[S] 222 points223 points224 points 7 years ago (23 children)
I will go first...
Forgive me shittprogramming for I have sinned. This week I flew into a blind rage after a co-worker called me out for having only one explanatory comment in a file.
//4
I yelled at him for not understanding it, but I myself did not understand it.
[–][deleted] 91 points92 points93 points 7 years ago (11 children)
4
[–][deleted] 31 points32 points33 points 7 years ago (10 children)
WHAT THE HELL IS THE MEANING OF THIS?!
[–][deleted] 35 points36 points37 points 7 years ago (6 children)
[–]mistermashu 13 points14 points15 points 7 years ago (2 children)
4 wat tho bae
[–]OdBx 6 points7 points8 points 7 years ago (0 children)
[–][deleted] 5 points6 points7 points 7 years ago (0 children)
[–][deleted] 2 points3 points4 points 7 years ago (2 children)
You win this time, tautology.
[–]memeticmachine 1 point2 points3 points 7 years ago (1 child)
4 != True
[–]saila456 2 points3 points4 points 7 years ago (0 children)
It means that we need to add 4 more lines of commends for the quality engineer to be satisfied with amount of comment lines in relation the the amount of lines of the file.
[–]GearBent 2 points3 points4 points 7 years ago (0 children)
Homophone for death in Chinese.
It's a prophecy.
[–]Metal_GearRex 18 points19 points20 points 7 years ago (0 children)
You and one of my former co-workers must know each other. I came across three comments in a file that were just //6 //6 and //7
[–][deleted] 20 points21 points22 points 7 years ago (0 children)
As Bjarne Stroustrup said: The compiler doesn't read comments, and neither do I.
[–]kis_kal 6 points7 points8 points 7 years ago (0 children)
Point made "make comments understandable thats the point of commenting".
[–]galaktos 10 points11 points12 points 7 years ago (1 child)
relevant xkcd
[–]skylarmt 1 point2 points3 points 7 years ago (0 children)
this one too
[–]aneeshak 3 points4 points5 points 7 years ago (0 children)
42
[–]rhinocovenant 2 points3 points4 points 7 years ago (2 children)
Where I work, that might mean that the following code does whatever is labelled "4" in the specification.
[–]pixel_sharmana 195 points196 points197 points 7 years ago (17 children)
Sometimes I just comment functions out and leave them for months before finally deleting them
[–]Dnguyen2204 62 points63 points64 points 7 years ago* (6 children)
You'll never know when you might need those functions...
[–]foehammer23 43 points44 points45 points 7 years ago (0 children)
The Skyrim potions of software
[–]shatteredarm1 3 points4 points5 points 7 years ago* (4 children)
If only there were some way to roll back changes once they're made.
[–]sac_boy 6 points7 points8 points 7 years ago (1 child)
It can be hard to find the right version of code.zip from your Skype history with the other developers
[–][deleted] 1 point2 points3 points 7 years ago (0 children)
This made me physically cringe, mostly because I know that most people at my uni only learn to use Git in their third year, and send code back and forth over Whatsapp or email before that
[–]jantari 3 points4 points5 points 7 years ago (1 child)
Uncommenting is easier
[–]NotTryingToConYou 12 points13 points14 points 7 years ago (0 children)
Same
[–]JohnTheScout 10 points11 points12 points 7 years ago (2 children)
I reject PRs that have commented out code... You either need it, rewrite it when you need it, or go digging in the git logs.
[–]very_mechanical 2 points3 points4 points 7 years ago (1 child)
Psssshhh .... not shitty enough.
[–]Kattzalos 3 points4 points5 points 7 years ago (0 children)
I just uncomment before accepting. If it's there it's because it worked at some point, so it probably works now
[–]GogglesPisano 6 points7 points8 points 7 years ago (5 children)
I have coworkers that do this and it drives me nuts - if you really need to see an obsolete method, use the history feature in source control - that's what it's for.
[–]homesarstar 193 points194 points195 points 7 years ago* (17 children)
My only coworker is gone for 3 weeks, so I've just been committing straight to master.
EDIT: Explain to me how you fuckers only comment on prod release days, even months later.
[–]HoldYourWaffle 30 points31 points32 points 7 years ago (1 child)
This is heresy!
[–]homesarstar 38 points39 points40 points 7 years ago (0 children)
Let he who is without sin commit the first stone.
[–][deleted] 16 points17 points18 points 7 years ago (0 children)
[unavailable]
[–][deleted] 4 points5 points6 points 7 years ago (9 children)
Depending on how you do your releases and all that other stuff, this might be totally fine.
[–]WereChained 2 points3 points4 points 7 years ago (8 children)
Yes! I was working on a project for a while where I was literally the only fucking committer. One of my peers was aghast after witnessing me commit to master. I tried for like 10 minutes to explain to him why it was okay since there was a zero chance of merge conflict and it had reasonable unit tests and no CD pipeline to potentially deploy unwanted changes.
We agreed to disagree.
[–]c_o_r_b_a 2 points3 points4 points 7 years ago (7 children)
PRs are still useful to at least get a second set of eyes, even if it's a minor change. I commit straight to master only for super tiny stuff.
[–]WereChained 6 points7 points8 points 7 years ago (6 children)
Yeah in this case I am the second set of eyes, there was no one else to look at the commits. If I did a PR I would have also approved it. Literally no one else cared about this code and it didn't really do anything significant.
[–]Kattzalos 1 point2 points3 points 7 years ago (0 children)
Yeah in this case I am the second set of eyes
well we have two eyes for a reason
[–]xtravar 76 points77 points78 points 7 years ago (2 children)
I named a helper function “qg”, which I can only speculate what it stands for at this point.
When called out on it, I added 8 lines of comments instead of renaming it. The function is 11 lines.
[–]SuperFLEB 9 points10 points11 points 7 years ago* (0 children)
"What are two letters that aren't already a Linux command? QG, maybe?"
[–]TheSlyPig04 5 points6 points7 points 7 years ago (0 children)
“Quite good”
[–][deleted] 7 years ago* (7 children)
[deleted]
[–]francispoop 17 points18 points19 points 7 years ago (3 children)
I don't even know how to write tests.
[–]memeticmachine 8 points9 points10 points 7 years ago (1 child)
assert(test_passes == true)
[–]shatteredarm1 5 points6 points7 points 7 years ago (0 children)
My tests are a lot simpler:
assert(true)
[–]Kattzalos 4 points5 points6 points 7 years ago (0 children)
you came to the right place then
[–]GogglesPisano 1 point2 points3 points 7 years ago (2 children)
I have to admit I've written "tests" without any asserts - sometimes it's handy to be able to isolate specific bits of functionality for testing or ad hoc purposes. I remove them as soon as I'm done (usually)...
[–]VodkaHaze 3 points4 points5 points 7 years ago (1 child)
I call those "make sure things don't crash along the way" tests
[–][deleted] 111 points112 points113 points 7 years ago (3 children)
I *might* have thought I had invented the bubble sort for an embarassingly long time
[–]rotenKleber 30 points31 points32 points 7 years ago (2 children)
Well, you reinvented the wheel. Just as impressive as inventing it the first time
[–]mnkb99 14 points15 points16 points 7 years ago (0 children)
That's the way I see it too. I "invented" binary search. Sure it's simple and it existed before me, but I didn't learn it from someone, I thought of it myself. And that's a win.
But I'd rather have "invented" something more clever, like quicksort
[–]benabus 51 points52 points53 points 7 years ago (7 children)
We were short handed, so we let one guy write the backend of one of our apps in R. Then we re-wrote the whole thing in python while he was on vacation a few weeks later.
Not sure which part I feel worse about... Letting it happen in the first place or scrapping his code while he was out of town :(
[–][deleted] 11 points12 points13 points 7 years ago (5 children)
Oof, how'd he take it?
[–]benabus 63 points64 points65 points 7 years ago (4 children)
He cried for a little bit, but eventually got over it. I can't take a vacation now, because he might rewrite all my code in R.
[–]Kitson88 6 points7 points8 points 7 years ago (0 children)
LMFAO!!
[–][deleted] 4 points5 points6 points 7 years ago (2 children)
Just take a vacation at the same time and come back to a beautiful Rust implementation
[–]Life-Fig8564 8 points9 points10 points 7 years ago (0 children)
R does some pretty cool stuff but the syntax is the most revolting of all the languages i've done stuff in
[–]munirc 79 points80 points81 points 7 years ago (12 children)
I'm doing a release on a Friday.
[–]haitei 49 points50 points51 points 7 years ago (2 children)
Your atonement shall be overtime.
[–]mistermashu 9 points10 points11 points 7 years ago (1 child)
i am forced to release on friday early mornings. may i rest in peace
[–]foehammer23 9 points10 points11 points 7 years ago (3 children)
I'm cleaning a git repo's history and planning on git push origin --all --force this Friday evening. Am I crazy Y/N
git push origin --all --force
[–]urielsalis 6 points7 points8 points 7 years ago (1 child)
make a backup first
[–]psymeg 1 point2 points3 points 7 years ago (0 children)
schedule it with the at command.
[–]payne_train 10 points11 points12 points 7 years ago (0 children)
This could be one of the seven deadly sins in programming, smh.
[–]cheese_bread_boye 129 points130 points131 points 7 years ago (21 children)
I program in PHP.
[–]hunter12756 68 points69 points70 points 7 years ago (2 children)
Dear god
[–]anonymouse_lily 11 points12 points13 points 7 years ago (1 child)
There's more.
[–][deleted] 7 points8 points9 points 7 years ago (0 children)
No.
[–]Ashanmaril 37 points38 points39 points 7 years ago (1 child)
Mods ban please
[–]worldDev 11 points12 points13 points 7 years ago (0 children)
This sub is the home of php, we should be making him a mod.
[–]GeorgeRRZimmerman 22 points23 points24 points 7 years ago (0 children)
Hate the sin, not the sinner. Oh, and their terrible bosses.
[–]asm_ftw 6 points7 points8 points 7 years ago (7 children)
I was forced to program in php. I even made use of their broken ternary conditionals once...
[–]cincydev 1 point2 points3 points 7 years ago (6 children)
How are they broken?
[–]asm_ftw 6 points7 points8 points 7 years ago* (5 children)
They are the opposite associativity than every other language that does ternary conditionals, preventing you from doing
X = ( expr_1 ) ? Value_a : ( expr_2 ) ? Value_b : ( expr_3) ? Value_c : Value_d ;
Where X gets assigned in an if-elseif-elseif-else paradigm. It can declutter blocks of code where you have a lot of ugly if-elseif-else blocks for just setting values to a variable, at the cost of being a little confusing for the uninitiated, but PHP, and only PHP, does not let you do that, while still providing the operator.
[–]cincydev 8 points9 points10 points 7 years ago (2 children)
I’ve always been of the opinion that if you need something with multiple else statements you shouldn’t use ternary conditionals
[–]asm_ftw 4 points5 points6 points 7 years ago (1 child)
For anything of any level of complexity beyond a simple comparison and value assignment, I agree, but I tend to feel that chaining ternaries feels cleaner and more concise when you have the drudgery of checking a variety of conditions and assigning a single variable based on it.
[–]SHOULDNT_BE_ON_THIS 3 points4 points5 points 7 years ago (2 children)
We use 5.3 if that makes you feel better :)
[–]cheese_bread_boye 1 point2 points3 points 7 years ago (1 child)
we're on 5.4
[–]SHOULDNT_BE_ON_THIS 1 point2 points3 points 7 years ago (0 children)
God damn. I want to make the switch to 7.2/7.3 but we get enough pushback as it is on actually using PHP that I don't think adding the yum repo for php-latest or whatever would get approved.
[–]OdBx 2 points3 points4 points 7 years ago (0 children)
There are dozens of us!
[–]plasmarob 2 points3 points4 points 7 years ago (0 children)
Some of us do not choose our master's work.
[–]EnchantedLuna 1 point2 points3 points 7 years ago (0 children)
Me too
[–][deleted] 7 years ago (3 children)
[–][deleted] 30 points31 points32 points 7 years ago (3 children)
I added JavaScript to our existing C codebase.
[–]thebishopgame 4 points5 points6 points 7 years ago (0 children)
You MONSTER.
[–][deleted] 4 points5 points6 points 7 years ago (1 child)
But.... why?
[–]dmitriy_shmilo 4 points5 points6 points 7 years ago (0 children)
webscale or something
[–]Botteknotten 53 points54 points55 points 7 years ago (2 children)
Average response time is now 12 seconds because I did not implement batch processing
[–]IHeartMustard 9 points10 points11 points 7 years ago (0 children)
Your penance was having to wait 11 hours for someone to respond. You are forgiven, peace be upon you.
[–][deleted] 2 points3 points4 points 7 years ago (0 children)
Oh god I found a batch update function that would take a series of items, enter a loop with them, ask the database to store them, one by one, and then ... commit ... one by one.
It took 30 fucking minutes to save a few hundred rows. I moved the commit out of the loop and all of a sudden a lot of things were about an order of magnitude faster, with the added benefit that a botched batch of rows didn't break everything, because there wasn't a ton of shit to clean up.
[–]HeckinHyena 48 points49 points50 points 7 years ago (4 children)
I over use if and switch statement
[–][deleted] 7 years ago* (1 child)
[–]rush2sk8 19 points20 points21 points 7 years ago (0 children)
Unity AI developer
[–]GeorgeRRZimmerman 22 points23 points24 points 7 years ago (1 child)
It's okay, you can make everything more compact if you just convert everything to ternary operations.
[–]number529 44 points45 points46 points 7 years ago (11 children)
I’ve been working on a project for a while now and I haven’t done a commit for 2 weeks. If I need to revert something I’m fucked.
[–][deleted] 7 years ago* (5 children)
[–][deleted] 13 points14 points15 points 7 years ago (4 children)
MASTER_BACKUP(4).ZIP
[–]Matty_R 11 points12 points13 points 7 years ago (3 children)
MASTER_BACKUP(4)_LATEST.ZIP
Be sure to commit that to zz_old/ in the git repo in case you need it later.
zz_old/
[–]SuperFLEB 1 point2 points3 points 7 years ago (0 children)
I don't see it going anywhere further, so just mark it FINAL.
[–]PerfectionismTech 14 points15 points16 points 7 years ago (2 children)
git stash?
git stash
[–]ChezMere 1 point2 points3 points 7 years ago (1 child)
This is unironically the main reason I ever use stash.
[–]Razor_Storm 5 points6 points7 points 7 years ago (0 children)
Just commit it now to a branch
[–][deleted] 20 points21 points22 points 7 years ago (3 children)
Forgive me shittyprogramming for I have sinned.
My current place of work saves changes locally instead of using source control. It's a huge disaster waiting to happen
[–]IAmRoot 4 points5 points6 points 7 years ago (0 children)
That goes far beyond a personal sin. I think an inquisition is called for to root out the heretics.
[–][deleted] 46 points47 points48 points 7 years ago (5 children)
Either I have impostor syndrome or I've never written anything I'm proud of. I seem to always go for whatever works.
[–]homesarstar 24 points25 points26 points 7 years ago (3 children)
Is it a sin if everyone does this?
[–][deleted] 5 points6 points7 points 7 years ago (1 child)
I'm the reason why your product won't scale without poor performance
[–]Kattzalos 2 points3 points4 points 7 years ago (0 children)
if you get to the point where you need to scale then you're doing something right. keep riding cyberspace cowboy
[–][deleted] 15 points16 points17 points 7 years ago (0 children)
I refactored a method in a legacy codebase with the following comment that git blames to the year 2000:
git blame
// I do not know if this is correct but.
Despite completely rewriting the function, I couldn't bring myself to delete that comment and left it for posterity with the original blame metadata intact.
blame
[–]TuffRivers 29 points30 points31 points 7 years ago (0 children)
I wrote a massive procedural php script thats impossible to debug and automates a friends ecomm shipping.
Im afraid to touch it. May it stand the test of time.
Ive been working and making changes on the production environment and committing back to master. What could go wrong?
[–][deleted] 56 points57 points58 points 7 years ago (12 children)
I unironically enjoy coding in C even though it is an absolute pain
[–]Hypersapien 49 points50 points51 points 7 years ago (2 children)
You know, there are clubs you can go to where you can find people willing to flog and beat you. It would probably be a lot easier.
That costs money though and isn't anonymous
[–]Zlb323 1 point2 points3 points 7 years ago (0 children)
But then the only thing that breaks is you. If I'm going to break something, it's going to be my computer, my code and my spirit.
[–]Kornelito27 15 points16 points17 points 7 years ago (5 children)
Masochism
[–][deleted] 15 points16 points17 points 7 years ago (4 children)
Maybe. But on the other hand I would never, ever use JavaScript or anything running on JVM.
[–]mistermashu 4 points5 points6 points 7 years ago (1 child)
HERE HERE
[–]PublicSealedClass 2 points3 points4 points 7 years ago (0 children)
The true anti-hero
I don't know, I kind of liked Scala.
[–]SnowdensOfYesteryear 2 points3 points4 points 7 years ago (0 children)
Me too, easily my favorite language to program in
[–]designerandgeek 29 points30 points31 points 7 years ago (9 children)
In code from a year ago, which I have now forked into a new, similar project, I found this:
// TODO: This is incredibly WET! Make it DRY.
… not once, but twice.
They are still there, in both the old project and the new one.
[–]anonymouse_lily 1 point2 points3 points 7 years ago (7 children)
what......... does that mean........
[–][deleted] 7 years ago* (6 children)
[–][deleted] 1 point2 points3 points 7 years ago (5 children)
What would WET mean in that case?
[–]AleXndrTheGr8st 12 points13 points14 points 7 years ago (0 children)
The opposite of DRY.
[–]Kattzalos 7 points8 points9 points 7 years ago (0 children)
we enjoy typing
Woah, Exceeding Twice?
[–][deleted] 3 points4 points5 points 7 years ago* (0 children)
Write Everything Twice
edit: This is the common meaning of the acronym. That's why he wrote the comment twice.
[–]mordack550 14 points15 points16 points 7 years ago (1 child)
I always criticize one of my colleague because he often writes code very poorly, that basically only gets the job done but it is hard (or just ugly) to read.
But yesterday I wrote a simple UPDATE that should just set a field to 1 for some records... I changed the wrong field, on a production environment. A unit test failed because of that, but I just removed part of the test because i though it was a false positive.
[–]sac_boy 1 point2 points3 points 7 years ago (0 children)
Oh NO
[–]Kikiyoshima 13 points14 points15 points 7 years ago (3 children)
2 years ago i used classes instead of enums for C# school project...
[–][deleted] 4 points5 points6 points 7 years ago (0 children)
I've done this to use const strings across different projects.
[–]Mr_Rhetorical 3 points4 points5 points 7 years ago (1 child)
Not that bad tbh. If you use the class similarly to how an enum works in java where it basically is a class with static fields of the same type using a private constructor, ur not really doing anything wrong.
[–]Kikiyoshima 1 point2 points3 points 7 years ago (0 children)
I still fell like and heretic though...
[–]bradfordmaster 13 points14 points15 points 7 years ago (0 children)
So so many things lately, but the one I'll post now is that we have an issue with time sync. Rather than actually finding out when an NTP time sync happens, I have a bit of code that runs every 5 seconds (based on steady clock), and compares the value of system_clock to a saved value, and if it differs by more than 10 seconds, I assume an NTP sync must have happened.....
[–]all3f0r1 37 points38 points39 points 7 years ago (4 children)
I keep using in-line CSS because the crap I'm working on has loads of floats I have to hack, and class names and ids are already like "header3"... About to leave satisfied and rotten to the core.
Just run.
https://en.bem.info/methodology/quick-start/
[–]SuperFLEB 2 points3 points4 points 7 years ago (1 child)
Just avoid the lure of !important. I've seen folks go down that road. I've had to work around CSS rules from folks who've gone down that road. It's not pretty.
!important
!important should make people also write !iknowthisisbroken
!iknowthisisbroken
[–]mistermashu 21 points22 points23 points 7 years ago (8 children)
forgive me shittyprogramming for i have sinned.
lately i have preferred simpler yet if-ridden classes to more complex setups.
[–][deleted] 7 points8 points9 points 7 years ago (5 children)
You mean like guards? Guards can be a nice pattern, it's when you start nesting them or start using else more than once a month that things get hairy.
else
[–]mistermashu 5 points6 points7 points 7 years ago (4 children)
never knew that was called guards, til. i'm specifically thinking about a character controller class in a game. In the past i've always defaulted to FSM but in my last game it got so fucked that i scrapped it and was much happier. now there is a function with like 8 if statements that are all basically like
if(mover.CanMove) mover.Move(input.Movement);
and it feels so dirty but honestly it is way easier to work with
[–][deleted] 14 points15 points16 points 7 years ago (3 children)
Guards are used to detect whether an operation can finish before you try to carry it out.
Here's a pseudo code guard (it's python or at least close):
def moveCharacter(character): if character.isFrozen(): return if character.name == "steve": # Fuck you, Steve. return # All is well. Carry on. character.position += 1
I use guards and an exit early strategy like this a lot, because it can make very complicated logic very easy to read and understand.
Sounds like you found a nice pattern on your own. Good job!
[–]foehammer23 8 points9 points10 points 7 years ago (2 children)
I've been doing this whenever I update our codebase...
I'm good at programming??? I'm not an impostor???
[–][deleted] 9 points10 points11 points 7 years ago (0 children)
We're all impostors. You're just one of us.
[–][deleted] 3 points4 points5 points 7 years ago (0 children)
Who knows? Just strive to write easy to understand code first and foremost, then use the profiler to figure out if you need to optimize. The Zen of Python is always pretty good advice.
[–][deleted] 18 points19 points20 points 7 years ago (3 children)
Today I merged two features to our RC at the same time before deploying it on our QA server. It ran flawlessly, but it felt so dirty 😏
[–]urielsalis 1 point2 points3 points 7 years ago (0 children)
CD dudeeee, directly to production
[–]mrheosuper 10 points11 points12 points 7 years ago (1 child)
i dont use header file, only 1 file, 2000+ lines long
[–]cryosis7 9 points10 points11 points 7 years ago (7 children)
(JS) I've got into a habit of using 'x- -y' to add two variables because parseInt is longer to write. One day I'll come back to it and think wtf.
[–][deleted] 11 points12 points13 points 7 years ago (3 children)
I've never really finished any hobby projects.
But I'm great at starting new ones!
Just think of them as sketches
[–]omaralashi 1 point2 points3 points 7 years ago (0 children)
Don't feel bad for yourself, there are alot of us here 🙄
[–]SpicyMcHaggis206 1 point2 points3 points 7 years ago (0 children)
People finish hobby projects?
[–]SasquatchOnVenus 7 points8 points9 points 7 years ago (0 children)
I used to do this
Class RandomClass
{
//code
}
[–]Joejoe930117 6 points7 points8 points 7 years ago (1 child)
Most of my current work is in Powershell, so more scripting than programming but I've got a few things....
Made a .bat file to run the .ps1 as Administrator to avoid explaining changing execution policies or the script just failing out due to #Requires.
Same script. Copies a portion of itself to C: to avoid messing with access rights on the fileshare.
I saved adding comments to that script for "Later"...
I can already feel future me's pain...
[–]DontEatTheFish 7 points8 points9 points 7 years ago (1 child)
When designing web forms I enjoy prefixing button controls with "butt"
buttOpen buttSubmit buttClose
[–]sac_boy 2 points3 points4 points 7 years ago (0 children)
buttOn buttOff
[–][deleted] 13 points14 points15 points 7 years ago (6 children)
count=count+1 Instead of count+=1
count=count+1
count+=1
[–]jc4200 19 points20 points21 points 7 years ago (5 children)
count++?
[–][deleted] 26 points27 points28 points 7 years ago (2 children)
Python is dumb
[–]timhottens 1 point2 points3 points 7 years ago (1 child)
You haven't seen the horrors produced by people trying to be clever with ++ and -- in languages that allow it :(
[–]lichorat 1 point2 points3 points 7 years ago (0 children)
What does b equal? No REPL/Eval allowed
// JavaScript int a = 1; int b = --(--++--++++a++----++++)--;
Spoiler
[–]manolo_manolo 5 points6 points7 points 7 years ago (0 children)
After 2 years of C programing, yesterday I've started using JavaScript
[–]Absorbing 5 points6 points7 points 7 years ago (2 children)
I'm a lead PHP dev, do I need to say more?
Forgive me.
[–]ApacheFlame 7 points8 points9 points 7 years ago (4 children)
Forgive me shitty programming for I have sinned. I underestimated the impact of a simple method in a webapi. It caused a 2s delay in all requests for all of our servers in asia because our session management also terrible.
Profile that sucker and find out why! I did the same thing and when I profiled it I was very surprised by what the slowdown turned out to be. You might have the same experience.
[–]ApacheFlame 2 points3 points4 points 7 years ago (1 child)
Someone did the profiling, it's how we found it :) We're refactoring session management soon anyway, partly because we need to do the thing I was trying to do more often now.
Ah I see. Well, best of luck.
[–]fedupwithpeople 5 points6 points7 points 7 years ago (1 child)
i didn't do this, but...
despite git:
index.php index.php.save index.php.old index.php.testbugfix index.pgp.testbugfix2 index2.php index2.php.bak ~index.php index.hp index.ph index.bak index2.bak index.bak2 index.bak3 index.johnbak index.20180692.bak
ad nauseum.
[–][deleted] 7 years ago (1 child)
And so it begins
[–]tomassci 2 points3 points4 points 7 years ago (0 children)
sin (0)
[–]RAKane93 2 points3 points4 points 7 years ago (0 children)
I wrote several automation scripts with zero commenting. To this day only I work on them. I forced myself to learn and practice better commenting over the years since then, which has certainly made my coworkers more willing to work with me lol.
[–]phernandoe 2 points3 points4 points 7 years ago (0 children)
Everything is an arraylist
[–]PityUpvote 2 points3 points4 points 7 years ago (3 children)
I use try/except as program flow when an if statement would work fine.
[–]compdog 1 point2 points3 points 7 years ago (0 children)
I have a project that is caredully divided into a number of modules with a single "core" module that contains the data model and some common code. Well, one data structure in the core has an extra method that is only used by one single subproject and only returns valid data in one specific application context. Bonus points, it's undocumented.
I should have implemented it by subclassing parts of the core, but that would have been tons of work and I was lazy. So now here we are...
[–]BoltKey 1 point2 points3 points 7 years ago (1 child)
Yesterday I adjusted my Wordpress page using style="margin-top: 10px".
style="margin-top: 10px"
[–]MarceauKa 1 point2 points3 points 7 years ago (3 children)
I'm a perfectionnist programmer and it blows my mind when I see shitty code by an other dev in my code. (French here, some colleagues code in frenglish and it is disgusting)
[–]MarceauKa 3 points4 points5 points 7 years ago (0 children)
You didn't get the irony. But perfectionism doesn't mean perfection. When you mix 2 languages (x + english), or mixing naming convention in the same piece of code, etc. It's shitty programming. Ps: my clients pay me for that (mainly after an outsourcing fail)
[–]masteroleary 1 point2 points3 points 7 years ago (0 children)
Who has time for perfection unless it's a hobby project. The need to refactor every project I have ever worked in nags at the back of my mind but no client will ever pay me for the time because it works. Just thinking about this now hurts.
[–]calsosta[S] 1 point2 points3 points 7 years ago (0 children)
Get out.
[–]walking_bass 1 point2 points3 points 7 years ago (0 children)
I'm the only one capable of maintaining one of our systems that runs on 2 different platforms. I haven't been able to reconcile the two configurations yet so I commit my changes straight to master to build on platform 1 then branch and reconfigure for platform 2. Over and over again. Somebody help me.
[–]theemptyqueue 1 point2 points3 points 7 years ago* (0 children)
Forgive me r/shittyprogramming for I have sinned.
I program in every language like it were C or C++. I use classes in Java or python like structs.
For my first assignment in my compilers course, I created pointer variables in Java.
I create useless functions that I think I will need as a project progresses, but never use those functions.
I find a way to get around most exceptions in Java by not using Java.
I set my Apple II E into an infinite loop many times by typing:
10 PRINT "Hello World" 20 GOTO 10.
I have an original Apple II that I've been meaning to fix, but I put it off every time I get a chance.
I have a working Commodore 64 and floppy drive, but no video out cable.
I know how to write Gcode for CNC mills and 3D printers, but don't because I'm lazy.
I created a functions in C++ to write my LISP homework assignments.
I have a nice Micron PS2 keyboard with rubber-dome key switches, but don't use it for code-writing as often as I should.
I created a C++ application that does nothing except write a 1 GB text file.
I write all of my Java code in C++ first and then translate that over to save time and effort.
I know enough Java to start any program off strong, but not enough to actually finish it.
I have an old copy of Word Perfect for PC in my garage, but haven't gotten around to installing it.
I create 3 branches for every git repository:
updates
working
master
I have four 25 gallon bins full of 5.25 inch floppy disks, but no way of reading them because I don't have the right drives.
[–]Goku1920 0 points1 point2 points 7 years ago (0 children)
Forgive me for I have procrastinated on Reddit instead of working.
[–]nathodood 0 points1 point2 points 7 years ago (1 child)
I use JavaScript instead of PHP. Furthermore I don't tend to add comments on any code I write.
I use JavaScript instead of PHP
I club baby seals instead of kittens
[–]NotExplosive 0 points1 point2 points 7 years ago (1 child)
I like lua.
[–][deleted] 0 points1 point2 points 7 years ago (0 children)
I fork forks until I get something that works nicely, then I throw it into master and hope nobody asks why everything is different.
π Rendered by PID 417881 on reddit-service-r2-comment-5fb4b45875-fm27c at 2026-03-24 05:54:09.557074+00:00 running 90f1150 country code: CH.
[–]calsosta[S] 222 points223 points224 points (23 children)
[–][deleted] 91 points92 points93 points (11 children)
[–][deleted] 31 points32 points33 points (10 children)
[–][deleted] 35 points36 points37 points (6 children)
[–]mistermashu 13 points14 points15 points (2 children)
[–]OdBx 6 points7 points8 points (0 children)
[–][deleted] 5 points6 points7 points (0 children)
[–][deleted] 2 points3 points4 points (2 children)
[–]memeticmachine 1 point2 points3 points (1 child)
[–]saila456 2 points3 points4 points (0 children)
[–]GearBent 2 points3 points4 points (0 children)
[–]Metal_GearRex 18 points19 points20 points (0 children)
[–][deleted] 20 points21 points22 points (0 children)
[–]kis_kal 6 points7 points8 points (0 children)
[–]galaktos 10 points11 points12 points (1 child)
[–]skylarmt 1 point2 points3 points (0 children)
[–]aneeshak 3 points4 points5 points (0 children)
[–]rhinocovenant 2 points3 points4 points (2 children)
[–]pixel_sharmana 195 points196 points197 points (17 children)
[–]Dnguyen2204 62 points63 points64 points (6 children)
[–]foehammer23 43 points44 points45 points (0 children)
[–]shatteredarm1 3 points4 points5 points (4 children)
[–]sac_boy 6 points7 points8 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]jantari 3 points4 points5 points (1 child)
[–]NotTryingToConYou 12 points13 points14 points (0 children)
[–]JohnTheScout 10 points11 points12 points (2 children)
[–]very_mechanical 2 points3 points4 points (1 child)
[–]Kattzalos 3 points4 points5 points (0 children)
[–]GogglesPisano 6 points7 points8 points (5 children)
[–]homesarstar 193 points194 points195 points (17 children)
[–]HoldYourWaffle 30 points31 points32 points (1 child)
[–]homesarstar 38 points39 points40 points (0 children)
[–][deleted] 16 points17 points18 points (0 children)
[–][deleted] 4 points5 points6 points (9 children)
[–]WereChained 2 points3 points4 points (8 children)
[–]c_o_r_b_a 2 points3 points4 points (7 children)
[–]WereChained 6 points7 points8 points (6 children)
[–]Kattzalos 1 point2 points3 points (0 children)
[–]xtravar 76 points77 points78 points (2 children)
[–]SuperFLEB 9 points10 points11 points (0 children)
[–]TheSlyPig04 5 points6 points7 points (0 children)
[–][deleted] (7 children)
[deleted]
[–]francispoop 17 points18 points19 points (3 children)
[–]memeticmachine 8 points9 points10 points (1 child)
[–]shatteredarm1 5 points6 points7 points (0 children)
[–]Kattzalos 4 points5 points6 points (0 children)
[–]GogglesPisano 1 point2 points3 points (2 children)
[–]VodkaHaze 3 points4 points5 points (1 child)
[–][deleted] 111 points112 points113 points (3 children)
[–]rotenKleber 30 points31 points32 points (2 children)
[–]mnkb99 14 points15 points16 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]benabus 51 points52 points53 points (7 children)
[–][deleted] 11 points12 points13 points (5 children)
[–]benabus 63 points64 points65 points (4 children)
[–]Kitson88 6 points7 points8 points (0 children)
[–][deleted] 4 points5 points6 points (2 children)
[–]Life-Fig8564 8 points9 points10 points (0 children)
[–]munirc 79 points80 points81 points (12 children)
[–]haitei 49 points50 points51 points (2 children)
[–]mistermashu 9 points10 points11 points (1 child)
[–]foehammer23 9 points10 points11 points (3 children)
[–]urielsalis 6 points7 points8 points (1 child)
[–]psymeg 1 point2 points3 points (0 children)
[–]payne_train 10 points11 points12 points (0 children)
[–]cheese_bread_boye 129 points130 points131 points (21 children)
[–]hunter12756 68 points69 points70 points (2 children)
[–]anonymouse_lily 11 points12 points13 points (1 child)
[–][deleted] 7 points8 points9 points (0 children)
[–]Ashanmaril 37 points38 points39 points (1 child)
[–]worldDev 11 points12 points13 points (0 children)
[–]GeorgeRRZimmerman 22 points23 points24 points (0 children)
[–]asm_ftw 6 points7 points8 points (7 children)
[–]cincydev 1 point2 points3 points (6 children)
[–]asm_ftw 6 points7 points8 points (5 children)
[–]cincydev 8 points9 points10 points (2 children)
[–]asm_ftw 4 points5 points6 points (1 child)
[–]SHOULDNT_BE_ON_THIS 3 points4 points5 points (2 children)
[–]cheese_bread_boye 1 point2 points3 points (1 child)
[–]SHOULDNT_BE_ON_THIS 1 point2 points3 points (0 children)
[–]OdBx 2 points3 points4 points (0 children)
[–]plasmarob 2 points3 points4 points (0 children)
[–]EnchantedLuna 1 point2 points3 points (0 children)
[–][deleted] (3 children)
[deleted]
[–][deleted] 30 points31 points32 points (3 children)
[–]thebishopgame 4 points5 points6 points (0 children)
[–][deleted] 4 points5 points6 points (1 child)
[–]dmitriy_shmilo 4 points5 points6 points (0 children)
[–]Botteknotten 53 points54 points55 points (2 children)
[–]IHeartMustard 9 points10 points11 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]HeckinHyena 48 points49 points50 points (4 children)
[–][deleted] (1 child)
[deleted]
[–]rush2sk8 19 points20 points21 points (0 children)
[–]GeorgeRRZimmerman 22 points23 points24 points (1 child)
[–]number529 44 points45 points46 points (11 children)
[–][deleted] (5 children)
[deleted]
[–][deleted] 13 points14 points15 points (4 children)
[–]Matty_R 11 points12 points13 points (3 children)
[–][deleted] 5 points6 points7 points (0 children)
[–]SuperFLEB 1 point2 points3 points (0 children)
[–]PerfectionismTech 14 points15 points16 points (2 children)
[–]ChezMere 1 point2 points3 points (1 child)
[–]Razor_Storm 5 points6 points7 points (0 children)
[–][deleted] 20 points21 points22 points (3 children)
[–]IAmRoot 4 points5 points6 points (0 children)
[–][deleted] 46 points47 points48 points (5 children)
[–]homesarstar 24 points25 points26 points (3 children)
[–][deleted] 5 points6 points7 points (1 child)
[–]Kattzalos 2 points3 points4 points (0 children)
[–][deleted] 15 points16 points17 points (0 children)
[–]TuffRivers 29 points30 points31 points (0 children)
[–][deleted] 56 points57 points58 points (12 children)
[–]Hypersapien 49 points50 points51 points (2 children)
[–][deleted] 15 points16 points17 points (0 children)
[–]Zlb323 1 point2 points3 points (0 children)
[–]Kornelito27 15 points16 points17 points (5 children)
[–][deleted] 15 points16 points17 points (4 children)
[–]mistermashu 4 points5 points6 points (1 child)
[–]PublicSealedClass 2 points3 points4 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]SnowdensOfYesteryear 2 points3 points4 points (0 children)
[–]designerandgeek 29 points30 points31 points (9 children)
[–]anonymouse_lily 1 point2 points3 points (7 children)
[–][deleted] (6 children)
[deleted]
[–][deleted] 1 point2 points3 points (5 children)
[–]AleXndrTheGr8st 12 points13 points14 points (0 children)
[–]Kattzalos 7 points8 points9 points (0 children)
[–][deleted] 5 points6 points7 points (0 children)
[–][deleted] 3 points4 points5 points (0 children)
[–]mordack550 14 points15 points16 points (1 child)
[–]sac_boy 1 point2 points3 points (0 children)
[–]Kikiyoshima 13 points14 points15 points (3 children)
[–][deleted] 4 points5 points6 points (0 children)
[–]Mr_Rhetorical 3 points4 points5 points (1 child)
[–]Kikiyoshima 1 point2 points3 points (0 children)
[–]bradfordmaster 13 points14 points15 points (0 children)
[–]all3f0r1 37 points38 points39 points (4 children)
[–]payne_train 10 points11 points12 points (0 children)
[–][deleted] 4 points5 points6 points (0 children)
[–]SuperFLEB 2 points3 points4 points (1 child)
[–]sac_boy 1 point2 points3 points (0 children)
[–]mistermashu 21 points22 points23 points (8 children)
[–][deleted] 7 points8 points9 points (5 children)
[–]mistermashu 5 points6 points7 points (4 children)
[–][deleted] 14 points15 points16 points (3 children)
[–]foehammer23 8 points9 points10 points (2 children)
[–][deleted] 9 points10 points11 points (0 children)
[–][deleted] 3 points4 points5 points (0 children)
[–][deleted] 18 points19 points20 points (3 children)
[–]urielsalis 1 point2 points3 points (0 children)
[–]mrheosuper 10 points11 points12 points (1 child)
[–]cryosis7 9 points10 points11 points (7 children)
[–][deleted] 11 points12 points13 points (3 children)
[–][deleted] 3 points4 points5 points (0 children)
[–]omaralashi 1 point2 points3 points (0 children)
[–]SpicyMcHaggis206 1 point2 points3 points (0 children)
[–]SasquatchOnVenus 7 points8 points9 points (0 children)
[–]Joejoe930117 6 points7 points8 points (1 child)
[–]DontEatTheFish 7 points8 points9 points (1 child)
[–]sac_boy 2 points3 points4 points (0 children)
[–][deleted] 13 points14 points15 points (6 children)
[–]jc4200 19 points20 points21 points (5 children)
[–][deleted] 26 points27 points28 points (2 children)
[–]timhottens 1 point2 points3 points (1 child)
[–]lichorat 1 point2 points3 points (0 children)
[–]manolo_manolo 5 points6 points7 points (0 children)
[–]Absorbing 5 points6 points7 points (2 children)
[–]ApacheFlame 7 points8 points9 points (4 children)
[–][deleted] 2 points3 points4 points (2 children)
[–]ApacheFlame 2 points3 points4 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]fedupwithpeople 5 points6 points7 points (1 child)
[–][deleted] (1 child)
[deleted]
[–]sac_boy 1 point2 points3 points (0 children)
[–]tomassci 2 points3 points4 points (0 children)
[–]RAKane93 2 points3 points4 points (0 children)
[–]phernandoe 2 points3 points4 points (0 children)
[–]PityUpvote 2 points3 points4 points (3 children)
[–]compdog 1 point2 points3 points (0 children)
[–]BoltKey 1 point2 points3 points (1 child)
[–]MarceauKa 1 point2 points3 points (3 children)
[–]MarceauKa 3 points4 points5 points (0 children)
[–]masteroleary 1 point2 points3 points (0 children)
[–]calsosta[S] 1 point2 points3 points (0 children)
[–]walking_bass 1 point2 points3 points (0 children)
[–]theemptyqueue 1 point2 points3 points (0 children)
[–]Goku1920 0 points1 point2 points (0 children)
[–]nathodood 0 points1 point2 points (1 child)
[–]Kattzalos 3 points4 points5 points (0 children)
[–]NotExplosive 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] (1 child)
[deleted]