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 - "unorganized code"
-
So Taran from Linus Tech Tips posted his autohotkey code on twitter the other day and the amount of redirecting and includes is a little frustrating.1
-
My worst experience has actually been trying to fix someone else's code. One of my friends is in a graphic design class, and right now they have to do a basic site in DreamWeaver (a small nightmare on its own, I've found that the previews they show are never quite correct). I decided I'd at least pop in to help out a bit, cause they kinda have no clue what they're doing. They are graphic design students, NOT developers, and it's very easy to see that.
One of the first things I noticed was EXTREMELY unorganized code, but that's forgivable. But...I once saw probably 5 </body> tags in someone's code, a JavaScript function inside of the <body> tag, and a bunch of CSS statements in the <script> tag that they had one if the JS functions in.
I remember seeing this stuff, and I thought "what the actual fuck?". The dude was like "yeah it's unorganized as hell, I know"
...That's not the problem. CSS goes in either a <style> tag or a separate file (THEY HAD A SEPARATE CSS FILE). JAVASCRIPT GOES IN A <script> TAG OR A SEPARATE FILE
But, I get it. They're graphic design students. They can outdo me in probably everything in the Adobe suite (except DW as I learned). I once watched a girl in there do a project in Illustrator. I had no fucking clue what was going on. And when I was talking to her about it, she said "that's what I was thinking when we were watching you fix our code"
Kinda got a little sidetracked there. Basically, worst experience is non developers writing code for an assignment. -
As a developer with adhd, some days are just wasted and ends with the brain getting stack overflow from to much unorganized code and infinite callbacks 😂
$brain = new adhdBrain;
while($brain.energy > 0) {
$brain->checkSocialMedia();
$brain->work();
$brain->readNews();
$brain->getAngryWithSoundsInTheOffice();
$brain.energy--;
}
public function work() {
$brain->getAngryWithSoundsInTheOffice();
$brain->readNews();
$brain->code();
$brain->readEmail();
$brain.energy--;
}
public function getAngryWithSoundsInTheOffice() {
$brain->readEmail();
$brain->angry++;
$brain.energy--;
}
public function readEmail() {
$brain->work();
$brain->readNews();
$brain.energy--;
}
public function readNews() {
$brain->work();
$brain->getAngryWithSoundsInTheOffice();
$brain.energy--;
} -
confessions[0]
I got into hell and sinned there.
This was a few years back when I was getting into webdeb. I was working with WordPress at that time and a start-up asked me to help them build a website on WordPress through a mutal friend. That was my first WP site and it is a jungle of unorganized code. I didn't bother making a child theme, overwrote PHP files without documenting it and changed CSS in the orginal files. Instead of a child theme, I made a monster.
The worst part is, that site has never seen an update coz an update in WordPress would undo all my work. I should prolly burn the server the site is hosted on to purge my sins. -
I'm sitting here in the dark and can't program because no electricians are available... Right before a deadline...
I worked on refactoring my code for our University lab's project (I am the programmer assigned to it) for almost a week and managed to refactor most of my old and unorganized code. Today I finally had the chance to finish the job.
While everything was open I decided to charge my laptop (I work on a desktop) and the moment I plugged it in the room turned dark. I realized I just have to turn the fuse back on but of course all the fuses are on already. Appearantly that short-circuit fried my home's electrical framework somehow and because it's a weekend I can't get in touch with any electricians.
All my code was committed but not pushed so now I am stuck here before a deadline with no way to work...
tl;dr Because of a short-circuit I don't have any electricity and all my work is unpushed.3 -
Sometimes i feel really messy in my code and unorganized.
after a while i regret what i did and in order to fix this mess i re write the class all over again or i end in an endless errors which is time consuming.
So what's the best way to write a clean code in your opinion other than commenting and identation1