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 becameleg_hands
, which then becamefeet
sometimes I truly hate my past self
I have done similar things lol
In your past self defense, thats hilarious.
Im sure debugging through that wasnt.
No, no, I think you were onto something there
git blame:
YOU, MOTHERFUCKER!
You have no one to blame
but yourself
Kinda want to start calling my feet leg hands though
Documentation has left the chat
What does caraccy mean
(full name) player 1 object character (or just car if theyre driving a car) acceleration Y-axis is my best guess
Could be p1ObjCarAccY, at least the word can be separated
But why cant it be p1CarAcclY (acceleration became accl to avoid confusion with "accuracy")
Actually, why am I even taking this too seriously lol
No no, it IS accuracy. It’s for implementing how much the camera shakes vertically when attacking
thats the joke
player1ObjectCarAccuracy or player1ObjectCarAcceleratorY
It's in fact "CAR acc y".
It obviously stands for Critical-Arithmetic-Register-Accumulator-Yield.
stopShorteningVariableNamesISTG
Oi. Stop shortening your variable names!
I bet it's part of the joke.
I never understood why devs are so allergic to long variable names? I rather know what your variable is for than it being short
Since Objective-C was one of my first programming languages, I started off being used to ridiculously long variable and function names. For example, from Apple’s official code (before they transitioned to mainly Swift):
``` - (UISwipeActionsConfiguration *)tableView:(UITableView *)tableView trailingSwipeActionsConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath;
```
People get allergic to it after they see some kind of Java nonsense like:
IReducedWidgetFactoryFactoryHandle<RobotWidget> westCoastRobotWidgetReducerFactoryFactoryHandler = new ReducedWidgetFactoryFactoryHandle<>();
westCoastRobotWidgetReducerFactoryFactoryHandler.generateFactory().generateWidget(COLORS.RED_AND_BLUE, urlForRoboticsData.asSafeUrl());
Which resource constricted environments keep variable names during runtime?
Yeah don't a lot of languages optimize things like that away during execution?
Like a 15+ character variable name gets converted to a single letter after the compiler converts the code to machine code no?
Uhm, axchually machine code doesn't have variable names 🤓
Yes, but not every language is compiled into machine code. Scripting languages are usually interpreted at runtime dynamically.
First of all, there are more or less no directly interpreted languages. Show me one.
Not even Python does that.
It's all at least byte-code.
Besides that, I want to see prove that long symbol names could cause a directly interpreted program to run slower than it anyway runs. This claim is imho ridiculous.
Clearly written out text is difficult to read and understand? Especially in comparison to some asldkfjalsdkjf bullshit?
WHAT?!
Some people simply shouldn't be allowed by law to touch any code…
Use a minifying tool. Keep the long variable names and let the tool change “myLongAssVariableNameThatDescribesASpecificUse” to “a”
Some languages have more descriptive (and strong) types than others.
Which is irrelevant as you don't write and read type names but symbol names!
Most of the time the types are anyway inferred, so you never see them.
I take it you’re not familiar with the history of Hungarian notation?
Regular PR: - 100 comments about formatting - everyone missed how Im mining bitcoin
Dawg, context based autocomplete is something even base VIM does! 😭
Please rename to stopShorteningVariableNamesISwearToGod
People who don't understand that code is read many times more often than written, and that it's therefore most important to optimized for reading, never for writing, shouldn't be allowed by law to touch any code, imho.
This brain dead abbreviation bullshit needs to have an end!
There is absolutely no reason to use abbreviation since autocomplete exists. Especially as autocomplete has has fuzzy matching.
If I need more than like… two words in a variable name, something’s wrong. Usually about when I decide I need to break out into another function, honestly.
If I need less than three words in a variable name, that's when I go looking for other important clarifications I can add to the name.
I feel like ScopeName.VariableName should usually be enough.
GetReplies(RootComment) for example feels… sufficient. To each their own though.
Because scrolling horizontally to see the entire line is annoying.
use a smaller font size
edit: and break bracketed code into multiple lines for clairty anyway
Skill.. i mean Screen Issue
Also use word-wrap
Yeah sure, that's a great excuse to write cryptic shit!
(Besides it isn't, as other pointed already out…)
the thing is the autofill is dumb and i need to type out the first word and then part of the second word to get it to get the right one, and typing out a single word is hard :<
There are however IDEs (anything from Jetbrains) which support camel case autocompletion.
As a Java developer, this IntelliJ feature is extremely useful.
Do you code in notepad?
All text editors worth their salt have fuzzy matching. Since decades…
I have a senior who likes to call the struct pointer passed to the function
struct * obj
Just . . . dude. No.
... sure... p1obj == player one object but wtf is a caraccy
car account??? Y-axis ig
I learned to program on ZX Spectrum. All variables were one character long.
My condolences.
Thanks God we're over this since decades, and now there exists no reason to write cryptic code. Besides being a stupid dick, of course.
OP must be an Objective-C fan.
Famously long variable names.
As for me? Nah. I like short but obvious.
A single letter for loop variables if it's solely for the loop, otherwise naming what it is.
If I have to move my eyes or my head to see the whole name, it's way too long.
My goal isn't description, it's efficiency. As readable as possible, while being as short as possible. Functions should be a few lines at most. Single-line functions should be in-lined, instead, unless it's to create a single place to change something. Reuse of code to do a lot of similar tasks is the goal.
Then, any time it's too complex to understand but space-savings are significant means it's a place for a comment.
OMG!
I hope I never have to see that garbage.
Using comments instead of properly naming things is the most ridiculous shit I've heard in some while. BRR!
Nono, you misunderstand.
I always try to properly name things. Comments are for when the logic doesn't make sense at first glance.
I'm an avid supporter of "code should be self-documenting"
There are two bothersome problems in software development:
The off-by-one errors increase significantly when you program in Lua
Do you have scientific prove of this claim?
I bet the issues only move elsewhere, as the problem is always the same.
The correct solution would be to have two functions:
offsetBy
(currently wrongly called "index" by most people) andindexOf
(which is missing in more or less all programming languages).I've never had issue with point 1. I can still deal with point 3. Point 2 makes me want to kms.