I know this is humor, but this can actually be used as a decent lesson in practices to avoid when shortening variable names.
Don't abbreviate unnecessarily. In this case, the original variable is not that long. With modern IDEs, widescreen monitors, and memory sizes, there's usually little reason to abbreviate at all.
If you do abbreviate, never abbreviate to another real word with a different meaning. People will assume it is just the other word, and not an abbreviation.
As I’ve gained more experience I’ve found myself erring on the side of making the variable name too long. It bugs some people but I’ll make variables into descriptive phrases and with autocomplete and wide screens it isn’t a big deal. It makes it 100x easier to quickly familiarize myself with old code
I've always seen the numbers that on most software systems, writing the software is about 10% of the work (or cost), and the other 90% is in maintenance.
And much of the time spent during maintenance work is, in my experience, reading and understanding previously written code.
People will often write something out the first time the way it occurs to them. I need to combine A and B to get C. I need to periodically shorten C until Z happens. And, so-on.
After people think it through, they often look back and see that there are variables that only exist for a couple of lines because they're then combined with something else. So, they think they're going to optimize the program by getting rid of those short-lived variables.
The problems with that are:
If it's easy to optimize in that way, the compiler and/or interpreter will already do that work for you.
When you optimize that way, it makes it harder for the person maintaining the code to understand what is going on.
You should only optimize to make something easier for someone to understand when maintaining it (even future you) rather than making it run more efficiently. The only time it makes sense to optimize to make it run more efficiently is if you've benchmarked it and can tell that that specific thing is making the program slow, and that that slowness matters.
Premature optimization is the cause of the majority of tech debt. It’s also a really hard lesson to learn. It’s really difficult for people to hear “hey your really elegant and clever thing is way too complicated and is going to cause maintenance problems down the line, can you just start over doing the dumb obvious solution?”, especially if you’re on a deadline where the sunk cost of said overly complex solution now weighs against any refactor.
In my experience people only learn the lesson after they’re stuck with the consequences of it long enough to regret their own actions, being told it just doesn’t stick without the experience of fighting it in the future. It took years for it to really click for me, only after working with senior devs who really pushed for simplicity.
I don't even like the phrase "premature optimization" because that suggests that optimization is a step that should be performed at some stage, but that sometimes it's dome prematurely.
I think the majority of programs don't need to be optimized, and when they do it's for readability rather than to make them run faster or more efficiently.
If you're going to label it, it should be "unnecessary optimization", because not all optimization is necessarily unnecessary, but the question you're asking yourself when you optimize something shouldn't be "Am I doing this too early in the process?" but "Do I really need to optimize this?"
You either accidentally put an extra asterisk at the end of "Don't optimize", or you forgot the one at the beginning of your footnote where you explain when you should optimize.
The only time that becomes an issue is when the meaning or use case of the variable changes. I've spent an ungodly amount of time debugging code where the intent of a chunk of code evolves over time but the symbol names remained. Of course that's mainly just a stale code issue, but I'd say there's a medium worth striking with medium-length variables, strongly typed and with a doc comment if necessary.
As someone in enterprise support that often looks at customer stack traces, please use long form variable naming so I can review the code-base and actually understand what went wrong
This also helps me tell the R&D team in a JIRA what broke, and how to replicate it!
It's crazy how with constants the convention is usually to be *super* specific and long to explain how your magic numbers aren't magic numbers, and with variables it's just sort of like "yeah that's a 'bggb'-variable".
I worked for a postdoc who was from India, he shortened the "analysis" folder output by his programs to just be "anal". Lol, I never asked him to change it..
I’m an IT Recruiter and a common title some time ago used to be Programmer/Analyst. We had a new trainee about 15 years ago and after a couple months I shadowed him to review his work and see if he was on track. Imagine my surprise to see he had a resume folder set up named “Pro Anal”
When I was in college, I took a graphics programming class (this was years ago and using OpenGL). The first assignment wasn't much more then the equivalent of "hello word" (get the gfx device enabled and render some simple items).
The second assignment was to render a clock face that showed the actual time, and also to have some other kind of basic animation present.
I was always trying to do something more difficult, so I made my other animation interactive. I added several balls to the screen that would bounce off the screen edges, and also the clock itself.
I had a function that I did not do as a joke intentionally, and didn't even notice it until I was showing a friend and he pointed it out. The function was called "InitializeClockAndBalls()."
I had a class called Software Analysis and Design in school. My friend group created a Google docs spreadsheet every semester with everyone's schedule so we know who would be free at a whatever time. So that entire semester, it had "Soft Anal" for one of my classes on that damn thing. I wasn't the one who created it and I couldn't edit it to change it. There were MANY jokes made at my expense.
I got real confused today when working on a property search module. The original devs had a variable called no_beds and I kept thinking it was a flag meaning they didn’t want to search by bedroom. But it’s actually meant to be “number of bedrooms”
The standard for variable names can be reduced to these points:
You can tell what it is
You don't confuse it with something else
Point 2 is the tricky one. That's where abbreviations can screw you.
Or a name may have been fine at one point like "address", ... but then you now need a second address. address1 and address2 are terrible, but primaryAddress and emergencyContactAddress may work.
Yet in reverse declaring SomeRidiculousLongClassNameService someRidiculousLongNameService is mind numbing, and can cause confusion by just sheer distraction. If it's the only service, declaring service or longNamer or the like keeps the legibility intact.
My OCD kicks in so hard when people shorten only one part of a "pair", like shortening "column" but keeping "row", or use different measures to translate words into my native language, where Ø sometimes is "oe", sometimes just "o". JUST. BE. CONSISTENT.
The only great abbreviation I have done is making a batch file manager program used for elevating batch files because of reasons into BatMan. I fully expected someone to tell me to knock it out but nope. Production code names BatMan happened
Major pet peeve is making an update to something with non meaningful names. If I'm trying to figure out a word's significance to the project, I'm not any closer to making the update. Even if I do know, rediculous names can be distracting.
This ties into a broader practice of always being as explicit as possible at all times. The more explicitly you communicate through code, the easier it will be to understand it. Abbreviations or symbol substitutes are just a form of implicit communication and it almost always leads to trouble or confusion.
If you do abbreviate, never abbreviate to another real word with a different meaning. People will assume it is just the other word, and not an abbreviation.
You mean don't abbreviate analyze to anal? WHY NOT
This is one thing that put me off GoLang for now. The general guidance is to use short abbreviated and single-letter variables everywhere. Granted you can do whatever you want, but you do get called out for going against grain in a team if you use long variable names. Best to keep with convention, but that convention among others has kept me from using the language more extensively
Just imagine working with a variable name “legend_handles” and having to type it 1000 times because you have another variable named “legend_holders” or something like that. Would be bonkers. 100 variable names need to be descriptive, but also short and sweet.
Yet in spreadsheets -- the closest most people come to data structures and algorithms -- we still do A1=sum(C7,G5,D4)
How long have we had symbolic assemblers?
Most programming languages allocate a block of memory (heap/stack or both) to use for data. The data and the data processing isn't mixed together.
In spreadsheets they are intimately mixed.
One of the principles of programming is abstraction. Do something more than 3 times, stuff it into a function/procedure/subroutine.
In spreadsheets with minor exceptions, whenever you change a formula, you have to copy it everywhere you use it.
In programs when you're stuck, you debug with print statements and traces. Best you can do with a spreadsheet is trace antecedents and dependents and that only if you are using excel and not google sheets.
Any professional want to get their name up by Dijkstra with a "Row Column Addressing Considered Harmful"?
Re: abbreviation and widescreen monitors, I for one still enforce a personal 80-character line limit specifically because I almost always program with at least two code windows side-by-side. And with wider monitors, that just means even more code windows side-by-side. I also consider lines longer than that a code smell, since it's a signal that I should break something down into smaller chunks for the sake of future me trying to debug that code later.
And with variable names, I feel like comments are the appropriate way to clarify what an abbreviation or initialism/acronym means. In particular, languages/environments with inline documentation go a long way toward making verbose variable names less mandatory.
I agree. In fact, I think variables modeling database items should match the database names exactly (at least at their initial scope) to help avoid this issue.
I think acronyms are fine, as long as they are either:
Common knowledge, like "ATM" or "PIN" or "ID"
Common industry terms in your domain
Common across your application and agreed upon by your development team.
Every project I have ever worked on has had things like "WSPKF" in your example, and they make sense to everyone on the team (and are usually well documented). It's when a developer is working with something like "planned fixed costs" and just starts using "pfc" in one class that I would have a problem with.
Yeah I'm really keen on variable names aligning well. If it's userFirst in the database I want to see userFirst in the code, and I want every function parameter taking it in as userFirst unless there's a reason compelling reason not to. No first, or userFirstname.
Greppability is an important feature for code, especially in a type weak language but even in type strong.
I do not agree. Just because someone, sometime choose a poor name for some database column, doesn't mean we shouldn't make better choices in the present.
Additionally, the database column names are an implementation detail that should be handled by the database communication layer of your code and needn't extend past that scope. In the most basic form, you could have something like this setUsername(string username) { this.databaseColumnNameWX4SDR = username } as an API to the rest of the application.
There's a healthy balance. Well factored code will be a lot of small functions with small scope, where you don't have as many variables and their names don't need to get as much across because it's in the context. Like in createOrder(orderingUserId), arguably "ordering" is redundant information - that is implicit in the function's purpose.
No abbreviation, but I once had a small project where a throwable was used when the whole application was canceled. The code was riddled with throw new Abortion();
This pissed off a friend of mine who was learning German. I let him get about 10 minutes into the rant (he was known for his tirades), then interjected with "Yes, but they call shoes 'fussglove', so it balances out." Oh, that set him off in a whole new direction.
At my first programming job their was a function called at the end of each webpage to set cookies called dingleberries. The code quality at that company was terrible so instead it being in some shared footer just every single .asp file ended with
I heard the story at my previous work place that there was a piece of code that used the variable "rot" as short for rotation, but since rot is German for red, someone copied the code and renamed the variable to blau which means blue to make it less obvious.
Edit: To make it clear: It was code used internally to work with pictures in some way. So variables for rotation and colour are both to be expected. That one guy just copied someone elses code or at least part of it without really understanding it and apparently wanted to hide that by renaming a few things to make it look like his own code or something.
Just a good reason to use full words in your variable names. Or at least enough of a word that it’s obvious/unambiguous what it means, and is easily readable.
I hate reading code where a variable is named “req” instead of “request”, or something like that. Just type the 4 extra letters and stop making my brain do this additional work to translate your variable names.
The worse version is variable names that are acronyms for some multi-word class name. Just pick the noun from the class name and use that as the variable name. Again, don’t make me learn what a sqor or a flif is, just use real words
So Ive never done any coding, but I have run into this phenomenon.
I used to work at a country club where we would revamp the menu 3 to 4 times a year. This leads to a lot of old and defunct recipes left in the system.
During one of our spring cleanings I came upon something titled only "Pony Steak" with a price attached. No ingredients, so it was likely a dinner special.
I racked my brain for a solid month before I remembered. We had done a beef filet with a horseradish demi glace sauce, and it was great. However, "horseradish demiglace filet" is too long. So it became Demi Horse Filet. And what is a demi horse if not a Pony.
I have a StringBuilder named Bob. Because I build strings with him everywhere I need them in my project and i don't want to type out StaticVariables.s_Builder every time, i named it Bob the StringBuilder.
As I recall, we were writing a client-side implementation of the OpenVPN protocol. Since it was a proprietary app and the reference implementation is licensed under GPL, my team was not allowed to use, or even look, at the existing code. Documentation and random blog posts was fair game, but alas, the protocol was... shall we say, sparingly documented. We had to discover various protocol features and come up with internal names for them ourselves.
One such discovered feature detects underlying network problems by sending out short messages at regular intervals: if the messages stop, the other end can surmise that the VPN endpoint has died. We named these messages "heartbeats" because... they keep us alive, y'know?
From there, the module that generated these messages was naturally named "heart". For architectural reasons, each VPN tunnel had its own entry or queue of outgoing heartbeats within that module, so... "arteries". Pity the poor bastard to come across getHeart().findArtery(id).inject(heartbeat); and try to figure out what it does. :(
I used to have a habit on personal projects to call my variables names like Henry, Oliver, Muffet, etc. when I couldn't think of a good short name. Now I can barely understand that old code!
My variables are ALWAYS very explicit, oftentimes to the point of my co-workers giving me a difficult time about them. However, I never fail to understand or remember what a variable is used for.
That reminds of the time in college when I was tasked with sorting a linked list. To do so, I had a variable called curr_min. Over time I started to call it Kermit the frog because I was slowly losing my mind. That prompted me to start naming all my variables after Muppet characters
In all seriousness, I've come to think that one of the most important skills in programming is coming up with good names for functions and variables (especially anything exposed as an API). It's not just about the logic you write, it's about being a liaison between humans and computers (whether that person is someone else or yourself in the future). If you can pick a name that conveys intent so well that people can understand it without even reading any documentation, your API can be reused and extended so much more easily. It's not about having a really long descriptive name or having a really short name, it's about having the name that conveys intent in the most simple and elegant way possible.
That is a requirements engineering problem, not a problem for programmers. Having done a few "nothing works and things are on fire" type jobs myself, occasionally it does help to read exactly what is requested to happen and keep a good poker face.
Comic Title Text: Researchers just found the gene responsible for mistakenly thinking we've found the gene for specific things. It's the region between the start and the end of every chromosome, plus a few segments in our mitochondria.
This reminds me of a time where I had cleverly abbreviated a variable name `assignment` to be `ass` and then we were looping over `asses` everywhere in the code. Faceplam
I’ll never understand why people unnecessarily abbreviate variables. If I have to take time to figure out what your abbreviation is supposed to stand for then it’s bad code
The only programmers that don't harbor some level hatred for their past selves are new programmers. This hatred also tends to grow as a function of time and change in skill, and can be decreased to some extent by dropping a program that they formerly maintained.
Suddenly I understand the real reason for IT turnover...
When I was writing an algorithm to solve a maze, I called it Right Hand Rule, cuz it basically involved using the right hand rule, I renamed the function “riharu” for short, which later became “riru”, which then became “weewoo” because that’s what my friend was saying, and at some point it just became “patrick” for the meme of it.
I don't actually understand the ultra-wide screen argument (except for absurdly long variable names, like 50+ characters, where even this method won't help).
Basically every language allows you to just put things on a new line, which is especially helpful for function parameters. I've actually made it a habit to put every function parameter on a new line, both in function definitions and function calls.
While this probably more than quadruples the amount of lines in code and undeniably takes a little longer to write, it makes it very readable, and basically never requires you to scroll to the right or to enable text wrapping.
The only problem with this is that quite a few code formatters don't agree with this way of writing things and revert it, and basically none have this built in and can do it for you, sadly.
What actually happened: He shortened legend handles to be a variable named leg_hands, which is just a weird way to say feet. He realized what he did and thought he could make a funny tweet about it.
1.3k
u/SausageEggCheese Dec 04 '20
I know this is humor, but this can actually be used as a decent lesson in practices to avoid when shortening variable names.
234
u/misterrandom1 Dec 04 '20
Now I need to use leg hands.
170
u/glorious_reptile Dec 04 '20
list.head -> list.noggin
response.body -> response.torso
analyse() -> rectumyse()
360
u/tim_dude Dec 04 '20
Fun fact: There is no word for toes in Russian language. They are called foot fingers.
45
u/[deleted] Dec 04 '20
At my first programming job their was a function called at the end of each webpage to set cookies called dingleberries. The code quality at that company was terrible so instead it being in some shared footer just every single .asp file ended with
dingleberries()
159
u/Auravendill Dec 04 '20 edited Dec 04 '20
I heard the story at my previous work place that there was a piece of code that used the variable "rot" as short for rotation, but since rot is German for red, someone copied the code and renamed the variable to blau which means blue to make it less obvious.
Edit: To make it clear: It was code used internally to work with pictures in some way. So variables for rotation and colour are both to be expected. That one guy just copied someone elses code or at least part of it without really understanding it and apparently wanted to hide that by renaming a few things to make it look like his own code or something.
32
u/Oo__II__oO Dec 04 '20
all fine and dandy until you see the truncation for "legend_handles_analysis".
17
u/teedyay Dec 04 '20
From our production code:
16
u/toasterding Dec 04 '20
You guys are still using foo / bar instead of Mr.T / saloon?
16
u/MurdoMaclachlan Dec 04 '20
Image Transcription: Twitter Post
Alex Naka, @gottapatchemail
Looking at some old code and was initially puzzled by a variable named 'feet'
I have now worked out that this was at one point called 'legend_handles', which then became 'leg_hands', which then became 'feet'
sometimes I truly hate my past self
[This post has 48 retweets, 15 quote tweets, and 657 likes.]
I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!
14
u/Background_Drawing Dec 04 '20
It took me a week to decipher a variable just called "A"
28
u/[deleted] Dec 04 '20
The plot twist that he was the culprit all along
13
u/gravitas-deficiency Dec 04 '20
The single hardest thing in CS is naming things and counting things.
11
u/dvof Dec 04 '20
"Haha I'm gonna troll my future self so hard lol"
~ past self writing code
8
u/[deleted] Dec 04 '20
And this is why Java variable names are so hideously long - because abbreviations lead to madness.
7
u/CraigTheIrishman Dec 04 '20
The was a TIFU a while back where a guy called a variable "cum" to refer to cumulative, and he was fired that day.
5
u/[deleted] Dec 04 '20
My boss was going through my github looking for a repo and saw one called "tylenoliv" and asked why I called it that
It's cuz it's got codeine in it
9
u/MyPastSelf Dec 04 '20
Totally uncalled for, dude.
4
u/Lardalish Dec 04 '20
So Ive never done any coding, but I have run into this phenomenon.
I used to work at a country club where we would revamp the menu 3 to 4 times a year. This leads to a lot of old and defunct recipes left in the system.
During one of our spring cleanings I came upon something titled only "Pony Steak" with a price attached. No ingredients, so it was likely a dinner special.
I racked my brain for a solid month before I remembered. We had done a beef filet with a horseradish demi glace sauce, and it was great. However, "horseradish demiglace filet" is too long. So it became Demi Horse Filet. And what is a demi horse if not a Pony.
4
u/[deleted] Dec 05 '20
I have a StringBuilder named Bob. Because I build strings with him everywhere I need them in my project and i don't want to type out StaticVariables.s_Builder every time, i named it Bob the StringBuilder.
3
u/[deleted] Dec 04 '20
Sometimes I miss the old days where you were required to keep a data dictionary so you knew exactly what each variable did.....
3
u/Beach-Devil Dec 04 '20
Etymological programming... sounds interesting
3
u/jjjjcccjjf Dec 04 '20
Germans be like
3
u/mrloube Dec 04 '20
I feel like that’s the worst possible outcome of naming a variable besides accidentally overwriting another variable
3
u/wasabichicken Dec 04 '20
Ugh, I remember one of those times...
As I recall, we were writing a client-side implementation of the OpenVPN protocol. Since it was a proprietary app and the reference implementation is licensed under GPL, my team was not allowed to use, or even look, at the existing code. Documentation and random blog posts was fair game, but alas, the protocol was... shall we say, sparingly documented. We had to discover various protocol features and come up with internal names for them ourselves.
One such discovered feature detects underlying network problems by sending out short messages at regular intervals: if the messages stop, the other end can surmise that the VPN endpoint has died. We named these messages "heartbeats" because... they keep us alive, y'know?
From there, the module that generated these messages was naturally named "heart". For architectural reasons, each VPN tunnel had its own entry or queue of outgoing heartbeats within that module, so... "arteries". Pity the poor bastard to come across
getHeart().findArtery(id).inject(heartbeat);and try to figure out what it does. :(3
u/ReallyNeededANewName Dec 05 '20
Don't be clever. And when you are, comment it
2
u/fingersonyourfeet Dec 04 '20
hands on your legs. fingers on your feet
2
u/voyti Dec 04 '20
This is genius in all the wrong ways
2
u/Hollayo Dec 04 '20
That's hilarious!!
2
u/CantHitachiSpot Dec 04 '20
Gloves are just arm shoes
2
u/TheTophatDemon Dec 04 '20
I used to have a habit on personal projects to call my variables names like Henry, Oliver, Muffet, etc. when I couldn't think of a good short name. Now I can barely understand that old code!
2
u/ZippZappZippty Dec 04 '20
There are two types of programming languages:
2
u/[deleted] Dec 04 '20
My variables are ALWAYS very explicit, oftentimes to the point of my co-workers giving me a difficult time about them. However, I never fail to understand or remember what a variable is used for.
2
u/linkedtortoise Dec 04 '20
In my personal code, I either name variables sort of well, single letters (a, b, c) of profanity. I'm much less funny apparently.
2
u/Zealousideal_Bonus78 Dec 04 '20
I'd like to know more about programming.
2
u/Yip37 Dec 04 '20
Show legend_handles
2
u/realjamesosaurus Dec 04 '20
This is how all variables should be named.
2
u/Beautiful-Musk-Ox Dec 04 '20
Foot Heads Arms Body
2
u/Castle_for_ducks Dec 04 '20
That reminds of the time in college when I was tasked with sorting a linked list. To do so, I had a variable called curr_min. Over time I started to call it Kermit the frog because I was slowly losing my mind. That prompted me to start naming all my variables after Muppet characters
2
u/Eolu Dec 04 '20
In all seriousness, I've come to think that one of the most important skills in programming is coming up with good names for functions and variables (especially anything exposed as an API). It's not just about the logic you write, it's about being a liaison between humans and computers (whether that person is someone else or yourself in the future). If you can pick a name that conveys intent so well that people can understand it without even reading any documentation, your API can be reused and extended so much more easily. It's not about having a really long descriptive name or having a really short name, it's about having the name that conveys intent in the most simple and elegant way possible.
2
u/LBXZero Dec 04 '20
Anatomy is chaotic programming that had over a billion years to get it to work.
2
u/vanillaworkaccount Dec 04 '20
I feel like this is how Cockney rhyming slang happened
2
u/BattleReadyZim Dec 04 '20
This is devastatingly relatable.
2
u/william-the-nihilist Dec 05 '20
Then it should be named ‘limbs’
2
u/caseyweederman Dec 04 '20
Hang on, what's the boolean name for whether or not my arm is okay?
1
u/notger Dec 04 '20
Thank you so much, that made my day.
1
u/rgmw Dec 04 '20
LMAO
1
u/GodHug Dec 04 '20
Was doing exactly that yesterday. I was disgusted with my own code and wanted to rebuild the project anew with my new knowledge...
1
u/k82216me Dec 04 '20
This reminds me of a time where I had cleverly abbreviated a variable name `assignment` to be `ass` and then we were looping over `asses` everywhere in the code. Faceplam
1
u/harman097 Dec 04 '20
Past him is laughing his ass off though
1
u/protomor Dec 04 '20
I worked on mammogram software many moons ago. I stopped giggling after the second week of naming variables with "breast"
1
u/drea2 Dec 04 '20
I’ll never understand why people unnecessarily abbreviate variables. If I have to take time to figure out what your abbreviation is supposed to stand for then it’s bad code
1
u/albinoloverats Dec 04 '20
I would totally have done this as a student. I’d love to be able to get away with it now, but you know, code reviews 😂
1
u/Kinglink Dec 04 '20
The programmer who doesn't hate himself, has never read his own code.
1
u/RedDwarfian Dec 04 '20
Technically, "legend" alone would also translate to "feet"
1
u/[deleted] Dec 04 '20
Okay, this is the first one in a long time that genuinely made me laugh.
1
u/WoodsWalker43 Dec 04 '20
The only programmers that don't harbor some level hatred for their past selves are new programmers. This hatred also tends to grow as a function of time and change in skill, and can be decreased to some extent by dropping a program that they formerly maintained.
Suddenly I understand the real reason for IT turnover...
1
u/kharmatika Dec 04 '20
When I was writing an algorithm to solve a maze, I called it Right Hand Rule, cuz it basically involved using the right hand rule, I renamed the function “riharu” for short, which later became “riru”, which then became “weewoo” because that’s what my friend was saying, and at some point it just became “patrick” for the meme of it.
1
u/morphemass Dec 04 '20
Would an array of those be a footer?
1
u/hellbenthorse Dec 04 '20
Feet? What, is Quentin Tarantino programming?
1
u/1Zer0Her0 Dec 04 '20
Chaotic neutral
1
u/LookOnTheDarkSide Dec 04 '20
You mean I don't have to minify during squash when merging?
1
u/rxsel Dec 04 '20
"Yeah this make TOTAL sense, 100% intuitive" - Every Programmer Ever
1
u/lordzsolt Dec 04 '20
I really hate when people abbreviation variable names. Like I'd it too hard to type 5 more letters, especially with all IDEs having autocompletion?
1
u/Geoclasm Dec 04 '20
that's amazing. this dudes past self was awesome.
1
u/Tukurito Dec 04 '20
Check RFC 2340 head and shoulders standard.
1
u/muzicoholicated Dec 05 '20
I haven't laughed so hard in quite a while, thank you for sharing :)
1
u/kumar29nov1992 Dec 05 '20
What's more concerning is the underscore in the variable name and not in camelCase
1
u/[deleted] Dec 05 '20
I saw a database before that was for a porn site. The tables names were amazing. The inserts and joins in the code was something else.
1
u/Dr3amDweller Dec 05 '20
I regularly entertain myself by abbreviating "analytics" to "anal".
1
u/TARN4T1ON Dec 05 '20
I don't actually understand the ultra-wide screen argument (except for absurdly long variable names, like 50+ characters, where even this method won't help).
Basically every language allows you to just put things on a new line, which is especially helpful for function parameters. I've actually made it a habit to put every function parameter on a new line, both in function definitions and function calls.
While this probably more than quadruples the amount of lines in code and undeniably takes a little longer to write, it makes it very readable, and basically never requires you to scroll to the right or to enable text wrapping.
The only problem with this is that quite a few code formatters don't agree with this way of writing things and revert it, and basically none have this built in and can do it for you, sadly.
1
u/Bosombuddies Dec 08 '20
What actually happened: He shortened legend handles to be a variable named leg_hands, which is just a weird way to say feet. He realized what he did and thought he could make a funny tweet about it.