Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "is this code"
-
Received "emergency update" code from internal enterprise security team. Wasn't given time to do code review; was assured code was reviewed and solid.
Pushed code to over 6k lower-level servers before finding this gem buried deep within:
...
cd /foo; rm -rf *; cd /
...
(This ran as root, and yes, the cwd was / from earlier in the code).
/foo, of course, did not exist on some servers.
Now, it is those servers which do not exist.
FMLundefined security root linux file not found directory structure rm -rf / directory not found fml rm15 -
In case you ever want to hack into a computer with 14 lines of code only. This algorithm is just genius.25
-
Said my code is self explanatory and doesn't need comments.
After few minutes "wtf is this shit?".5 -
So I was code reviewing this guy's code before merging into the master branch.... and then I FOUND THIS FUCKING CODE, WHAT THE FUCK!!!!!!!!!!!!!!!! What the fuck is this ???66
-
In my freelancing job, I got this as a source code ? Really? Are you guys serious? Is this a joke?49
-
"We bought the source code for this tremendous app that does blah blah blah "
"Cool, in which language is written?"
"Cobol"4 -
I'm your CEO
This is our monolithic full stack JavaScript Saas
This is our legacy code
And Welcome to jackass.1 -
!rant
Guys! I did it! Its possible!
My task was to extension a code in php. I wrote 100 lines of code and then it workes on first try without any errors!
This is a milestone!
Bill Gates is nothing against me!15 -
Was watching a Chinese movie and there's a scene where someone is getting hacked, and this is the fucking code that they are show as the "hacking code". How hard would it have been to find something more legitimate than this?
If I hadn't had a few $0.69 hamburgers from McDonald's today, I would be more upset.14 -
Sometimes looking back at your code for documentation reasons and you really ask yourself "wow, did I make this? this is fucking genius"4
-
This is actually an advice given to me:
"Only ever release your code on a Friday, preferably after 6pm. If you're not confident enough to do that, your code is not ready."
Who says dev doesn't require courage.2 -
!rant
My girlfriend sat on my lap the other day when I was helping a friend of mine with some assembly code. She look at the code an said
What are you doing?
I explained the code and said that is the lowest you can get before machine code. She didn't run away in fear....
This is a great sign...6 -
This was an answer to the StackOverflow question, "What is the best comment in source code you have ever encountered?"2
-
One of my colleagues at work has cooked up this amazing amazing method.. and guys brace yourself.. This code is on production..17
-
Me: Listen dude, the code worked perfectly and all the test cases passed so I'm done here.
Also me: What is this? What the fuck is this? Why does this work? What witchcraft is this?
*Screams internally*1 -
I see this is true.
I am learning software development I understand what the code does but the most difficult part is to think and think and think what code to implement and how you're going to code it to make the program work.6 -
There is code reuse and then there is stupidity. This npm module has 4 dependents and 2 dependencies.18
-
Me (refactoring bosses code):
Is this worth it?
let me work it...
I'll put this thing down, flip it, and reverse it
Boss:
did you just Missy Eliot my code?
Me:
Ti esrever dna ti pilf nwod gniht ym tup I1 -
The worst feeling is writing so many lines of code knowing you could do it in a more concise way if you just had time to think about it but you don't.1
-
Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
So far, this is my inspiration to refactoring the code right after it works as gift to my future self.8 -
I code, watch Big Bang Theory, sip coffee, and code again. I never leave the doorsteps except for my classes. Some say my life is sad.
Is it? Anyone out there like this?18 -
Does anyone else get so self conscious about writing neat, clean and efficient code that you get demotivated because you always think "there's a better way to do this".
The cleanest code is no code at all. 😂8 -
Debugging vb code written by someone else, on a lagging remote desktop connection
I guess this is the peak of legacy code8 -
Once I got zero in an exam just because I chose to make a function for a piece of code I had to use repeatedly. I went to my lab teacher and asked her what was wrong about my code to which she replied "This code is wrong because there should not be this function in this class". She was our lab instructor and turned out she marked us by matching our code with code given to her by our lecturer. I quietly returned to my seat and started thinking about how did she get this job.8
-
"...the way he has written the code, it feels nasty man. I would have done it this way..."
Fuck you and your feelings. If you think my code is bad, give justification for it. Explain the fucking reason. Stop saying it "feels" like a bad code.
Fucking tired of this mentality in most of the developers. Why is it that the moment you look at someone else's code, you feel like you would have written it better. Programming is problem solving. And you can solve a problem in couple of different way.
If the code is absolute shit, has followed no best practices then yeah, go ahead and call it a bad code. But just because you would have moved some lines here and there, that doesn't mean the other persons code is horrible.
Goddamit!13 -
The most incompetent co-worker is that idiot who wrote this piece of crappy code! Oh wait, that's me!1
-
We study a lot to learn how to write code and the most satisfying thing in this profession is to delete code.3
-
The best part about solving problems in code is there is no one right answer.
Except for this. This is clearly the wrong way. This is garbage and you are a garbage person for writing it. This code you wrote is the reason your own children will never love you.1 -
That moment when the you actually think that this huge refactoring isn't worth it, but you do it anyway so you can live with yourself...
Code quality is love. Code quality is life.1 -
Is a code truly tested until it has print("Fuck this"), print("Fuck that"), print("Fuck you"), print("Fuck me") spread along every code path?8
-
Just tested my GPU code vs my non-GPU code.
Its a simple game of life implementation. My test is on a 80 x 40 grid running for 100,000 cycles.
The normal code took 117 seconds.
The CUDA code took 2 seconds.
Holy fuck this is terrifying.3 -
How to avoid haters on Stackoverflow:
1. Add this before your code: "Try the following:"
2. Profit!
Exact same code, but one is hated11 -
I often times write code and think to myself "I don't have to comment this, it's obvious what is going on", only to find myself back at the same code, figuring out wtf it does...1
-
I write blocks of code like this:
If(condition){
code
}
I'm trying to fix a bug and the previous dev is doing it like this:
If(condition)
{
code
}
Does anyone know any good nerve calming pill ? 😜19 -
I've found this beauty in our company's legacy code.
The main doubt is: is that possible have the required strength to refactoring this 💩?22 -
Try this code in JS:
++[[]][+[]]+[+[]]
This is valid and returns the string "10" in JavaScript :)))
Source: in comment👇5 -
Any frontend developer who can code backend system too?
Ps: this is just a meme please don't get serious, mates.14 -
Do you know what i hate most?
... commented old code!
What is the fucking purpose to comment old code IF YOU ARE USING A VERSION CONTROL SYSTEM?????
Commented old code is shit, because it fucks the readibility! I saw entire class full of this shit!
DELETE IT, YOU DON'T LOSE IT YOU MORON!!!!5 -
Signed up for a coding contest that starts at 9am. I’m bad at timed code challenges, but I’ll never get better if I don’t push myself.
Woke up in a panic, thinking I’d overslept... 1.5 hours after falling asleep.
This is definitely not going to help matters. Thanks, brain.10 -
So he is in the “elite” team as a “Sr” dev and i’m in the normal team as a ssr dev.
He: Hey look, the ‘F’ case is empty and doesn’t return anything, can you help me? This is some old code and we have to add some features.
Code:
Switch(string) {
case “J”:
case “F”:
cade “D”:
// some code
break;
// more code
}
I’m crying9 -
Found this in a code base I just started to work with. I'm glad it wasn't referenced anywhere. This is going to be fun...4
-
Refactoring someone else's code (the dude's a senior).
I'm a junior, just updated my linkedin, burnout activated, I can't deal with this kind of shit no more.
Outro: this is the nicest piece of code from him, every other line of code just .... just.... D:14 -
This is next level shit...
My friend in college is always sending me his C code for debugging IN FUCKING .odt!!
He even highlights the syntax.5 -
Me: Hey man, this code looks horrible, let's move this to a function.
Co worker: don't worry, we will make it better later
Me (thinking): yeah for sure...6 -
Me: *rewrites chunk of code*
"Time to test this baby. This is gonna fail spectacularly"
Code: *works*
Me: "Fuck!"5 -
So I've been doing some code jobs now and recently they pushed me to a new level.
This company worked with some silly management app made in cpp which they asked me to edit a little bit giving it another style and some additional functions.
Day 1: this code is a mess.
Day 2: this code is a mess.
Day 3: how does this code even compile.
Day 4: I no longer have faith in humanity.
Day 5: I found my first comment (Yay?).
Day 16: I'm done.
Day 19: I got paid.
If you're making a project in cpp just like that dev you do deserve a punch in the throat.
No documentation, no comments, no patterns, just some thick pasta of poorly written code, names like fCalcAllTaxFilesSizeMB....
This haunts me for real.2 -
"Well this is Java, that's intelliJ"
-Guy in my CS class figuring out why my code works and his doesn't5 -
Same days you just need a duck.
Me: map.get(record.Id)
Code: null
Me: no, map.get(record.id)
Code: null
Me: let's grab this record from the map
Code: null
Me: what the flying fuck, take this fucking ID from this fucking RECORD and find it in THIS god forsaken map.
Code: null
Me:.......
Code: 😉
Duck: did it occur to you the ID exists only AFTER the map is created.
Me: you fucking wha..... oh I'm a dick head.7 -
Why do otherwise intelligent people think chatgpt code is a good idea if they don't know what the code does?
I am a bit in shock by this prospect. I asked about some lines of code that was using some templates I had not used before. The response was "I dunno, chatgpt." This person is really really smart. Yet deploying code that they don't understand completely. This seems dangerous and irresponsible. I ended up rewriting the function I had questions about. It was significantly shorter and didn't do a fuckton of copying strings around.
WTF is wrong with people? Are people afraid to think? Now I want to get out before this kind of shit becomes the norm.13 -
The whole Microsoft office suite is being rewritten in React.js
This. Is. Not. A. Joke.
This also includes Skype, Ms teams, all office programs on all platforms, AND, VS Code....
Guys, we have trully peaked... gg....11 -
This girl I don't even know much sent me this code. She is not a coder and has never written any code before by the way.
if(true)
{
temp=abhinav;
abhinav= v bad;
v bad= temp;
}
Is this what a modern day love note look like? 🤔🤔6 -
My first new year resolution for this 2017 is learn to do the f****ng unit test before implement the code3
-
Code reviewer keeps removing my comments saying, "This will only be read by other programmers, the code should speak for itself".
<hyperbole>
This is the exact opposite to back in uni where for every line of code they demanded 2 lines of comments!
</hyperbole>9 -
??????????????????? What??????
???? What???????
I couldnt solve a bug for hours.
Hours of googling.
Hours of mental trainwreck.
Hours of stress.
1:28 am.
I cant solve it.
HOLD ON I HAVE AN IDEA.
ChatGPT AI. HELP ME.
i copy and pasted the part of code thats bugging me. Keep in mind that this is a VERY large and robust system and this is just tiny percentage of code.
I told the AI to help me fix this shit bug.
ChatGPT literally explained me what the bug is as if im retarded and wrote code how to fix it.
LOOK AT THE SCREENSHOT U CANT EVEN MAKE THIS SHIT UP
HOW????18 -
Is it possible to provide feedback on a colleague's code, without him/her getting offended? I haven't figured this out yet..9
-
this cat always accompany our developers day and night.
he is a cat-code!
may god bless him health2 -
Meeting yesterday:
Senior E: "Man, every time I do code review I thought this is the stupidest code ever written - then I look at the author, oh wait it's me"
Me: "Well, the perfect code is the code never gets written"
SE: "Casting appreciative look with a nod" -
Account manager: "We somehow managed to take unmaintainable spaghetti code for money again. This is a great opportunity for you."3
-
Found this in a code review today.
Technically, I guess, that is one way to fix a divide by zero error.14 -
I'll never ever understand how my boss always ends up doing this kind of bullshit
This is production code, there won't ever be anything in there, NEVER9 -
This is the code to hack into a GPS-Navigation. Taken from the Netflix-series "Designated Survivor".8
-
Code it in binary
(My friend claims to code in binary, is this an actually applicable thing or just a novelty thing to impress people?)17 -
Got an assignment for my OOP class, looked at it, laughed, "haha this is baby stuff I could code this by farting on the keyboard"
Wrote 400 lines of code without debugging
🙃.... Why do I do this to myself?3 -
Client code:
neat, organized easy to interpret
Server code:
da fuq is this? da fuq is that? what does this do?
People who cant see the code:
client's
People who can see the code:
THE GUY WHO IS WORKING ON THE SERVER!4 -
Learned a new word here in devRant: sleep code.
Code that's is written where you hardly can get an eye open.
Crazy shit 😵
Edit: Yeah, I count sleep code as one word (or phrase if this will satisfy you before commenting)11 -
VS Code stories are here.
I'm not making this up, there is now an extension for VS Code that brings instagram-style stories to your editor
https://marketplace.visualstudio.com/...15 -
My wife is starting to learn how to code. Now is finally understanding when I say this function will be over when is over.
-
You know u have no life when you get a call, you're all excited about who's it going to be...
"oooh an unknown number!"
*picks up*
"who's this?"
... *automated voice* "This is apple calling you for your apple verification code... your code is..."
And u realize u have ur computer on which u need to enter your code because u tried to login 2 minutes ago...2 -
what is your favourite quote for programming?
This is mine :Truth can only be found in one place: the code.4 -
#FuckPHPInTheAss
>Start working on PHP after ages.
>Found that mail() is deprecated through server support
>they suggest to use PEAR Mail
>Suggest to use deprecated PEAR code
>Fix deprecated code and magically runs on localhost
>ohmygodyess.php
>try to run on server
>fuckMyLife.exe
>Try using PHPMailer
>WTF is this How the fuck this works?
>Spends hours to understand with example code
>WorksFinOnLocal.exe
>NopeIWon'tRunOnServe.lulz
>about to use YiiMailer.
#Sleepless24 -
*code reviewing someone's work*
OMG! if-statements within if-statements! This is an IFception! *prays*4 -
This is a good Experience -
I used to go to a class to learn C++(was a kid back then).
One of the sir there told me -
"Anybody can write code,just knowing coding is not enough,idea is more important.You should have good ideas and solutions,you can alaways find people to code for you"
This has stuck with me till this day.1 -
If you comment your code like this, I'd like you to rethink your life choices.
This is a project we need to work on in university. The code was given to us.4 -
I have been trying to understand why my student's code isn't working just to find this piece of code. Checking out code early in the morning is definitely not my thing.3
-
What kind of cancerous shit is this? Who the fuck writes special template file for CLOSING divs? Why is this crappy shitty system so popular? It is a bunch of quirky and tangled code written randomly all over the folder.. Wtf seriously, is this "modern coding" or am I missing something?6
-
This is my first rant! I feel this every time I flag each function on my code looking for my mistake and still doesn't work:3
-
Typical code life?
1. Write rough comments
2. Write more detailed comments
3. Write pseudo code
4. Write semi-working but definitely ugly code
5. Write working but very ugly code
6. Refactor the code to be nicer, check for patterns, bottlenecks and other bits and pieces
7. Push to git the "final" code
8. After few months blame whoever wrote the code
9. Refactor all the things!
---
This happened in my career more than once and still - it seems like the best option out there to get things done. What do you guys think? Should something be added/removed from this? Is this over-complicated or what?2 -
Is it normal for seniors to talk to juniors with disrespect if they made something wrong in code?
this is my first time job ever and I feel like this behavior is so weird honestly.13 -
Had to look into some old code today and had the "Is this my code?! This can't be my code!? No one else worked on this code, so it must be mine... But, but, it's so... good! And clean! And logical! And well documented! This can't be mine... Can it!? Hey! It works!" moment.2
-
Hey guys, wanna see some spaghetti code? This is some parts of Yandere Simulator. More in comments6
-
I can't stand this JS is sooo fast bullshit anymore. You just suck at coding if your code with the most other languages is significantly slower.11
-
Looking at anyone else's code in things I use. I just think to myself "damn this is so neat and structured, I've never made something like this"1
-
When you find this in the PHP code:
if(condition) {
// code
} else {
die('horrible death');
}
Cheers to the fellow devRanter who added it and also to whoever is going to get to "else" part :D1 -
In the middle of coding: "Too into code to document properly. Will document later."
Two weeks later:"What the actual fuck is this code doing?"2 -
This fucking guy create a mess of a code, more than a spaghetti code, a clusterfuck of shit untested spaghetti code, and the project is actually getting well, our customer is getting bigger but everytime there is something to be added, its a fucking pain to add, and when something breaks, almost every thin breaks, and the shitty guy who wrote this code is quitting and its fucking up to me to clean up all the fucking mess, fucking asshole.
DOCUMENT AND TEST YOUR CODE KID, DONT BE A FUCKING SPAGHETTI PROGRAMMER7 -
going over some old code in the project...
thinking what garbage is this?
oh oh it was junior me :(5 -
6 Months later...
Me: Oh God! This code is horrible! Who wrote this crap?
Also Me: Shit, it was me.1 -
Finding comments in legacy code like "too tired, fuck you" or "this implementation is dirtyyyyyy" makes me wanna punch a dev.5
-
this is my legacy code, it's stupid, Change my mind.
a large number of lecturer and friends are against my thought. personally, i think this kind of code is told to be an OOP yet this is against the OOP concept. why ? first you assign the field to be private, but you implement Getter and Setter method later on, this is the same if you assign the field to be public in the first place.
another minor thing; yes this is old me, i use Bahasa Indonesia as a variable name.31 -
From a few years of programming experience, I come to know that "we cannot write perfect code."
What I mean by this is no matter how perfectly you write code, but if you have a peek on that code after about 3 months, you will be like, "I could have done a lot of things in a better way." Provided the code is atleast of 100 lines. -
Wow, this code someone wrote a while back is really great. Words never uttered by anyone that meant it.1
-
This post is now dedicated for a comment debate with the topic "Is Visual Studio Code an IDE?"
I 'll see myself out. Make the comments rain8 -
me: Today will be a productive code efficient day
also me: what is diz devRant
then me: man this is lit
*fml*8 -
5 years ago in Texas. There is shit code and then there's SHIT code. I know I can produce bad code and often do, but that codebase was an eldritch abomination.
Just to give you a tiny taste, variables in JS would usually be called "that" because "when calling them, I send the 'this' value right? So in the other function it is 'that'". I wish I was making this up. And this is nothing compared to everything else.12 -
So I'm writing this code, that does 2 important things, that cannot be seperated. I run the code, thing1 is correctly executed, thing2 not. No fucking idea, why this happens. Execute again, same result. Debugg the wohle thing, now everything works fine.
WHAT?
I check the code, there are no background tasks, no paralell processing, nothing that should go wrong.
Asking a Senior developer for help, he also has no fucking idea. He tells me to try to wait one second between the two things. Looking for a delay() or wait() function in my programming language but there is none. Ok, building my own delay, writing a "do 1000 times" loop, calculate some shit in it. Execute the code, it works perfectly.
Nobody has a fucking idea, why this is happening and why this solution is working, but now the code is productive and it works fine.9 -
I think this is the first time ever on my team where I read someone else's source code and actually went "wow... This is pretty well written and structured". No god methods or classes.
-
And then, looking for the source of a bug in the code .... I randomly found this:
public bool IsOperationStarted { get; set; }
public bool IsOperationStartedTrue
{
get { return IsOperationStarted == true; }
}
public bool IsOperationStartedFalse
{
get { return IsOperationStarted == false; }
}4 -
This is very long along. Senior Developer was doing my code and telling the best way to write jQuery and PHP codes.
The funny part is that he doesn't know anything about PHP and whatever jQuery code he told me to correct was very shitty and difficult to maintain.
That's when I knew. This world is fucked up!3 -
If the package.json is longer than your actual code this maybe shouldnt be a package. Just saying.1
-
When it comes to nervewrecking situations, what I've encountered so far is a pull request for which the 2 reviewers had opposite opinions.
Something like this:
* opens pull request *
reviewer 1: "update using approach A"
* updates code *
reviewer 2: "this is wrong, change to approach B"
* updates code again *
reviewer 1: "this isn't what i asked for, i'm rejecting your PR"
Oh, also, each of them had their own set of coding standards.
What was your most challenging situation when writing code?1 -
Dev: Woah look at this code! I might be a genius!
Also dev a few months later: Woah WTH is this shit? Was I totally dumb or what?2 -
Nothing is more awesome than having a wife who herself is a coder.
*yay*
*hey, can you debug this code for me?*
*No? :| Okay*4 -
So I'm at a hospital (everything is fine as long as I'm concerned) and there's this pregnancy sign... But it just hit me (not sure how to start this idea) sex is this amazing interaction between softwares so good and well coded that we already know what can create, not only that but the hardware (with some flaws here and there) makes such great UX! Seriously, the join of code (one of the hardest code I know) to make a better code and the interaction thanks to the hardware is great! Thoughts?10
-
You all know that these AI dev tools are reading your code right?
It is sending it back to a data center and doing evaluations on the code. This is like handing your code to an unknown entity with no guarantees for privacy or copyright protection.
This concept bothers me and I would have to consult with my employer to even determine if we wanted to take that risk. I think it is just a matter of time before a bad actor takes advantage of this and rips off a company somewhere.8 -
So I'm approaching a 8 year anniversary working in IT and this feels like the first time needing to do a serious rant.
Today I've come across some code (infact just a single line) written by another company that is so fucking fundamentally stupid that they should be banned from writing any code ever. Like holy fuck.
This is textbook examples of shit never to do ever in any fucking environment or intranet/extranet etc. What the fuck. The fucking muppetry involved in this. This is what they teach novice programmers - you see this code written 20 years ago? Never fucking do this. You see this company that went bust 10 years ago? It was because of shit like this. Never ever write code like this or your 90kg ass will be thrown 300m by the greatest medieval fucking siege engine ever created after we throw you through the catastrophic gaping hole in time and space that your line of code just created.
Fucking fuckity bye.3 -
If you think your legacy code is bad - this is what I came across in a system I'm refactoring this morning... and this isn't even the bug I was looking for.1
-
Legit my only answer to fixing shit code for a nursing app at work is.....
Writing more shit code. Man the dude that developed this before had 0 clue what he was doing.....and because shit grew out of control there is shitcode everywhere.
I like writing shit code though. It is good practice.
Writing shit code without knowing is one thing. You really do reach expert level when you write shit code WHILE being fully aware of it.1 -
Today, i discovered thus beauty within our legacy code:
// TODO: this is probably the most dirty thing in our product. It needs a model more than anything else
This captions a crappy part of controller code for several years :/ -
Trying to understand other people's code like:
- 6 README, in total 7 lines (that's all there is for documentation)
- 40% of code is commentary like (original code, not altered...)
// if(a = b)
// c = d; // this is not working -
Soon to finish my CompSci degree and already have been invited to relatives for dinner... And IT-support...
(They had statically set their NAS to the same IP as the router and lost it)
I guess its time to prepare for the onslaught of screw-ups I'll be asked to fix.5 -
Me: Gets my friends code and opens it on Eclipse to study it
Me: Sees code and tries to study it and actually understands it
Inner me: (OCD kicks in and realizes code is not formatted well)
Me: alt + shift + f
Code format changes
Me: how the fuck does this work now5 -
A colleague is walking me trough some of the source code because we try to fix an issue.
colleague: Oh we don't use this anymore
Me: ...
LATER
colleague: This part we should refactor someday
Me: ...
LATER
colleague: Oh I think this is old code and does not exist anymore.
Me: .. .. ...
Great Colleague BTW :)
PS: fix will be posted Later.3 -
Contest is over. I accidentally submitted broken code at the last minute so this is my unofficial placement.1
-
Why do popular media paint "programming" as easy... this is a very big deciet. please let stop this lies.
programming is not for everyone, not everybody can code.
and please dump the f**king "Girls can code" slogan.
there is no need for the hype.13 -
So, I was fixing some code today, and stumbled upon this. Is it just me, or is this really an example of bad bad practice...? And, no, there was nothing to be executed after this function was called.6
-
Anyone here knows whether this is valid?
This is the default code for a new Visual Studio C++ Console Project.20 -
If the code is running, then it must be doing what I want. Right guys? Is it normal to be this paranoid even after lots of runs of the code without crashing?2
-
I slightly changed the color of a label on a WinForms app...and broke everything.
Why the fuck would anyone code logic that is dependent on the exact color of a control.
This code is a train wreck.6 -
<html> <script> alert("Hello World"); </script> </html>
This will be my first line of code which is actually being used by users.
But is HTML it even code?2 -
Literally came across the third line of code and made this meme.
To top it off, the if statement looked like this:
if ([that ugly code])
{ //it is
...
}
This is coding at its finest....2 -
I know that this isn't the place to ask questions like this. Anyway, is there a easier way to do this? This code updates my age on my birthday. Also, first attempt to make anything in JS :)8
-
Sometimes code is correct but so wrong. Came across this in a kotlin PR today
If (thing != null && thing!!.field != null) {2 -
When having to fix parts from an other programmer's code, do NOT concentrate on the small code expected to be wrong, instead read and understand the whole program around it!
Best practice:
1) Why is this code here
2) What does this code do
3) How does the code solve the problem
(just happened to me 😅) -
Writing ugly code should be a capital offence. And oh, I should be the sole judge of what is an ugly code or not.
No, this punishment won’t apply to me, thanks for asking.5 -
The content of this file is called code or algorithm or instructions or coderithm or algode or instrude or algostruction2
-
Comments belong here on devRant, not in your code!
Code cleanly folks.
“Good code is its own best documentation. As you’re about to add a comment, ask yourself, ‘How can I improve the code so that this comment isn’t needed?'”
– Steve McConnell7 -
I'm not even done with this code and I am already dreading maintaining it. There is so much magic.1
-
This is just a sweet little harmless block of code, why should I unit test it?
3 months later...
Bug in production : This is why. -
Spent 2h debugging code until I realize that code is good, but written in a .coffee file... Instead of ._coffee. Yes,it changes the way code is executed. Wtf happened to this world.
-
This is how my coworker does code reviews... imagine comment on a line of code:
"Oh why does this not do this and that.
Edit: Oh I've read few lines below, now I understand. But this may break when this and that.
Edit: Nevermind I realized, that never happens, forget about it."
Let me just emphasise, that this is single comment, so it's basically editted multiple times, before submition.
Like wtf, just delete the comment then?!2 -
I just realized that in my company , the code review is not important.... And the source code is fucked up.... The structure is like functional programming and Oop combine with redundant function everywhere.
And in the source code there's a folder called depreciating service , I asked them what is that , they told me it is the service previously but not recommended for using it.
I was like "you mean deprecated"? Omg
They don't care about code review and clean code here.
My struggle here is they dare to create one class for the entire project and every code are in that class...
This is fucking not acceptable. -
Not sure what is going to be worse. Fixing the bug in this code. Or removing all of the code I added in the name of finding the bug in this code. I have found myself asking myself why I chose coding when I come have picked something less stressful. Like flaming bull fighting.
-
The moment when your code is like,
Yeah I'm working, not throwing errors, but not doing anything closely related to the things I should do.
Fuck this construct, I'll recode the whole thing and stop using any two-year old legacy code, for this project -
I submit all my code changes to the integration stream. Co worker integrates my code removes all my changes that breaks his hacky crap. Then complains his stuff doesn't work. I ask him why he he did not conform to the requirments says cause this is what worked before. I look at code see he assigns a value in the message to zero. I ask ever so politely why he is changing the incomming messages. He says this is what works. I Then send an email to him telling him this in an error. He reply saying this it what works. At stand up he complains and says no messages are getting through it doesn't work. The team tells him to revert to the original code. (My code) and update his code after two days of emails to bosses and complaining he reports it works with my code after he is done. He is the senior senior chief grand Pooba and makes more money than me.
-
It's been four years. It is time.
My nickname is a pun. There was this thing called “bouba/kiki effect” that demonstrated the linguistic perception of two MEANINGLESS words. So, I jokingly made them mean something. What's the most primitive, most basic meaning imaginable? Yes, it's “good” and “bad”. So, “kiki” is “good”, and “bouba” is “bad”. Done.
My code is straight up kiki.
Your code is always bouba.
Here's where it all started: https://devrant.com/rants/2981477/...15 -
So my friend had an idea for a game and asked me if I could help him develop it. Now, he understands how the code works and can even write quite a bit himself. On several occasions (including today) this happened:
*writes code*
*tests code*
Me: Hmm... this isn't working like it's supposed to
Friend: It looks pretty good, maybe check to see if everything is in the right order
*checks code*
*tries alternative solution*
*checks again*
Me and friend: Well this is even worse than before
*presses ctrl+z a lot to go back to the original*
*opens new project*
*writes new code for same purpose*
*checks code*
Both of us: IT WORKS!!!
*checks again just to be sure*
Both of us: IT STILL WORKS!!!
*compares new code to original code*
Me: It's the exact same code with different variable names!!! Why did this not work before?
Friend: No idea
*puts new code into main program*
*it still doesn't work*
Reasons Java makes me cry sometimes4 -
Am I the only one missing ``` // some code ``` backticks/tags (the ones that convert wrapped text to monospace code) here? @trogus -- Since this is a dev-oriented community.. could this be an area to improve devRant?2
-
So a Buggy production code caused data discrepency. This is fixed, and now the only task left is cleaning up the data, and this will be in my backlog forever.
-
This is how I deal with React Native not wanting to upgrade their code from componentWillReceiveProps to getDerivedStateFromProps. 🚀😅6
-
Something I hate about working in the team is that the code reviewer will stall the time and leave a lot of pull requests unreviewed. As more code changes more commits and more pull requests.
The code base is conflicting with each other, what the fuck? I hate this.5 -
I'm in Paris this weekend, with some other developer friends!! Who is in for a Meetup!!! Let's talk code/rants!!
-
Have some downtime today, so since I lucked out and found some old backups (from before I used Git) of a project I was planning on revisiting, I decided to fire it up and see what I can do to get that going again.
And discovering just how much my coding style has changed since then...
[Code is in PHP, for reference]
* Virtually no documentation (whereas my current style is near-obsessive with PHPdoc blocks)
* Where comments exist, they only use // and are a full tab after the end of the line
* All assignment operators are dutifully aligned on tabs
* Have to update the entire codebase because it relies on deprecated `mysql_*` calls
* Have to flip all of the quotes throughout the codebase because I used double-quotes as my primary at the time instead of single quotes.
* Also relied on magic quotes for injecting variable content into strings
* Associative array practices varied; sometimes the names are encased in double quotes, but I just hit a block where it's all leaving it to the compiler to interpret unquoted string literals
And perhaps the most egregious so far...
* Any time we get database results back the process for cycling through them is to do `$count = mysql_num_rows($result);` (or $count2, etc.), then do a `for ($i = 0; $i < $count; $i++)` (again, or $j, $k, etc.), instead of just a simple `while ($data = $result->fetch_assoc())`2 -
Q - What is more frustrating than the code that won't compile?
A - Boss who is constantly asking you to compile this code.
- as quoted by @GoDmode1 -
I don't think this question is formal enough to ask on SO. So I'll just ask it on here.
I'm pretty sure I've committed several development felonies in this code, but is there an easier way to manage multiple textviews that are similar to each other in this code? https://github.com/BaconatorNoVeg/... -
Started new job and they say...yeah we like to refrain from using third party code...look in source code and half the code is using third party plugins...so does that mean they are starting this logic today??? *confused*2
-
So another infamous code (or smart code) you decide, there's class 'error' in the template/html and here this genius is removing it and adding it back? is this even logical at any level,
I mean just hide() and show() would do the job6 -
One of the barriers to professional software development is OCD.
Is this code right? No, fix. Wait, no, still not right.
Did I just commit this? Check again.. did jira reload properly? Wait, checking again, did I commit this? Checking. Did I commit this? Checking. Is my mind fooling me about committing this? Checking.
while(true){
goCrazy();
}2 -
I Was just improving the login system for one of my projects built
with angularjs and php last night and now this morning I find my one eye has an infection and everything I see with that eye is blurry.fml4 -
Why the fuck...!
Wrote code to import a spreadsheet... A "class code" field is in there to define the the product category... But when no products matching I find that the number is the result of a concatenation, one half of which is not in this file...
Just... Why... ?!?!?! -
Fuck fuck fuck. Joined a new gig. Been a week and today saw code which did something like this: .append(“<style>.add{}”)
FML! And this is a react app. -
FFS,
Team have a release candidate of code ready for a deployment but because a dev added functionality them deem should only be released in two weeks we have to cherry pick this chunk of code out,
yes other code now depends on this and is affecting lots,
FML wanker customer/QA team,
be happy that you are getting functionality early. -
Alright so this guy is arguing with me about programming, saying that I don't understand how a compiler works because I said that computers parse code when executing it. He says I'm wrong because the code is in machine language. Who is correct?4
-
Fuck this shit
I’m interning at this place and the code is ALL OVER THE PLACE. I have to rewrite every damn function and the code base is so obfuscated and stupid on multiple levels. I’m sick of this shit and literally every damn thing needs to be rewritten from scratch2 -
Found this in a book and i can tell you that wtfs/min is the most effective code quality measurement technique programmers have known to this day! xD
(Book: Clean code Robert C.Martin)4 -
i once explored our codebase and copied every line of commented out code into a text file. that file is over 350 lines long.1
-
Visual Studio has been one of my all time favorite text editors. This is Visual Studio Code Extensions Setup what I use.
https://roogen.com/visual-studio-co...5 -
All those code-ish new year celebrations in this community are cringy. This is why women dont find you attractive.18
-
This comes up when I search on Google 'what is code' lol this looks like a bob the builder remake all about code
-
Always comment your code.
Write comments that explain the reason for this piece of code existing, and why it's written the way it is.
Don't write comments that explain what your code does (unless it's a comment which is going to be parsed as documentation for an API). If your code needs comments to explain what it's doing, you need to write clearer code. -
Cheese and crackers this is the worst code I’ve ever seen... i hated visual basic before but when it’s written by incompetent devs it’s 1000 times worse. Brb going to go tear my eyes out before trying to debug this shit code.3
-
This code is so horrible I'm too scared to even fix bugs.
No I did not write this code originally.1 -
This is literally a line of code from this PHP codebase. w h y
$_POST = unserialize ( $_SESSION ['nyt_form'] );4 -
Oh boy, I just made a class with 5 methods and 10111 lines.
I'm "proud" of myself
(It's kind of an autogenerated class for, but nah...)2 -
Fri-damn-day is here in next 4 hours, prototype is to be delivered before 5 pm, 3 big core functionalities are yet to be made , all code is hanging by the null checks due to leaking firebase callbacks and all comes down to this intern who has been giving 19 hours every day to this project for last full week.
Well, bring it on!! I am about to gloriously fail (unless i code some miraculous code that i don't even know how), but i have never been this much motivated to work or received this much support by seniors ;)2 -
A senior dev wrote spaghetti code containing business logic in the fucking controller with some code repeated in a couple of other places.
This is when a facepalm is not enough.1 -
Damnit onion, this is a little on the nose. But hey, code complete is always worth reading.
https://theonion.com/hopefully-neig... -
There are just those days where nothing seems to work. I am now 8 hours on an issue that was estimated for 3 hours and new issues pop up every time where its not even my fault. In one instance, I get the correct value back, the next time with exactly the same parameters I get a COMPLETELY different Value back which keeps crashing my code. Who coded this thing that it is so inconsistent. Starts to get REALLY annoying. ._.1
-
This is proper version control, right?
((btw: vs code is wonderful idk why i never tried it out before now)) -
i was wondering Is it true when people do drugs they code alot better?
All where I see this concept.6 -
Reading devRant and new job postings is leaving me with less time to write any code in this shit hole.
-
Noob question
Is it better to implement a cryptpgraphic algo in a function or in a class? Also how?
More info:
I have a cryptography class and I really enjoy implementing the different techniques that we study in class. At first I was just implementing the techniques in a simple function with 3 parameters; key, message and a bool for encryption or decryption. But as they are getting more complex, it is becoming harder to continue implementing them in a single function block. So I thought of using a class but ran into the problem of how do I even do that? Do I make different methods for key generation, encrypting and decrypting?
P.S. It's really just for learning how the crypto technique works and not for anything serious.12 -
At the place where I am interning right now, most QAs that file bugs are running code that is nearly 6 months old. 95% of the bugs they file don't exist anymore in the current code -_-
This is in spite of testing environments available with the latest code deployed :/ They just refuse to use them!1 -
Reading code and getting that face palm moment
String code = customer.getCode();
customer.setAccount("foo");
customer.setGroup("bar");
customer.setCode("new code");
Ok this is preparing the customer obj makes sence.
Some 20 lines later
customer.setCode(code);...... Wtf1 -
Only God can refactor this code.
I wish I knew who wrote this. 😬
App.jsx is doomed, looks like the content of jquery.min.js.
4:04 sleep not found. -
When people use comments for build configuration. And don't put down handy comments like "uncomment this if you want to do that".
I guess what I'm saying is that this "code cleanup" task is turning into a "code keep the bloated baseline" task.3 -
Is it me or is this code seem unnecessarily complicated?
This is a queue I have used myself:
https://github.com/Demolishun/...
This is a queue I ran across:
https://github.com/cameron314/...
I understand the second link shows a queue that does a LOT more than the first example. It supports multiple produce/consumers for instance. It is also lock free. However, it seems really complicated to me. I was always under the impression that the more code you write the harder it is to maintain.2 -
Ooh this project.. So I was put in charge of creating new pages, and general maintenance as the site was already built by a previous dev on the team before i joined the company. I take a look at the design, fairly strange forward quick analysis most of it bootstrapable, some custom code is needed for some parts so no issues there.
Looks at the code, only the bootstrap grid system is being used, the rest is custom code, an additional 9K lines of CSS and 526 lines of JS. What the hell is this.2 -
Tried out the node.js code demo in this book.
🤦♂️
Terrible format, use tab for indentation, very very long function, redundant code (eg: new Buffer vulnerability)...
The major issue is none of the total.js nosql code works. Eg:
db.clear()
db.insert({...data})
Without any asynchronous call, how do you expect this to work?!
Just fixed the code and updated npm modules for demos in Chapter 3 btw... Took way longer than expected.3 -
Don't know how to frame this question.
Do you think a perfect code to a solution is possible?
PS: A production level code.6 -
Even when the code is right, it's wrong. Like when you are fixing bugs:
"damn, this variable doesn't look like it belongs in this part of the code", but when you look further into it you see that is correct and you continue with the bug and have no idea what the next step should be.1 -
We need a running theme for topics that treat "the code" as if it is a living thing. Like we never stop to think about what The Code thinks about all this.1
-
i had this crazy dream that there's a code ghost that erases the blocks of code i wrote and produces bugs to my programs... damn this is the first time i got really scared.
-
Code base is full of /*bug fix - XXXX */ coments, sometimes it feels the software is a Bugenstein's Monster!!
Not sure if this kind of comments serve any real purpose...
Commented old code is a more familiar monster; but that's a tale for another day. -
rant.author != this
Christ people. This is just sh*t.
The conflict I get is due to stupid new gcc header file crap. But what
makes me upset is that the crap is for completely bogus reasons.
This is the old code in net/ipv6/ip6_output.c:
mtu -= hlen + sizeof(struct frag_hdr);
and this is the new "improved" code that uses fancy stuff that wants
magical built-in compiler support and has silly wrapper functions for
when it doesn't exist:
if (overflow_usub(mtu, hlen + sizeof(struct frag_hdr), &mtu) ||
mtu <= 7)
goto fail_toobig;
and anybody who thinks that the above is
(a) legible
(b) efficient (even with the magical compiler support)
(c) particularly safe
is just incompetent and out to lunch.
The above code is sh*t, and it generates shit code. It looks bad, and
there's no reason for it.
The code could *easily* have been done with just a single and
understandable conditional, and the compiler would actually have
generated better code, and the code would look better and more
understandable. Why is this not
if (mtu < hlen + sizeof(struct frag_hdr) + 8)
goto fail_toobig;
mtu -= hlen + sizeof(struct frag_hdr);
which is the same number of lines, doesn't use crazy helper functions
that nobody knows what they do, and is much more obvious what it
actually does.
I guarantee that the second more obvious version is easier to read and
understand. Does anybody really want to dispute this?
Really. Give me *one* reason why it was written in that idiotic way
with two different conditionals, and a shiny new nonstandard function
that wants particular compiler support to generate even half-way sane
code, and even then generates worse code? A shiny function that we
have never ever needed anywhere else, and that is just
compiler-masturbation.
And yes, you still could have overflow issues if the whole "hlen +
xyz" expression overflows, but quite frankly, the "overflow_usub()"
code had that too. So if you worry about that, then you damn well
didn't do the right thing to begin with.
So I really see no reason for this kind of complete idiotic crap.
Tell me why. Because I'm not pulling this kind of completely insane
stuff that generates conflicts at rc7 time, and that seems to have
absolutely no reason for being anm idiotic unreadable mess.
The code seems *designed* to use that new "overflow_usub()" code. It
seems to be an excuse to use that function.
And it's a f*cking bad excuse for that braindamage.
I'm sorry, but we don't add idiotic new interfaces like this for
idiotic new code like that.
Yes, yes, if this had stayed inside the network layer I would never
have noticed. But since I *did* notice, I really don't want to pull
this. In fact, I want to make it clear to *everybody* that code like
this is completely unacceptable. Anybody who thinks that code like
this is "safe" and "secure" because it uses fancy overflow detection
functions is so far out to lunch that it's not even funny. All this
kind of crap does is to make the code a unreadable mess with code that
no sane person will ever really understand what it actually does.
Get rid of it. And I don't *ever* want to see that shit again. -
Since the COVID19 outbreak when i'm about to work on some legacy code i always use a mask, since this type of code is in the risk group.
and flies away..... 😂 -
I have been writing unit test cases after writing the code. Not the other way around. I do not think this is TDD . Is it ATDD?
Should I keep going on with this?
Thoughts?8 -
God - this code is disgusting! Well, let me just try to change this one repo call to return an Optional...
"Hey! The app is broken! What did you do?!?!"
God dammit... -
I have a habit to comment every single line of code, this helps comprehension but this dirty the code and everyone complain. Is it any way to do such task.6
-
Going through code of a bluespec verilog core
This language is some jungle shit !!
is there any intuitive HDL exists or it’s just a myth3 -
GDB&Code::Blocks got drunk together and this is apparently normal now. For like an hour already.
I DIDN'T RUN ANY FUCKING CODE IN BETWEEN THESE COMMANDS WTF IS THE DEBUGGER DOING ????3 -
Dear provider, COULD YOU PLEASE SENT ME YOUR DSL INSTALLATION CODE BEFORE YOU TURN A COMPANYS INTERNET DOWN??? SRSLY this is the biggest bs. No phone no mail since 8am, new hardware won't work without this fkking code.
-
It seems Java on Linux runs slower than Windows... Same code takes about 2x longer to run. And well this code is for a batch job...
Does anyone have experience with JVM tuning/optimization or can confirm/disprove this is the case?23 -
Is huwaei insane for saying that 1 line of their harmonyos code can do 100 lines of android code. I watched this in a coldfusion video. Link :- https://youtube.com/watch/... , The line I mentioned is at 11:554
-
Mondays aren't the best time for me.
If it is a lazy weekend, this is the routine:
Sleep most of the morning in, wake up - do things, 10PM, think of some code to work on. 11PM, yeah, enough energy now - lets code! -
function customActions() {
changeActions(this);
}
Why? Why is this in the code I'm told to refactor?
What am I supposed to do with this?1 -
Coding on the right track is doesn't matter for those who really want to contribute, they decide first lets start code nor lets start code for this or that :/
-
Here is a list of 185+ no-code tools for you so that you can build your MVP quickly.
Bookmark this: https://zerobizz.com/p/...3 -
Recently every time I write some code I have the internal fear that this code sucks terribly and that I'm doing something wrong.
Is this some type of imposter syndrome?5 -
So as I rewrite the same code I’m
Reminded of why I’m rewriting the same code.
Screw you Colorado !
This rant is better indicative4