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;
```
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.
Use a minifying tool. Keep the long variable names and let the tool change “myLongAssVariableNameThatDescribesASpecificUse” to “a”
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…
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());
Some languages have more descriptive (and strong) types than others.
Regular PR: - 100 comments about formatting - everyone missed how Im mining bitcoin
Dawg, context based autocomplete is something even base VIM does! 😭
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
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.
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.
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
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.
Please rename to stopShorteningVariableNamesISwearToGod
I learned to program on ZX Spectrum. All variables were one character long.
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.