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"
-
Just saw a variable in C named like this:
long time_ago; //in a galaxy far away
I laughed no stop.16 -
Programmers: Always use descriptive variable names.
Mathematicians: Single letter variable names always, ideally from obscure/dead alphabets.
Src: Twitter16 -
Some ideas for variable names. Thank me later :))
1. bool sheet;
2. int entionally;
3. char mander;
4. double penetration;
5. string cheese;
6. long schlong;23 -
A variable walks into a bar. Constant bartender: "We don't serve your kind here!"
Variable: "What kind?"
Constant: "You know, sluts!"7 -
Code: if(customer.primaryContract)
Boss: "just using a variable as a boolean isn't very readable"
Me:
if(!(!customer.primaryContract != !true).toString() == 'false')13 -
In all honesty, if there was a course on giving variables good, informative and not completely stupid names... I would take it.13
-
Copy code from StackOverflow and paste it. Then complaint on why is it giving a Variable Not Found.1
-
Variable naming at its best...
Took only 2 hours to notice the difference between leftToRight and lefttoRight11 -
*1 week into dream job*
Me: I need to communicate this variable to a script running in another thread, how do you normally handle that?
My Lead: oh, just add it as a global variable
Me: oh no...3 -
Interviewer:"what's the challenges you often face in programming?"
Me:"naming variable, class and git commit message always trouble me as I'm a perfectionist."8 -
I can't be the only one who has at least once used a single = for a comparison and spent ages wondering what went wrong 😑8
-
It's so hard to pick a good variable/class name, how the hell will I be able to pick a good name for my future kid?5
-
"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.16
-
"You should name a variable using the same care with which you name a first-born child." - James O. Coplien9
-
Coworker 1: Ugh, what name should I give this variable? Any idea?
Coworker 2: Doesn't matter that much. Just give it a name.
Coworker 1: ** Types in "albert" **7 -
Naming contest:
These two 'new' servers need hostnames.
Names must be within the following constraints:
* Names must be female
* Names must be pronouncable and writable in ASCII standard set of characters.
* Names are preferred to reference to duo's, like sisters, twins, dynamic duo's like chip and dale, but female.
Previous servers were name 'tairu' & 'mairu' (heroic age) and 'karen' & 'tsukihi' (nisemonogatori)
Let's see if the devrant community can surprise me.
Entries will be closed within 48 hours of this post.84 -
The best job denial letter I've ever seen was sent to my husband and said:
- We already have too many people named Eugen in our company.2 -
Me:
*decompiles swf*
*thinks: "what is this shit?"*
*scrolls down*
*finds variable named "randomShit"*6 -
I have a variable called 'stuff'. It's a test to see if my colleagues really read my pull requests.3
-
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
-
Proud dev moment : as I was following the variable naming conventions from my company, I got to name a variable "l_o_tr" 💪9
-
Me : *wants to refactor a variable*
Visual Studio : Ok! Type the new name of the variable
Me : *backspace one time to remove a char*
VS : *erases ALL the name of the variable and ALL the usages of the variable, and no possibility to undo*
Me : ..... that was a dick move you know.9 -
Then there's that awkward moment when variable "count" doesn't work because I called it "cunt" later on.6
-
I teach kids (7-12 years) to programming. Yesterday my colleague had the last class for this semester, where parents joined their kids to see what they done. They were presenting their projects, and a guy whose father is really strict with him, saw what variable names his son was using. Some of it (censored) are: "d*ck", "p*ssy", "f*ck". The guy is really scared of his father, because he's agressive with him all the time. I don't want to know what was his punishment for this.5
-
why the fuck people name variables endig with numbers? why? how the hell do you even figure out what's what?
checkStatus1
checkStatus2
checkStatusMyAss10 -
Found a "great" variable name while maintaining legacy code:
{
...
Report goodbye = Report::first($id);
goodbye->delete();
...
}
Goodbye report! 😂😂😂 -
Have you ever been at that desperate point where you start naming your variable and functions into something like "pleaseWork"4
-
Classmates having trouble with their mess of spaghetti code and improperly named variables (I saw variable names like "poop" already).6
-
Just why????
long d = date(toDate) - date(fromDate); // days
Please just name the variable days............3 -
"The variable has been removed during optimization and is not available".
Sometimes I really hate Visual Studio...14 -
Why yes, it makes total sense for a variable called `$connectionString` to only accept either booleans or integers ... wat
Also beware the beauty on how well that names conveys the variable's intent.
FML3 -
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 -
I had defined a variable earlier, 'count', that I was trying to access later on in the code. Kept getting errors that the variable didn't exist.
When I looked, I had actually named it 'cunt'.
Best typo ever, gave me a good laugh as opposed to the usual annoying typos in programming.2 -
As à french developer, today I learned we can use accent in variable name.
Like let étude = undefined.
Why would use accent in variable name ? Huh ?
I wonder if I have to fire the guy who made me discover this.9 -
When you use yourself as a rubber duck and you realize how much of a dumbfuck you are...
Fuck me, I was using a variable called staticHTML in ejs template. But when passing the variable, I was using staticHtml.
Goddamn7 -
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.
-
Came across 'var3' and 'var15' while debugging Hybris. What the actual fuck SAP, since when do you hire preschoolers to code.2
-
Syntax for my proposed "unsure" programming language.
Variable declaration:
let's just say that <variable name> = <value>
Function declaration:
hypothetically, we could <function name> (<args>){}
Try/ catch:
it's possible that
{
}
...or not (<ex>)
{
}3 -
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
-
When your dev's copy and paste code and don't bother changing the (completely irrelevant and misleading) variable names.2
-
Figuring out where to put my devRant stickers is like picking variable names.
Except you can't refactor stickers... -
I should probably rename this variable...
Every time I read/type it, my inner voice goes "for fucks sake"....4 -
Superpower to instantly create variable names every time I need to declare a new variable based on the perfect matching with the code being written..
-
Never know why you need to add vanilla to make vanilla. Oh wait, it's just crappy variable naming.3
-
When u send ur code for review and instead of getting comments for logic u put in, u get 10+ comments regarding variable names , extra lines and formatting.
LMF7 -
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()5 -
My loop checked a variable, then the next 5 nested loops checked it again, then started over. It was a hard coded variable I forgot about.
I just made my code OCD -
I'm working with dictionaries today so naturally all my variable names are making me chuckle:
threshDic
saveDic
cutDic
Etc. you get the picture, it's the little things that get you through a Friday slog. -
Swap variable without temporary variable
meanwhile C:
a=a+b
b=a-b
a=a-b
while python:
a,b=b,a
Python be like:B*tch Please9 -
Challenge☕️💻🎊
_________________________
Changing value of two variables without using third variable.16 -
Only just noticed that CSS has variables - when the fuck did this happen and where the hell was I when it did!!!!8
-
I never understood why some developers _ before their Javascript variable or functions. Do they serve any purposes? Other they just make everything look bizarre12
-
Ah yes, R, the only language where a variable increment is harder to code than string manipulation :-)1
-
When you need to change a variable's value, but can't find the variable name since you're spelling it right.3
-
God I hate JavaScript.
Why on earth would some variable * somthing.other (where somthing is undefined) result in 653957364??????17 -
Oops!! I just forgot to increment a loop variable in a while loop. ended up in an infinite loop :(6
-
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 -
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 -
Variable assignment as declaration is stupid. Looking at you, Python 😑
You can never be sure whether you accidentally overwrite a previous value and you have to fuck around with global because it doesn't know what's an assignment to a global var and what's a declaration. It's just not as satisfying as doing it explicitly and only leads to errors24 -
Hello from firefox nightly running on pure wayland by default.
Just set env variable and wohoooooooooo. now this feels nice.5 -
When people use one character variable names in their code I'm just like:
How do you guys live like this... 😰1 -
class XXX
{
public:
std::vector<std::wstring> m_Files; // Recently used files
why not just use:
class XXX
{
public:
std::vector<std::wstring> m_RecentlyUsedFiles;
FFS4 -
I hate dumb variable names as much as I hate people who don't signal when they drive.
Never mind the fact that there's a validation-state variable inside his controller, separate rant.1 -
Names a variable Y, names another Q, yet another U. While still writing looks back at Q. What's Q supposed to mean? Closes laptop and walks away.
-
Obviously, I overdid it with the assembly study assignment this morning - just tried to bit-mask a variable using "andi". In C#.2
-
I am ashamed to admit that I only learned recently that omitting 'var' in a JS variable declaration inside a function gives the variable global scope. So that's why it wasn't working properly....6
-
This Safari Bug is sooo bad, really hard to find it. (It initializes new variables with the element where id and variable name is the same, why?)10
-
Saw a counting variable in code. It was a necessary counting variable, so that is not what this is about.
However, this is a US based company that has a somewhat PC (no cursing) and professional cultural facade.
This variable was called "cnt". How the hell did that one not get caught in peer review? I have gotten dinged for having "possibly offensive" variable names (think Point5Hit though I have never written that as a variable name). It was funny. But I have changed it because that's just lazy.9 -
Wtaf?
why are there only two of seven characters of the Webservice password, when the request goes out in my docker container?
Answer:
The password was retrieved via PHP getenv()
Soooo....
If there is a $ in an environment variable, this $ has to be escaped with $$.
fml
Everyday another thingy to learn ^^
xD1 -
What’s your preference for a simple if without shorthand:
if ($variable == ‘test’) echo ‘’hello’;
if ($variable == ‘test’) { echo ‘’hello’; }
if ($variable == ‘test’) {
echo ‘’hello’;
}27 -
Unsure , if I should name my variable name as 'info' or 'infoFromDbAboutUser_RequiredForSessionValidation' for a method named 'functionToValidateUserAndCheckSessionIdOrAssignSessionIdIfNotAssigned'
Please help, I am unable to decide. :/10 -
I needed to update this function to add some more functionality. And this is what i did.( I did added more functionality though)
Will I be fired?5 -
I'm so used to camel casing variable names that when I wasn't concentrating properly just now I called a variable "outPut"1
-
RANT: So in school, we have to program using some kind of pseudocode.
Today we wrote an algorithm from a previous exam. Apparently, they don't give you a mark if you get the Array.length(). To receive the mark you have to have to use a variable.
WHICH MAKES ABSOLUTELY NO SENSE TO ME.
My teacher said it would even be ok to define a variable like Variable = Array.length. THAT MAKES EVEN LESS SENSE7 -
Is it just me or is the first question of the gcse computer science exam the hardest question in the world?7
-
Anybody else really dislike jQuery coding standards? Like who decided $ was a nice & informative variable name?2
-
*writes programs with variables for arguments*
Runs.. Crashes
*removes variables places exact same code in parameter list*
Runs.. Succeeds.
I don't understand you my GPU -
People that argue that anyone who doesn't understand their one or two letters long variable names are idiots.2
-
"Tahnik, it's about your code that I'm reviewing. There's bool variable called homeMainCreatePostChoseImageFromLibrary. Any idea what that variable is doing?"
"That's the button the user can click to chose an image from library when creating a post"
"Oh ok. Can you put a comment on that variable?"
"..."4 -
Does anyone else include greek letters in their JavaScript variable names just to fuck with co-workers?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 -
Powershell is fucking great. Expand my shitty variable before I call the applet. Fucking call the applet and you shit yourself stupid and think the variable is now empty. Take my variable and shove it up your daft gigantic ass powershell. Fuck you.
-
When my teacher says that you have to produce variable lists for each variable in your program, stating the name, type and what they're used for, if you're coding in Java, you know you're fucked with 16 classes of swing GUI...1
-
Thinking how the fuck did the variable became undefined and realizing you defined the variable in an asynchronous rest call...
-
After a few months of working in an actually well coded project, I'm back in the one where I find abominations like this every day:
boolean result=false;
<do stuff>
if(<condition>){
<do stuff>
return true;
}
<do stuff>
return result;
Do they even read their code before submitting? -
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!?!?9
-
Focused on debugging Javascript after being asked for help. Original developer narrowed it down to an if statement. It was acting like the if statement was assigning the variable and causing undefined. Tested console.log before evaluation. Tried !== instead of != and same thing. Even swapped undefined and variable so it would try to assign a variable named undefined instead... It took way too long for the both of us to realize the word "let" in front of the variable on the line withing the if statement block... It overwrite the variable the moment it entered the block.... FML.1
-
C++ Really confuses me... I mean why when defining an array variable is the array notation on the variable name rather than the variable type?1
-
my coworker made a scss-variable for $white. in case white should anywhere soon get a new hex-value3
-
My most challenging task during development is choosing variable names.
I make a mess during this process.5 -
A little help on Django
So I just started learning Python and Django Framework and I have one question...
Are the variables shared between visitors?
I mean, let's say I have a variable named "school"
school = "school1"
A visitor from X location enters and changes this variable to "school2". A new visitor enters the page from Y location and reads the variable 'school'. What is going to show on visitor Y? "school1" or "school2".2 -
Not sure if other programming languages class a Boolean as an integer value buuuuuuut...
The amount of times I've seen people do code such as...
if(value == true) {
variable = "blah blah";
} else if(value == false) {
variable = "blah";
}
Instead of doing a simple 1D array and going...
variable = strings[value];
It drives me crazy, such a small thing that has no real benefit but... Ugh... Whyyyyyyy3 -
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
-
My partner randomly commit to the git.
"A missing semi colon"
"initiate a useless variable"
"adding comment to obvious code"
Hmm ok im done for the week.1 -
Javascript in a nutshell:
Function in a teaching example for a framework, checks for validity of input, dev returns null instead of false when it isn't. In another place, uses !variable to check if variable is 0.
fucking follow the semantics of the code you write cunt why do you have to do this why is it so hard to write variable !== 0
I'm sorry, this really triggers me.
https://media.giphy.com/media/... -
I tend to write with long variable names instead of using too many comments to explain what i am doing in the code. Is it wrong?1
-
Just fixed a bug I was working on for the last 2 days.. I have set a variable to 1 and everything is working now.
-
I just watched a friend scroll up on our python file to copy the string from a variable so she could paste it to concatenate it...
-
Just use a promise that sets this variable, and then you can use the variable as long as its after the promise declaration.
No, just no. Thats not now asynchronous code works.2 -
Maybe I shouldn't code today... or get more sleep.
Every single bug I had today was due to referencing the wrong variables... and not including 'this.'
How do you guard against creating variables with the same names in method and class scope?2 -
First assignment after I learned about if-else-then and for loops: draw swastika with modifiable width variable2
-
Spending too much time on smaller decisions sometimes. Spending 5 minutes thinking about naming a variable and such.
-
Just to clarify my previous rant:
In this case, refactoring meant changing class, method and variable names -
I wish I could be the man who creates strings with .toString() or even `${variable}` consistently. Alas, ""+fuckThisShit.
-
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
-
Hate when I forget I rename x variable to y just for the compiler to fuck me in the ass by telling me x variable doesn't exist. FFS!!!1
-
Spent the day refactoring old copy-pasted astronomical code with minimal commentary, cryptic variable names and missing mathematical symbols. Self documenting code my ass.1
-
I once declared and initialized a variable with a default value all together. (var a= "default";)
And in a certain IF condition the variable value has to be changed, so i was changing the value of the variable inside IF condition. If (x==y) { a=" newVal" ;}
During a code review i was asked why i am not assigning the default value in ELSE condition. And i was like whut 😑.
So........ Some Programmers be like IF shouldn't exist without ELSE.6 -
Ok Hibernate, when a variable has "ID" in it, you write the variable with "ID" in it. Not "Id".
Took me long to see that.
(yeah I should have wrote Id tho. But that's not the problem here) -
Spend the whole day trying to figure out why that API call returns undefined...
Whitespace character after the variable -
I know lets create a method that does nothing like this other method, but call it the same thing with 'get' in front. Won't confuse anyone at all that3
-
Setting the path veriable is as tricky as finding path to some hidden delicious food joints...Ahh atlast my python is moving
-
R
Dot can be used for variable name just like underscore. And to confuse, R has object oriented also2 -
The web application which I'm making is fucking big for 1 person and suddenly I'm out of sensible variable names :@
-
tabs spaces oses languages what about using I instead of counter or index as a variable for for loop2
-
Do you put Caps to public variable ?
My IDE was doing caps to public variable but someone told me that he was wrong it's not caps for public variable only functions.9 -
Those of you working with .NET, do you prefer C# casting syntax:
(Type)variable;
Or VB casting syntax:
variable as Type;3 -
Fuck This.
I thought I was good at giving nicknames (to friends) then suddenly you run out of variable names.
:/2 -
In a legacy application i support written in classic asp, the guy who wrote it names his variable 'ok2go'
where d heck was he going? 😞😞😂1 -
I am asking here, because even stackoverflow community don't know the answer...
Does Doctrine DBAL support oci variable binding in Oracle or not? I need to know but there are no answer so far...
Hopefully, someone here knows :)1 -
Just like we have code developers there serious code breakers (if all is well, they atleast change the variable name)
-
'Every variable is a static constant once declared'
All variables in PuppetDSL, really hard to wrap the head around if you are 'used to' re-assign a variable a new value.5 -
back into some quick and dirty opencv scripting for the afternoon to try to get a report out the door, and boyhave my variable names become, shall we say, gigidy inspiring:
longexposure = np.uint8(cumimage/float(len(ims)))
stacked = np.hstack({cumimage, longexposure}) -
When coworkers leave their laptop unlocked we find a commonly used variable name and replace all name references with 'poop'
-
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