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 - "variable naming"
-
So... I just remembered a story that's perfect for devrant.
My brother got into engineering in university, and during the second semester they had their introductory class to programming. They had weekly homeworks that the lecturer would check and give grades accordingly.
The factors that could influence the grading were: execution (meaning that the code would excecute as intended), efficiency and readabilty. The weeks passed and everyone was doing well, getting fairly good grades. Everyone was happy.
Until one day a random guy we'll call bob got the worst grade possible. Bob wasn't a bad student. He had over-the-average grades in all the weekly homeworks and even impressed the professor in some. Naturally, he was baffled when he saw his grade on the google spreadsheet. He was pretty sure his code ran well. He always tested it on different machines and OSs. So, at the end of the class, he went straight to the helper of the class, in a pretty imperative manner, to demand to know how the fuck he got that grade. It's impossible he got excecution, efficiency and readabilty, wrong. All three wrong? Impossible. Even the stupidiest kid in the class had some points on readabilty.
"Oh, so you are Bob. Huh?" said the helper in a laid-back attitude. "Come with me. Prof. X is waiting for you in his office."
This got Bob even more confused. As they approached the office, the courage he had in a first moment banished and gave way for nervousness and fear.
The helper nocks the door. "Prof., Bobs here"
As soon as Bob sits in the chair in front of Prof. X's, he knew something bad was coming.
"In all these years of teaching..." said Prof. X hesitantly. "In all these years of teaching I have not come even close to see something similar to what you've done. You should be ashamed of yourself." Needless to say, Bob was panicked.
"In all these years I have not seen such blatant mockery!" added the professor. "HOW THE FUCK DID YOU EVEN DARE TO SEND A HOMEWORK WITH SUCH VARIABLE NAMING" That's when Bob realised the huge mistake he made. "NEVER IN ALL THESE YEARS I HAVE SEEN SOMEONE NAME HIS VARIABLES *opens the file on his desktop *: PENIS, SHIT, FUCKSHIT, GAYFUCKING<insert Prof. X's name>MAN, GOATSE, VAGINAVAR, CUMFUNCTION, [...]" The list of obcenities went on and on. In each word, the professor hit the table harder than the last time.
Turns out Bob felt so in comfort with the ease of the course he decided to spice things up by using "funny naming conventions" while coding, and then tidying everything up before uploading the homework. This week he forgot, and fucked it big time.
So remember folks, always check your code before committing/giving it in/production. And always adhere to naming conventions.9 -
In all honesty, if there was a course on giving variables good, informative and not completely stupid names... I would take it.13
-
Variable naming at its best...
Took only 2 hours to notice the difference between leftToRight and lefttoRight11 -
"How to name your variables and functions so they can be understood by other humans" should be a mandatory lesson right after someone writes their first ever computer program.15
-
This codebase reminds me of a large, rotting, barely-alive dromedary. Parts of it function quite well, but large swaths of it are necrotic, foul-smelling, and even rotted away. Were it healthy, it would still exude a terrible stench, and its temperament would easily match: If you managed to get near enough, it would spit and try to bite you.
Swaths of code are commented out -- entire classes simply don't exist anymore, and the ghosts of several-year-old methods still linger. Despite this, large and deprecated (yet uncommented) sections of the application depend on those undefined classes/methods. Navigating the codebase is akin to walking through a minefield: if you reference the wrong method on the wrong object... fatal exception. And being very new to this project, I have no idea what's live and what isn't.
The naming scheme doesn't help, either: it's impossible to know what's still functional without asking because nothing's marked. Instead, I've been working backwards from multiple points to try to find code paths between objects/events. I'm rarely successful.
Not only can I not tell what's live code and what's interactive death, the code itself is messy and awful. Don't get me wrong: it's solid. There's virtually no way to break it. But trying to understand it ... I feel like I'm looking at a huge, sprawling MC Escher landscape through a microscope. (No exaggeration: a magnifying glass would show a larger view that included paradoxes / dubious structures, and these are not readily apparent to me.)
It's also rife with bad practices. Terrible naming choices consisting of arbitrarily-placed acronyms, bad word choices, and simply inconsistent naming (hash vs hsh vs hs vs h). The indentation is a mix of spaces and tabs. There's magic numbers galore, and variable re-use -- not just local scope, but public methods on objects as well. I've also seen countless assignments within conditionals, and these are apparently intentional! The reasoning: to ensure the code only runs with non-falsey values. While that would indeed work, an early return/next is much clearer, and reduces indentation. It's just. reading through this makes me cringe or literally throw my hands up in frustration and exasperation.
Honestly though, I know why the code is so terrible, and I understand:
The architect/sole dev was new to coding -- I have 5-7 times his current experience -- and the project scope expanded significantly and extremely quickly, and also broke all of its foundation rules. Non-developers also dictated architecture, creating further mess. It's the stuff of nightmares. Looking at what he was able to accomplish, though, I'm impressed. Horrified at the details, but impressed with the whole.
This project is the epitome of "I wrote it quickly and just made it work."
Fortunately, he and I both agree that a rewrite is in order. but at 76k lines (without styling or configuration), it's quite the undertaking.
------
Amusing: after running the codebase through `wc`, it apparently sums to half the word count of "War and Peace"15 -
Shower Thought :
I wonder, in the future, since people is easily offended by everything, variable naming would be such a concern it'll be seriously implemented in the compiler, and be like
"Error at 16:1 NamingConventionError : 'fuckThis' is not linear with our guidelines"6 -
College Graduate joins the team, assigned the first jira story.
Perfect logic, variable naming can be improved, but I can let that go, since the logic was good.
Rejected the implementation in fisheye because she used
if()
{
//
}
Instead of
if(){
//
}
What's wrong with me...6 -
I have a variable called 'stuff'. It's a test to see if my colleagues really read my pull requests.3
-
Proud dev moment : as I was following the variable naming conventions from my company, I got to name a variable "l_o_tr" 💪9
-
I was given a work to refactor one of my colleagues code and found that there was a variable named 'anal'. I was quite surprised seeing it as the colleague was a soft spoken and well behaved guy in office. After scratching my head for 15mins I came to know that he was storing analytics data in that variable. Hence the name! :-D8
-
The code is a freaking mess. Shared behavior, terrible variable/method naming, misleading module naming, dynamic polymorphic spaghetti, whitespace errors, no consistency, confusing even if you understand what the code is doing, ... . It should never have passed code review. It probably wasn't code reviewed.
The comments are sparse and useless. Quality level: // This is bridge.
The documentation does not exist.
Testing steps for QA are missing several steps, including setup, so actually using the feature is bloody challenging. If one thing is wrong, the feature just doesn't show up (and ofc won't tell you why).
The specs for the feature are outdated and cover only 4 of 19+ cases. And are neigh useless for those 4.
The specs for the report I'm fixing don't even check the data on the report; it just checks for one bit of data on each row it creates -- a name -- which is also the same on each row. gg.
The object factories (for specs) are a mess, and often create objects indirectly, or in backwards order with odd post-create overwriting to make things work. Following the factories is a major chore, let alone fixing or extending them.
The new type has practically zero test coverage.
The factory for the new type also only creates one variant -- and does so incorrectly.
And to top it all off: the guy who wrote the feature barely ever responds. If he does, he uses fewer words than my bird knows, then stops responding. I've yet to get a useful answer out of him. (and he apparently communicates just fine, according to my micromanager.)
But "it's just fixing a report; it'll be easy!"
Oh, fuck off.8 -
why the fuck people name variables endig with numbers? why? how the hell do you even figure out what's what?
checkStatus1
checkStatus2
checkStatusMyAss10 -
Refactoring code of somebody who left and:
- Plagued the code with TYPOS (milions of them but ok I can live with those... to a certain point)
- Used global variables by default.... of course even where they're not needed
- Used comments only in parts of code where... well they're not needed, important ones are of course left out
- Did not indent code. 3..2..1... Did not FUCKING indent code properly and when he did... did WRONG!
- Instead of indentation he used commented line with multiple ==== signes.... so far top is 60 consecutive lines with olny ==== again no apparent pattern here
- Did not follow a fucking standard in variable naming... no camle casing... there are varaibles assigned multiple times to "temp" variables without no reason just for the sake of wasting resources on the system I guess
This is just the beginning of the review but I already want to change job, die, scream, cry... not in any specific order.10 -
If you ever use emojis for variable naming, please do a favor for the whole developer community by formatting your hard drive twice and then never touching a computer again - because you're an idiot.
Seriously though, why Apple? This screenshot is from the official Swift Language documentation...13 -
Have you ever been at that desperate point where you start naming your variable and functions into something like "pleaseWork"4
-
That's it, I'm done. My sincere condolences go to the poor soul that will have to maintain this complete and utter crap of code, as I have been doing the past 2 weeks.
3-4 big 4K+ lines files of completely unindented, practically undocumented, interspersed HTML, PHP, JavaScript and CSS! All in the same file.
All the function and variable names are complete nonsense. You might as well have smashed your head against the keyboard and let whatever came out be the names.
You took all the naming conventions that you could find and unleashed your seriously damaged imagination. lowerCamelCase, UpperCamelCase, snakecase, everything in the same fucking function name.
I really needed the money from this project. But I'm done. My mental sanity is more important that try to figure out how to make a decent and usable webpage of THIS COMPLETE DISASTER.
You, the one before me. If you wanted to make sure that no one else besides you could work with this crap, then congrats, YOU FUCKING DID IT WITH HONORS. FUCKING SUMMA CUM LAUDE. PhD and all.4 -
http://mindprod.com/jgloss/...
Skill in writing unmaintainable code
Chapter : The art of naming variables and methods
- Buy a copy of a baby naming book and you’ll never be at a loss for variable names. Fred is a wonderful name and easy to type. If you’re looking for easy-to-type variable names, try adsf or aoeu
- By misspelling in some function and variable names and spelling it correctly in others (such as SetPintleOpening SetPintalClosing) we effectively negate the use of grep or IDE search techniques.
- Use acronyms to keep the code terse. Real men never define acronyms; they understand them genetically.
- Randomly capitalize the first letter of a syllable in the middle of a word. For example: ComputeRasterHistoGram().
- Use accented characters on variable names.
- Randomly intersperse two languages (human or computer). If your boss insists you use his language, tell him you can organise your thoughts better in your own language, or, if that does not work, allege linguistic discrimination and threaten to sue your employers for a vast sum.
and many others :D -
According to my predecessor, naming variables is easy. You just hang a poster of the alphabet on the wall and start throwing darts. The letter you skewer is your next variable.
If you run out of letters, start again - but dual wield the darts1 -
Today I discovered what slowed my productivity the most: variable naming.
In a project I was naming many variables 'dirname' in different parts of the my code, but it represented 3 things: only the name of the directory, relative path + directory, and absolute path + directory.
I wasted to much time just figuring out which was which everytime until I finally decided to organize variables names better and see the wonders of the world. Result:
- dirname: only the name
- reldirname: relative path + dir
- absdirname: absolute path + dir
Such simple solution, yet took me years to actually see the benefits, my god
(First devRant post btw :3)7 -
personalproject C++ codebase:
- Clean code,
- 1 class per file,
- naming conventions
- comments .
- No more than 10 files per folder
Work C++ codebase:
- 22 classes per file.
- Classname not the same as file name
- weird variable names CmdStng
- All files in one source folder.
- Source control from 20 years ago
Me every time I cannot find anything I wondering why it is in a different file on line 3574 inside another class with an unrelated filename6 -
Ah.. the beauty of clean code.
I wrote a very cleanly written program two years ago. Proper variable names, not too many, right naming, right design pattern,.. Now I come back to it and I am able to instantly figure out the code again. It only took me half a minute.
The importance of clean code... that's something the industry needs to understand more. Well, then there's the money issue. lol5 -
When one of your dev's can't keep his variable naming consistent, even within the same line. Throw in non-English comments, bad spelling and incorrect pluralization for good measure
string myVariable = THE_OTHER_VARABLE + AnotherDumbVariable
//This add the string for better working2 -
Came across 'var3' and 'var15' while debugging Hybris. What the actual fuck SAP, since when do you hire preschoolers to code.1
-
When it comes to the indentation or look I am fully consistent.
But when it comes to naming I am inconsistent like a crack whore telling she's clean.
Camelcase, underscores inconsistent variable and function names. I use all of them within a single file. On some days I even switch languages.
I truly am miserable in code consistency. Is there any good advice to keep the code consistent?10 -
People who write ridiculous JS variable names that are impossible to understand or are just unreadable!! WTF!! Don't tell me it's to save bytes because its getting minified anyway. You're just fucking lazy.
-
Probably the MOST complete software book on a very broad subject.
This is book to read for those of you are near college grad, first job in the industry. But to the level of detail and broad coverage this book has I think it’s actually a great book for everyone in the industry almost as a “baseline”
From requirements, project planning, workflow paradigms. Software Architecture design, variable naming, refactoring, testing, releasing the book covers everything, not only high level but also in reference to C.
Why C ...because in the consumer electronics, automotive industry, medical electronics and other industries creating physical products c is the language of choice, no changing that. BUT it’s not a C book... it contains C and goes into dept into C but it’s not a C book, C is more like a vehicle for the book, because there are long established, successful industry’s built around it. Plenty of examples.
When I say it’s the most complete on a broad subject seriously like example the chapter about the C language is not a brief over like many other books, for example 10 pages alone are dedicated to just pointer! Many C books have only a few paragraphs on the subject. This goes on depth.
Other topics, recursion, how to write documentation for your code.
Lots of detail and philosophy of the construction of software.
Even if you are a veteran software engineer you could probably learn a thing or two from the book.
It’s not book that you can finish in weekend, unless you can read and comprehend over 1000 pages.
Very few books cover such a broad topic ALL while still going into great detail on those subtopics. the second part is what lacks in most “broad topic books” ..
Code Complete.. is definitely “Complete”
So the image doesn’t match the rest of my book images because I tried to make an amage to cover of the book, inception style kinda haha 😂19 -
I don't know if I'm being pranked or not, but I work with my boss and he has the strangest way of doing things.
- Only use PHP
- Keep error_reporting off (for development), Site cannot function if they are on.
- 20,000 lines of functions in a single file, 50% of which was unused, mostly repeated code that could have been reduced massively.
- Zero Code Comments
- Inconsistent variable names, function names, file names -- I was literally project searching for months to find things.
- There is nothing close to a normalized SQL Database, column ID names can't even stay consistent.
- Every query is done with a mysqli wrapper to use legacy mysql functions.
- Most used function is to escape stirngs
- Type-hinting is too strict for the code.
- Most files packed with Inline CSS, JavaScript and PHP - we don't want to use an external file otherwise we'd have to open two of them.
- Do not use a package manger composer because he doesn't have it installed.. Though I told him it's easy on any platform and I'll explain it.
- He downloads a few composer packages he likes and drag/drop them into random folder.
- Uses $_GET to set values and pass them around like a message contianer.
- One file is 6000 lines which is a giant if statement with somewhere close to 7 levels deep of recursion.
- Never removes his old code that bloats things.
- Has functions from a decade ago he would like to save to use some day. Just regular, plain old, PHP functions.
- Always wants to build things from scratch, and re-using a lot of his code that is honestly a weird way of doing almost everything.
- Using CodeIntel, Mess Detectors, Error Detectors is not good or useful.
- Would not deploy to production through any tool I setup, though I was told to. Instead he wrote bash scripts that still make me nervous.
- Often tells me to make something modern/great (reinventing a wheel) and then ends up saying, "I think I'd do it this way... Referes to his code 5 years ago".
- Using isset() breaks things.
- Tens of thousands of undefined variables exist because arrays are creates like $this[][][] = 5;
- Understanding the naming of functions required me to write several documents.
- I had to use #region tags to find places in the code quicker since a router was about 2000 lines of if else statements.
- I used Todo Bookmark extensions in VSCode to mark and flag everything that's a bug.
- Gets upset if I add anything to .gitignore; I tried to tell him it ignores files we don't want, he is though it deleted them for a while.
- He would rather explain every line of code in a mammoth project that follows no human known patterns, includes files that overwrite global scope variables and wants has me do the documentation.
- Open to ideas but when I bring them up such as - This is what most standards suggest, here's a literal example of exactly what you want but easier - He will passively decide against it and end up working on tedious things not very necessary for project release dates.
- On another project I try to write code but he wants to go over every single nook and cranny and stay on the phone the entire day as I watch his screen and Im trying to code.
I would like us all to do well but I do not consider him a programmer but a script-whippersnapper. I find myself trying to to debate the most basic of things (you shouldnt 777 every file), and I need all kinds of evidence before he will do something about it. We need "security" and all kinds of buzz words but I'm scared to death of this code. After several months its a nice place to work but I am convinced I'm being pranked or my boss has very little idea what he's doing. I've worked in a lot of disasters but nothing like this.
We are building an API, I could use something open source to help with anything from validations, routing, ACL but he ends up reinventing the wheel. I have never worked so slow, hindered and baffled at how I am supposed to build anything - nothing is stable, tested, and rarely logical. I suggested many things but he would rather have small talk and reason his way into using things he made.
I could fhave this project 50% done i a Node API i two weeks, pretty fast in a PHP or Python one, but we for reasons I have no idea would rather go slow and literally "build a framework". Two knuckleheads are going to build a PHP REST framework and compete with tested, tried and true open source tools by tens of millions?
I just wanted to rant because this drives me crazy. I have so much stress my neck and shoulder seems like a nerve is pinched. I don't understand what any of this means. I've never met someone who was wrong about so many things but believed they were right. I just don't know what to say so often on call I just say, 'uhh..'. It's like nothing anyone or any authority says matters, I don't know why he asks anything he's going to do things one way, a hard way, only that he can decipher. He's an owner, he's not worried about job security.13 -
Today i found variable called "booleanValue". So it IS true, that there are two hard things in computer science: cache invalidation and naming things...3
-
Ffs, I've finally finished a project where I worked with a guy who was the laziest coder I have ever worked with.
He didn't even try to come up with meaningful variable names😒.
Instead of naming a variable label1 (which is already kinda s***) he tried lbl1 but still made a typo so the actual name was ibl1.
AND HE LEFT IT LIKE THAT FOR THE REST OF THE PROGRAM!4 -
When you're naming variables, it is not acceptable for them to be one character, especially when that character bares no relevance to the information it stores.
'f' is not a good variable name for an array of strings now, is it...9 -
Never know why you need to add vanilla to make vanilla. Oh wait, it's just crappy variable naming.3
-
Developers who think using cryptic variable names (like acronyms) is better than long descriptive variable names.....but then feel the need to document/comment the variable name rather than just naming the variable properly in be first place.
// Current CGRect to draw into
let ccgrd = self.currentCGRect()
Instead of just
let currentRectForDrawing = self.currentCGRect()4 -
When it is 645am Friday and you spent the whole week with meetings and tasks and sleepless nights.
You just cannot give a tiny rat ass about the naming of routes and functions.
DO NOT ask me about my variable names!3 -
Few years ago as a junior android dev with couple years of self taught experience of working in startups I submitted a simple android app assignment for a junior android dev role. Assignment had only like 8 requirements so I followed them to the letter. That didn't end well.
App was simple just 3 screens. Login screen with username and password input fields, login button.
Had to call a login endpoint after login button was clicked, redirecting to home screen, calling items endpoint, displaying a list of items and when an item was clicked passing item data and redirect to item details screen.
Needless to say big swinging dick senior was not impressed. UI was not perfect, I forgot to display a loading animation when fetching data, didnt handle back button properly.
I agreed with some points but other comments were clearly just nitpicking: his preferred variable naming conventions, his opinions on architecture that was not up to his standard (official google arch at the time was not up to his standard).
He also was mad that app wasn't prepared for release to googleplay (another out of the ass requirement). Like I would prepare a 3 screen app for prod release that he will forget ever existed after 20min of his review.
Lots more of nitpicking, encapsulation this encapsulation that, omg now hes shocked that there are a few warnings after the project is built.
Regardless my self confidence was destroyed at that point and after few more negative experiences I dropped android dev alltogether for a couple years and switched to game dev.
After game dev ran its course I went back to android dev and found a supportive place where I could grow.
Looking back, they were actually hiring atleast a mid level for a junior position but I was grilled as a senior. The guy literally didnt wrote any single positive thing in that review about my code even tho my senior peers said my project was decent back then, its just that I didnt handle a few edge cases and that's all.
I looked up the guy in linkedin, turns out hes a uni dropout who posts all books that he red about software dev in his education section of his linkedin profile. Found a bunch of other narcissistic stuff on his profile. Guy was a fucking idiot. Even if I worked under him it would have probably sucked.
Learned some important lessons I guess. Always get a second, 3rd and 4th opinion and dont take criticism too seriously. Always check what kind of person is providing feedback.4 -
That moment when you take the time to explain the idea of camelCase variable naming as opposed to the Underscores to this hot new girl at the the office and she comes back to you showing off her handy work and you notice how her very first variable is named camelToe
-
in personal projects, it is really easy to tell when I'm horny. you will find variable names like
- hotVar
- sluttyVar
- FUCK_ME_VAR
15 minutes after that commit naming becomes
- var1 -
Anybody loves python? I don't know why, but the more I use python, the more I seem to hate it. Specially the poor naming of the functions are just horrible! specially when you've been following the #CleanCodePrinciple strictly.
Let me give some example:
What does even "len" or "str" mean normally? is it a variable or a function? can anybody imagine?
where as in Java or JavaScript it is array.length and anyValue.toString()
anybody can understand what these things are, whether a variable or a function.
in python some functions are like "dothisorthat" and some are "do_this_or_that" some are "doThisOrThat". I mean, why can't you just follow an unified rule?
and there's this fragmentation between python 2 and 3! whether in stackoverflow or in youtube/udemy, a lot of them used python 2 and some uses python 3. I mean, can't they have some BackworkSupports?18 -
I worked at a startup that indulged in pair programming thing. Where as a junior, you'd be partnered with a senior developer.
My mentor, always insisted on having shortest variable names possible, so that the "size of codebase" will be very small.
It was a nightmare going through his code and understanding what's he's done. Best part, no comments as well.
In a way it has primed me to go through any codebase possible.5 -
Our instructor for game development claims that variable names are not important if your scope is small.
Thoughts?
Here is a picture of his code he gave us as a reference the other day.19 -
Am i whiny or is resilience so glorified in this field?
I am a junior developer. I was assigned with two projects together with a friend and a senior. My friend and I finished our assigned tasks way before the deadline. Fast forward, my senior got reassigned to a different project since we are lacking with manpower. Naturally, his transactions were assigned to me and my friend. And my goodness, his existing codes are a piece of shit! It's all over the place. His variable naming is shit, his codes are all around the place, his codes doesn't even follow our company's coding standards, no try catch, a lot of unsafe practices. In short, cleaning his code is a pain in the ass and my friend and I got really busy with cleaning his mess. The testing of our system is really near but I just thought that maybe he's really busy with the other project that's why the quality of his codes deteriorated.
He's not. One day, I saw his in discord that he's playing during work hours lol. And the worse part is that he is playing with our boss! YES. DURING WORK HOURS. I got mad but I couldn't say anything because he is really tight with the boss.
Later on that day, we had our meeting. I was surprised when my boss told me that she's expecting that the excel part of our system is already finished. A little background here, my boss asked me to study Excel VB. However, I didnt get to study that much because I was so busy fixing bugs and after that came the cleaning of our senior's shit codes.
So I tried to say these things to my boss but I was cut out by the same senior shouting "You can do it!" over and over again. No one listened to what I was trying to say! And to make it even worse, the boss had a very proud look on her face and she even had the audacity to tell me that I'm lucky I have such a good support system. I dont.
Now, the company is planning to put me in a very demanding project. I havent finished cleaning up my senior's codes, I havent started anything with the excel and the deadline is next week!
The boss told me that even if I enter the other project, that I will still be responsible for the Excel part of our system. So fucking shoot me in the face.They were telling me that I should have a good time management system, that I should be flexible, that I should adapt easily, yada yada yada. She just makes you feel bad about yourself if you're not as 'flexible' as her.
The thing is, even if I have the best time management techniques in the world, if you bombard me with a shitload of tasks, then I won't be able to do it properly! I don't even take breaks anymore! I work literally 8 hours a day, even more than that. And I dont understand, why the hell is she overworking me when her friend (the senior dev) is just playing during work hours?
Another funniest thing is that she told us that when we encounter technical problems, we should ask our senior dev. Oh boy, if only she knows how shitty his codes are.6 -
While parsing nodes in a graph.
In terms of readability and variable naming, how wrong (if at all) is to use:
1. broNode (for sibling nodes)
2. papaNode / mamaNode (for parent nodes)
3. babyNode (for child nodes)
I sincerely don't know how to review this PR7 -
I have had it with this wack-ass code, with its spaghetti-looking call tree, nonsensical variable naming, comments a screen-height long and as clear as mud mixed with diarrhea, conditions incomprehensible enough to make kafka depressed, and condtions nested deeper than a goddamn ant colony.
In fact, it has more levels of indentation than one of those stupid iceberg memes - the top is pretty and barely afloat while the rest of it is a fat mess all the way down that only serves to sink your motherfucking hopes and dreams.
AAAAAAAAAAAAAAAA2 -
When variable naming should be policed... $is_not_checkout. WTF!! Even worse when seen in context.
If (!$is_not_checkout) {
// do something when on the checkout
}2 -
First-time goona work on frontend(my worst nightmare).
That too Angular.
That too on a file containing 900 LOC.
That too with no proper naming, variable names x,e, obj.
That too with no comment.
Cant take help as I am the lead(name-sake, small team, I have 6month more experience than others)
I have 2 days(thank god for the weekends).
Fuck...Fuck...I missed writing CLI apps.7 -
My first time doing a pair-programming for uni assignment.
My partner is actually smart (a Mechanical Engineering guy), except when it comes to programming :
1. Don't know how to spell FALSE
2. Don't know how to create array in Matlab
3. Poor variable naming
4. Redundant code everywhere
5. Not using tabs
6. Stealing my idea and spit it again in my face after claiming it as his idea
7. Mansplaining every line of his code like I am a stupid person who never sees a computer before.
He said he has an experience in Matlab, wants to specialize in Robotics and taking several ML classes. What did they teach anyway in class to produce a shitty programmer like him?
Thankfully despite his being an arrogant shitty guy, he still manage to get our code to works.
That's good because if not, then I will happily push his head under water while slowly watching him drown.
🤨6 -
You know what really cheeses my onions? When people write their code in a foreign language, say French or Spanish, and then come to me asking why it doesn’t work. Like, mate, how you expect me to be able to make sense of your code if your variable naming is totally foreign? And it looks horridly out of place to boot.
Moral of the story: Write your code in English and save us the headache.2 -
To all the masochists who spent hours debugging misspellings:
1. Learn your tools
2. Learn good practice
Every IDE should point out when you're not using a variable you've initiated or using an uninitiated variable as well as at least highlight, if not simply list, every occurrence of the variable under your cursor and let you find all references or even display the number of references next to a variable at all times, and finally, every IDE should autocomplete for you so when it doesn't you know you've messed up. Good IDE makes all the easy mistakes hard and all of the hard tasks easy. Including running tests. If you don't know how to configure your IDE to do all these things take time and learn it. If you still can't figure it out, replace your IDE maybe...?
Also use the debugger. Preferably one that nicely integrates with your IDE. If you don't, check point 1.
Also write tests and *run them*.
Also if your misspellings tend to consist of a missing `s` at the end of a plural noun just call it `entityCollection` instead of `entities`. And read up on more good programming practices and naming conventions.7 -
Due to covid, mgrs decided to fire 10% but could not negotiate schedule increase with internal IT. With no promotions or hikes, few full stacks we have leave.
Now am working with 2 data engg doing cloud java microsvs work while learning. Their first delivery was applauded by their mgr who is under pressure to retain them.
I as arch review their code. No unit tests, print statements all around, shoddy exception handling, variable naming issues. We have Sonar by default in our build. They ignore the report. I ask them about it. Seems mgr told them he is getting a contract person from another team on part time basis to do/fix. I share my confusion.
Mgr calls me up and checks if we can put it as tech debt backlog and deploy to prod !!!1 -
Is it just me or is the first question of the gcse computer science exam the hardest question in the world?7
-
I'm always helping out a girl in my class with her coding assignments but her code is absolutely atrocious. I don't have the heart to tell her that her whole method, file and variable naming, and process is wrong and is causing her so many headaches.11
-
You ever sit down to code, all pumped up and ready to conquer the digital world, only to have your computer decide it's the perfect time to install updates? "Sorry, can't work right now, I'm busy optimizing your experience," it says, while you sit there twiddling your thumbs and wondering who asked for this update in the first place.
And let's talk about variable names. Who thought naming things would be the hardest part of programming? You start with `count` and `index`, but by the end of the project, you're using variables like `reallyLongVariableNameThatDescribesExactlyWhatThisThingDoes`. It's like playing a game of how many characters can you type before your fingers revolt.
Then there's the joy of debugging. You sprinkle `console.log()` like breadcrumbs through your code, trying to find where things went off the rails. Half the time, you realize you've been chasing the wrong rabbit down the wrong hole, and the other half, you discover the bug is some obscure edge case that you couldn't have predicted in a million years.
But hey, it's not all doom and gloom. There's a weird satisfaction in solving those coding puzzles, like when you finally get that algorithm to work or refactor your code into something so elegant, it feels like you've sculpted a masterpiece out of digital clay.
So here's to all the coders out there, navigating the ups and downs of curly braces and semicolons with a mix of determination and exasperation. May your code compile, your bugs be minor inconveniences, and your computer never decide to update right when you're on a coding roll!!3 -
What does my current job hate descriptive names? Like to the point of active antagonism? We're a subscription based service. Why is SubscriptionExpiration the date you log in? Why does SubscriptionStatus only contain the name and id of product you're subscribed to and nothing to do with an actual status? All I need is the date a user subscribed. Why is this so hard!?!?7
-
If not understanding code, read the documentation or debug the code. When trying to modify...
1. Follow proper indentation.
2. Don't make spelling mistakes and follow naming convention.
3. Don't try to write all the code in one line (based on line length set)
4. Simplify if else statements if possible.
5. If value of method call need to be used once, don't store it in a variable. Directly use where ever it is needed.
6. If there is duplicated code, put it in separate method and re-use it if possible.1 -
So as a student developer with years of background in web development (including both front and backend), c++, java and c#, I was more than surprised when I found out my Informatics assignment hadnt received the proper excellent mark. In fact both me and a friend of mine who has been working with C++ in particular for years got a --mark.
// The assignment was the most simple Windows Forms Application with 2 buttons and a textbox
When we asked about that the teacher said we hadn't labeled the buttons and textboxes, though we had actually taken our time to put labels next to each UI element that would need usage directions.
Though what she meant was renaming the actual variable names, those being textBox1, button1 and button2.
We of course got really mad, because w both follow the accepted naming conventions for each of the languages we write in. Arguing was to no avail. Even telling her that variable naming was not in the assignment instructions was pointless as she said it had been self explanatory..
The others for whom computers are powered by magic, did their assignments as they had memorized everything that teacher had shown them. Why? Because she didn't teach them how to code in the first place. So they copied what would work.
Fucked up educational system, sadly nothing new..
Oh and btw, the naming she uses and teaches students to use is:
button1 - btname
label1- lbname
textBox1 - tbyear2 -
Out of everything in this assignment, I just know I'll lose more marks for shitty variable naming than any missing features.
Commenting? Perfectly acceptable. Use of functions and classes? Perfectly acceptable.
Variable names? perfectAcceptableMaybeFileOneButAsAString
I don't get how I'm so shitty at it! I currently have shit like file input, file input as string, file input as vector, I didn't know that would be the hardest part!1 -
When you take over some shitty unindented, fucked up variable naming, using a god damn loop for every fucking thing ass dev's fucking project
-
Spending too much time on smaller decisions sometimes. Spending 5 minutes thinking about naming a variable and such.
-
PM: there’s a bug could you investigate and fix this?
Coworker: *investigates*
CW: is this correct? *shows a totally different solution to what he was asked to* *naming a variable “fn”*
Me: but that’s not what you’re asked to do. You know it’s possible to do that right (the supposedly solution)
Cw: but that would have longer code
Me: (what?) 🙃
Wtf do you mean longer code?
Cw: shorter code > spec
Me: 🤦♀️
Cw: shorter code > readability
Me: 🤦♀️1 -
Why Dart was designed with idiocy:
1) naming conventions are idiotic
Most other languages are smart enough to not throw errors when the variable name matches its type. And lots of others, for any lexemme - only 1 naming kind is allowed.
Fine. Oh wait, there's that thing called existing databases and GraphQL & other APIs, should they all adapt to this? No, because 2) is the bonus
2) String keys in objects. Unless it's a class with boilerplate, you write them as strings and access them as strings.
So here's the solution when you want to integrate Dart with existing services: write a lot of JSONSerializable decorators to fit with dart's pissy naming requirements.3 -
Ok, so currently in my Java course on Udemy we are going more in-depth into scope and visibility, and I'm currently doing the challenge for it.
So I'm doing it and the challenge is to have every single name of a variable or method be called 'x' (just to better understand scope and vis, he mentions how this is not a good practice AT ALL) with the exceptions of the classes and scanner var (but there is an optional challenge to also make them named x).
Now that I progressed into it, I noticed something. This challenge is literally making me make my code so DRY and outside-the-box-thinking that, what if, this could be a practice?
Not the naming everything in your code the same var name, but doing that at the start and then renaming the variables after coding. Because right now, I feel as though I am using SO MUCH less code than if I had the liberty of naming my classes, methods, and variables different things, it's actually kinda cool.
I'll attach my code from the challenge to this after by it really amazed me how well my code looked compared to my previous challenges and even personal projects!1 -
i'm the only one thinking naming variable can and could be something a little bit subjective? or are everybody else can find the perfect name that make it crystal clear for any person reading it?6
-
When your teammate is thinking more about his vacations and when he leaves, you find that he calls a variable "cruise" on a project that has nothing related to it3
-
Anyone work with a dev "higher" up than you, but that "senior" dev really doesn't understand how to write good code? That dev also doesn't understand how to remove old un-used code and basically follows every anti-pattern in the book -- bad variable naming, using switch statements when an if would be more logical, etc. I don't know how these people reached the height of the totem pole that they are on, but my goodness is it frustrating. How can someone SO OBLIVIOUS have so much power?! And everywhere they go they leave a wake of destruction that undoubtedly will need to be cleaned up by someone else later down the time... It's like they don't care at all but deep down you know they are just bad at their job... UGH!
-
I once had a colleague ranting about my variable naming because it went out of bounds on his IDE's printmargin. To please him i wrote minified code while pair programming
-
I am unable to understand the naming convention. I SUCK IN IT.. CAN'T I JUST NAME MY VARIABLE AND OTHER THINGS LIKE SIMPLY, WHY I HAVE TO USE UNDERSCORE AND ACCURATE NAME FOR IT.
I mean , my variable does tell what is it for then why I need to do that?5 -
Variable Naming process
-------------------------------------------
Fetching a data of Counties into a variable using Fetch API.
Variable Name: countyData.
The code review is going to be interesting.4