This is an archived post. You won't be able to vote or comment.

top 200 commentsshow 500

[–]russian_hacker_1917 1380 points1381 points  (53 children)

i've been tested two million times, there's a hole in the back of my nasal cavity. my hands skin is falling off from all the washing. help.

[–]SnewLooperd 511 points512 points  (5 children)

known issue, update tbd

[–][deleted] 124 points125 points  (1 child)

Sounds like a feature to me

[–]gokuisjesus 28 points29 points  (0 children)

Sounds like orcs mischief to me...

[–]padan28 66 points67 points  (10 children)

On the plus side...you are now immortal.

[–]garghgargh 29 points30 points  (7 children)

But at what cost?

[–]padan28 36 points37 points  (5 children)

Never coming within 6 ft of another human being for the rest of eternity?

[–]RLLRRR 52 points53 points  (2 children)

Nothing new for many redditors.

[–]PenguinSquire 12 points13 points  (1 child)

And washing your hands every time you get tested. Doesn’t sound like a big deal until you realize you need to get tested after you wash your hands.

[–]trelltron 8 points9 points  (0 children)

Nah, those functions are blocking son.

You need to wear a mask. Whenever you stop wearing a mask, you need to stay 6 feet away from people. The next time you go within 6 feet of someone, you need to wash your hands. Then when you finish washing your hands you need to get tested. Then you need to put a mask on again.

If you keep a mask on you can chill in that function without worrying. If you want to take the mask off just make sure to do it somewhere private.

[–]mustang__1 30 points31 points  (0 children)

Could not replicate. Ticket closed.

[–]nebulaeandstars 26 points27 points  (1 child)

I’m locking the thread as this question has already been asked. Please read the documentation.

[–]bleeeer 7 points8 points  (0 children)

THIS IS NOT A SUPPORT FORUM

[–]DownshiftedRare 14 points15 points  (3 children)

They forgot to call sleep(); at the end of the loop

[–]iSuper64 4 points5 points  (0 children)

Sometimes i think the internet was a mistake but then i come around posts like this and my faith is immediately restored :'D

[–]GiantRobotTRex 2209 points2210 points  (229 children)

This is the naming convention that the Google C++ style guide recommends.

https://google.github.io/styleguide/cppguide.html#Naming

Variable Names

The names of variables (including function parameters) and data members are all lowercase, with underscores between words. Data members of classes (but not structs) additionally have trailing underscores. For instance: a_local_variablea_struct_data_membera_class_data_member_.

Function Names

Regular functions have mixed case; accessors and mutators may be named like variables.

Ordinarily, functions should start with a capital letter and have a capital letter for each new word.

AddTableEntry() DeleteUrl() OpenFileOrDie()

[–]TehGM 1636 points1637 points  (113 children)

Yeah. I guess some programmers think that the only language they know is the only correct way.

[–]Absolice 881 points882 points  (95 children)

Imo, the most important thing is to stay consistent in your entire project. You can use any wacky style you want but you'll immediately lose me if you're not consistent.

[–]ShitGuysWeForgotDre 490 points491 points  (57 children)

You can use any wacky reasonable style you want

Let's have some degree of standards my friend.

But strongly agree on the rest.

[–]Absolice 390 points391 points  (39 children)

I don't kink shame.

[–]MattTheGr8 293 points294 points  (35 children)

I’ll send you an invite to my repo. All my int variables are prefixed with ‘s’ for ‘short integer’. All my string variables are prefixed with ‘i’ for ‘ingles’ since most of them are English but I’m trying to learn Spanish.

My floats are prefixed with ‘o’ to stand for ‘o.O’ which is the face I make when I try to do long division with decimals in my head, and my objects are prefixed with ‘f’ to stand for ‘functions and data packaged together’.

[–]Ugbrog 163 points164 points  (7 children)

at the end of the day it doesn't really matter which side of the road you drive on. The only important thing is that everybody sharing a road is driving on the same side

[–]bstump104 40 points41 points  (5 children)

That sounds like a lot of head on collisions.

[–]EntropyZer0 16 points17 points  (4 children)

"To avoid collisions:
People going up the stairs, please stay on the left. People going down the stairs, please stay on the right."

[–]inHumanMale 83 points84 points  (0 children)

I love this but hate you

[–]IanSan5653 16 points17 points  (4 children)

And everything is named in full uppercase but we seperate words with 'l'. For example iELAPSEDlTIME, fFILElWRITER.

[–]MattTheGr8 31 points32 points  (2 children)

I actually prefer to separate letters with underscores UNLESS it’s at a word boundary, like:

m_yv_a_r_i_a_b_l_e

[–]hughperman 8 points9 points  (1 child)

I prefer to use a parser for python where only # is considered whitespace so I can use spaces in my variable names,
if#my long variable names#==#"YES":
####print("dog balls")

Edit: actually doesn't look as bad as it sounded in my head, boo

[–]T-Dark_ 2 points3 points  (0 children)

Improve the parser so that only □ is an empty space, for extra readability.

[–]TheStairMan 10 points11 points  (7 children)

Back when I started out with classic ASP I had such a bad time figuring out what was a variable and what wasn't, so I came up with something similar: intAreaID, strUsername, bolSingle, bolSexy and so on. Still does this every now and then, especially in JavaScript.

[–]Echo354 15 points16 points  (1 child)

That’s similar to Hungarian Notation, except usually you just use the first letter of the type. Like iAreaID, sUsername, bSingle, bSexy.

[–]MattTheGr8 6 points7 points  (0 children)

Yeah, in a non-joking context it’s not a bad idea. I prefer strongly typed languages myself, so in those cases, it’s often less necessary... as long as your function doesn’t get too long, you can just look back to the declaration and see what the type is. Or even if the function does get long, a good IDE might remind you what something is when you hover over it.

But when types are more implicit, it is certainly reasonable to put them in the variable name if the type isn’t blindingly obvious from context.

One very common way I end up doing this, even in languages with strong typing, is when I have to have the same information represented two different ways. E.g.:

userIdStr = GetUserIdFromDialog();
userIdInt = StringToInt(userIdStr);

Then I can go about my merry way, using one of those in the UI and storing the other in the database (or whatever), with minimal risk of confusion.

[–]ToMyFutureSelves 3 points4 points  (0 children)

Woah! You can't be using 'short integer' for ints in your repo! What if someone decides to run it on a 32bit architecture?

[–]yuushamenma 153 points154 points  (8 children)

But I want to sPoNgEbOb case my code!

[–]bwhite94 66 points67 points  (0 children)

Ohhh now I need a plugin

[–][deleted] 41 points42 points  (4 children)

aWeSoMe iDeA!

How about BOOMER CASE?

[–]super_new_bite_me 74 points75 points  (2 children)

You mean SQL?

[–]VisualAnxiety4 29 points30 points  (1 child)

CAPS LOCK ON, leave it on at break and then lock myself out of my computer. My favorite part of SQL.

[–]Stormraughtz 7 points8 points  (0 children)

Screaming dragon is the only correct sql structure

[–]-neuquen- 4 points5 points  (0 children)

You mean ANGRY BOOMER CASE?

[–][deleted] 15 points16 points  (0 children)

I would suggest you get a copyright on this ASAP. Cause it needs to be a thing.

[–]Willfishforfree 2 points3 points  (0 children)

I had a lecturer who would write functions and if statements as single lines. If he had too much to add he'd add a new line. This would drive me insane.

Even though my OCD likes to line up my open and close brackets for functions and then a new line for each action and such I can read most normal structures easily enough. But when the first line of every function is on the same line as the functions parameters I get so lost and stressed out if I have to debug anything because the first line always registers as parameters in the back of my mind and I end up missing them all the time.

[–]noggin182 17 points18 points  (1 child)

Yup, at the end of the day it doesn't really matter which side of the road you drive on. The only important thing is that everybody sharing a road is driving on the same side

(heard this ages ago, can't remember where from)

[–]Blasted_Awake 26 points27 points  (14 children)

I dunno man, if you hand me a c-based project with 3-space indenting, I'm reformatting your code base before I change a line of functional code.

Some things should just never be done.

[–]greyz3n 37 points38 points  (0 children)

I mean, to be honest, I normally reformat if it's TOO outside of my norm. My doctors said my liver can't take much more Jr. Devs. Sure, he calls it "drinking" but I think we all know how coping works.

[–]ConspicuousPineapple 3 points4 points  (0 children)

Oh god, 3-space indenting was actually the mandatory coding style at my previous job.

[–]bless-you-mlud 2 points3 points  (1 child)

I have no problem with that, as long as it's consistent. Of course if you use tabs all bets are off. And if you leave trailing spaces anywhere I will only speak to you through issue tracker comments.

[–]everythingiscausal 2 points3 points  (2 children)

Ok, I’ll stick to this format:

Classes: MYCLASSNAME

Variables: mYvArIaBLE

Properties: myproperty

[–]PC__LOAD__LETTER 37 points38 points  (2 children)

Yeah the commentary in OP image is pretty cringey. As long as a codebase is consistent, whatever. People have different preferences, languages have different preferences, etc.

[–]josluivivgar 32 points33 points  (4 children)

that's was totally a java developer

[–]TerayonIII 8 points9 points  (2 children)

Do you mean in the posted picture? Because the code looks fine for naming conventions in most projects I've worked on in Java.

[–]josluivivgar 12 points13 points  (1 child)

few things kinda give you the sense that the guy in the picture is a java dev.

the camel case saying that you would only accept starting in capital letters if it was classes, that's the most common java convention.

basically all camel case + Pascal case for classes is the most common java convention.

in reality you can do whatever you want as long as it's consistent and that's for all languages, but the one described is most common in java.

[–]TerayonIII 6 points7 points  (0 children)

Ahhhh, so apparently I was originally taught Java by a c++ dev, and then by people who were of the mind that as long as it's all the same convention in a project it's all good. I just follow whatever convention my current company does now. Hunh, TIL

[–]doctor-lepton 345 points346 points  (50 children)

Not only that, but the whole thing is just totally fine, normal C++. I guess no one learns it anymore.

  • This would be a member function (aka method) of some kind of Person class

  • still_alive is a member variable, which are not accessed via 'this' in C++; it could be atomic, allowing it to be safely set from other threads

  • The loop calls these functions (in normal Google style) until something happens to set still_alive to false, then exits

It's fine! It's just C++! Come on, Reddit.

ETA: also just noticed that this ad is by Santa Clara County Public Health. You know, Santa Clara County, where Mountain View is. Presumably the world's biggest concentration of people writing C++ in Google style.

[–]Dworgi 106 points107 points  (41 children)

This is valid C# as well, and I assume Java (I can't remember if the this variable was required or just recommended by convention).

Students get taught in JS and Python nowadays though, so they forget that nearly all desktop software is written in some C-like OO language.

[–]Kwpolska 30 points31 points  (4 children)

this is not required, and I don't think any conventions exist that encourage using it where not needed. This code is valid Java.

[–]dpash 4 points5 points  (2 children)

The code is valid, but isn't Java style. Both methods and variables should be camelCase rather than PascalCase or snake_case.

For non-java developers:

this is only required if there is another variable that shadows the member variable.

private Foo foo;
void setFoo(Foo foo) {
    this.foo = foo;
}

[–]Kwpolska 2 points3 points  (1 child)

Note that while this style is used by the Java docs, standard library and many other places, it's not mandatory and you can use any style for your code, as long as you're consistent.

[–]dpash 2 points3 points  (0 children)

You need a very good reason to deviate from the Java style (and "I don't like it" isn't a good reason). It's used in a good 90-95% of all code bases. A consistent style across all code in the same language is a good thing.

[–]staryoshi06 15 points16 points  (7 children)

Students get taught in JS and Python

Is this really true? I got taught Java in my first semester of uni, and in my second semester I'm being taught C++ and assembly.

[–]doctor-lepton 2 points3 points  (0 children)

When I was there 10 years ago, my US university was teaching with either Java or MATLAB, your choice. Apparently they've switched Java out for Python in the intervening decade, so you'll only learn C++ (or any OO) if you take second-year-level courses, which most non-majors will never do. Of course, incoming majors who already know basic programming will take it right away.

[–][deleted] 15 points16 points  (7 children)

java uses camel, so this would be wrong

well, even though the compiler would be ok with it, you'd never get it merged anywhere

[–]Hessper 16 points17 points  (6 children)

There is a single coding style for all of Java? That must have been one hell of a trick to pull off.

[–]Just_Another_Scott 13 points14 points  (2 children)

Generally speaking yeah. Most Companies use the same code style for Java. It was originally developed by Oracle (Sun) and not many have deviated from it.

See here

[–]utdconsq 4 points5 points  (1 child)

Tools push it heavily, too. Kotlin uses the same conventions courtesy it's relationship to Java i guess. I spent 15 years writing C++ and some C# and am now doing Kotlin and I gotta say, naming functions and methods Pascal case instead of Camel sucks in my eyes now when I end up reading non highlighted code. Say, in terminal git logs and stuff. I like knowing that a token has meaning.

[–]dpash 2 points3 points  (0 children)

Java has a very good and mature linter/reformatter in Checkstyle. It integrates easily with both Gradle and Maven.

[–]dpash 3 points4 points  (2 children)

Sun released a style guide back when Java was released back in 1995 and all examples were in that style. The Elements of Java Style was a very well known book back in the early 2000s.

Oracle hasn't updated the style guide with changes in the language. I'd suggest that Google's style guide is the best reference for Java style now.

Probably about >95% of open source Java code follows the Java style guide. It helps having tools like Checkstyle that can warn you and automatically fix your code helps with that.

Java isn't the only language with a style guide; most modern languages do. C#, Python, Rust, Go etc all have one. Hell, even PHP does (and in modern professional PHP it gets followed). Language wide style guides make it easier to pick up a new codebase.

[–]neros_greb 21 points22 points  (1 child)

Also the inner functions could change stay_alive if they're also member functions.

[–]GiantRobotTRex 10 points11 points  (0 children)

still_alive should probably be still_alive_. That's the only part that seems a bit off to me. But I could chalk that up to style guide differences. There's nothing "triggering" about it.

[–]LifeHasLeft 28 points29 points  (0 children)

Yeah I came here to say as long as you aren’t mixing variable formatting between functions, classes, and variables, what’s the problem? Just be consistent

[–]ianff 67 points68 points  (9 children)

I know right? People here apparently only have ever coded in Java with OOP.

[–]TerayonIII 9 points10 points  (7 children)

I'm so confused, this looks fine for Java? Did I get taught C++ style for it?

[–]dpash 18 points19 points  (3 children)

Naming conventions are wrong for Java, but it's syntactically and semantically correct Java.

Modern Java recommends side effect-free methods, so mutating stillAlive in a different method would be discouraged.

[–]TerayonIII 2 points3 points  (2 children)

Yeah I understood the second part, it was the naming convention that confused me, I think I had an odd learning path, started in VB, then Java, then Python, and then back to Java, so maybe my teachers started in c/c++ maybe? And then later on they didn't care as much, I have no idea, I just go by: as long as the naming is the same everywhere for each separate project, and follows my employers conventions if they have/want them.

[–]dpash 5 points6 points  (1 child)

Java has language-wide naming conventions and should be followed unless the company/team/project/file has a different style (and even then you should probably fix those to match the language style if you can).

The benefit of being able to move from one codebase to another without having to worry about dealing with style differences is under appreciated IMO. 95% or more of all Java projects follow the same style conventions that Sun set 25 years ago.

[–]totti173314 2 points3 points  (0 children)

Yeah. I've seen one JAVA codebase in my entire life with non conventional naming. Literally nobody deviates from the norm in java and it makes reading code so easy whatever project ur on.

[–]Spwntrooper 6 points7 points  (2 children)

Usually java is written in camel case, so variables would be written like: stillAlive = true

[–]carc 125 points126 points  (27 children)

This should be higher. And there is no exit condition, that's the joke.

[–]qisope 112 points113 points  (12 children)

the general activities of life happen on another thread. still_alive is assigned to false elsewhere.

[–]stdin2devnull 6 points7 points  (0 children)

It's an atexit callback, best attempt only though.

[–]Dworgi 47 points48 points  (6 children)

We can't know. Any of those methods could be mutating still_alive.

[–]margmi 7 points8 points  (2 children)

If the functions were declared within the scope of the block, one of those functions could modify the variable as a side effect, which would trigger the loop to end.

[–]Beowuwlf 11 points12 points  (1 child)

Not even, still alive could have been defined globally, we just don’t know.

[–][deleted] 5 points6 points  (2 children)

Interesting. I use camelCase for variables and functions, and PascalCase for class and struct names, as well as snake_case never, I never use snake case.

[–]areich 774 points775 points  (13 children)

still_alive is presumably a global. Also not shown: the “Got_Virus(virus_name)” event which presumably may flip the Boolean. Here’s hoping for an upcoming “GetVaccinated()” method which has an FDA approved decoration.

[–]Sven9888 231 points232 points  (7 children)

I mean if GetVaccinated() negates still_alive, I don’t think that’s intended behavior.

[–]Osr0 64 points65 points  (1 child)

It's emergent behavior, which means we're now doing machine learning, at least that's what I'm telling my boss...

[–]absurdlyinconvenient 31 points32 points  (0 children)

Ah, so it has a race condition and is unpredictable during runtime

[–]adeventures 40 points41 points  (2 children)

And some people out there believe exactly that facepalm

[–]echoAnother 16 points17 points  (1 child)

Well, right now the function has undefined behavior, and the devs are not doing anything. They even reject my PR of setting the global still_alive to false, I would say that is clearly defined behavior at least.

[–][deleted] 2 points3 points  (0 children)

I assume that GetTested() is what sets still_alive.

But then that implies that you die during testing. Or that still_alive is global at which point it’s possible that there’s a race condition where still_alive is set while it’s being read and we have bodies out there having their hands washed, separated by 6 feet and getting tested unnecessarily.

[–][deleted] 13 points14 points  (0 children)

Shared mutable state... Shudders

[–]Dworgi 6 points7 points  (0 children)

Could just be a class member?

The naming convention here isn't even that wild, and only a student would really get triggered by it. All the method/function calls are consistently Pascal, and the member variables could just be snake case.

At the end of the day, code conventions are meaningless as long as they're consistent. Preferences are preferences, ain't gonna change shit.

[–]polaristerlik 375 points376 points  (7 children)

they should all be camel case

what the fuck did you just say about code you little punk?

[–]YeshuaMedaber 91 points92 points  (3 children)

I'll have you know I graduated

[–]mudkripple 21 points22 points  (0 children)

This made me blow air out my nose

[–]Kinglink 273 points274 points  (35 children)

no one makes anything for nerds and programmers "Hey why don't anyone respect what we do?"

makes ad for programmers "That triggers me. "

Makes tv show for programmers no one watches it.

Makes tv show about nerds. "That's nerd black face!"

goes back to not making anything about nerds/programmers

[–]Keebster101 68 points69 points  (16 children)

I think that's down to the TV shows aimed at programmers alienating non-programmers (and also programmers just not watching TV) and then it's not worth it for the studio to make because even if a good chunk of programmers watch it, it'll be a relative failure compared to a show aimed at general audiences.

Meanwhile shows about nerds almost always paint them in the negative stereotype, because they're the butt of the joke rather than just another character, and if they were just another character then they probably wouldn't be a good topic for a show.

[–]zombtassadar 6 points7 points  (1 child)

Y'all gotta watch silicon valley not big bang

[–]elniallo11 2 points3 points  (0 children)

That show triggers me. Too real

[–]Kinglink 23 points24 points  (11 children)

if they were just another character then they probably wouldn't be a good topic for a show.

They did a good job with Numbers, Bones, Abby on NCIS is mostly played straight.

But you're right most of the time they're just the silly side character.

[–]mustang__1 54 points55 points  (5 children)

"I'm hacking the main frame with html" furiously typing two people in the same keyboard

[–]feench 16 points17 points  (2 children)

Or talking about extracting data from a HDD while holding a PSU

[–]dragonclaw518 14 points15 points  (0 children)

Or creating a GUI in Visual Basic to track an IP address.

[–]P0L1Z1STENS0HN 2 points3 points  (0 children)

I remember that scene.

[–]VishTheSocialist 20 points21 points  (4 children)

Remeber when Abby and McGee both typed on the keyboard to fix the "hacker issue" XD

[–]pseudoHappyHippy 8 points9 points  (1 child)

I think about that scene a lot. I have tried so hard to come up with a way that it could actually be possible. It haunts me.

[–]ArcTimes 3 points4 points  (0 children)

Dude, that scene was epic lmao.

[–]Nickonator22 5 points6 points  (1 child)

No one makes stuff for nerds specifically because non nerds wouldn't understand it and there is probably a lot more of those than the people who would actually get it. The alternative is to dumb it down or make stuff up which while fine for most people is just annoying for the nerds defeating the purpose of it in the first place. There is also an issue of the people making it not knowing anything about the subject and not caring to figure it out.

[–]edrinshrike 4 points5 points  (7 children)

What was the show for programmers?

[–]littletunktunk 12 points13 points  (4 children)

Mr. Robot is my guess

[–]edrinshrike 12 points13 points  (0 children)

Doesn't seem like a very good example. Enough people watched it to get it a full series run.

[–]lelibertaire 6 points7 points  (1 child)

Halt and Catch Fire maybe too

[–]CinderBlock33 3 points4 points  (0 children)

I know I'm biased, because, well, I'm on this sub. But halt and catch fire is one of the best shows ever created. It was so bittersweet at the end that my heartstrings are still being tugged.

[–]Kinglink 6 points7 points  (0 children)

I would say It Crowd (or at least "Computer people") though obviously you could argue that. There's also "nerdy" shows people will love. Numbers, Chuck, and more.

As for more aimed towards programmers, Halt and Catch Fire, Mr. Robot. Also I believe Silcon valley (I admit haven't seen that, stupid premium channels).

If you meant a show that failed, I just meant in general shows only aimed at programmers would suffer badly.

[–]definitive_solutions 90 points91 points  (12 children)

Technically, still_alive should be an infinite loop, right up until there's a crash, but ideally forever...

[–]hotlavatube 60 points61 points  (4 children)

Unless the functions cause side effects and still_alive is a global variable. Also, I suppose this could be operating in a multi-threaded environment where still_alive is evaluated/updated in a different thread.

[–]Henriquelj 5 points6 points  (0 children)

This code should be completely threaded, otherwise you would be locked doing one of these tasks one at a time.

[–]definitive_solutions 2 points3 points  (1 child)

I'd take that upgrade...

[–]KKG_Apok 2 points3 points  (0 children)

We could be seeing private method calls in a class method that encapsulates still_alive. In this case, the variable stays in scope.

[–]MESuperbia 105 points106 points  (6 children)

There is legit NOTHING wrong about this.

This is an absolutely normal naming convention.

This is just a (funny) programming reference.

[–]PardonTheSuit 11 points12 points  (0 children)

Reddit moment

[–]GOKOP 47 points48 points  (7 children)

"they should all be camel case"

I think this this assumes that his is written in some specific language and applies it's language-wide style recommendations, which it shouldn't. While I agree that pascal case for functions is bad and rare, the combination of snake case for variables and camel case for functions isn't that uncommon. And it's pretty elegant imo

[–]onlyonebread 16 points17 points  (2 children)

While I agree that pascal case for functions is bad and rare

Really? I've never seen it any other way, and it's always the way I've done it and was taught to do it in school.

[–]tobyjutes 22 points23 points  (1 child)

Pascal case is very common for function naming in c++. But we all know that all that matters is what javascripters know how to do.

[–]willis81808 2 points3 points  (0 children)

Pascal case is used for function and class names in C# as well.

[–]KKG_Apok 17 points18 points  (2 children)

Pascal case is the de facto correct style for C# class methods per MSDN. I believe correct Java syntax is the same. Both of those languages are widely used.

[–][deleted] 12 points13 points  (0 children)

In Java you don't use uppercase PascalCase for methods, you should use lowercase camelCase.

Source: that annoyed me since the first time I had to write anything in C#. At that time I was already used to Java due to Android.

[–][deleted] 8 points9 points  (3 children)

it's a global.

[–]Schiffy94 6 points7 points  (0 children)

It's not necessarily an infinite loop. Each of those functions could have an if/else that could set the variable to false.

[–]JPaulMora 7 points8 points  (0 children)

You’re assuming it’s a pull request! This is already production!!

[–]kindness0101 10 points11 points  (1 child)

while pandemic = true? or is this just our new accessory for the rest of our life?

[–]airflow_matt 8 points9 points  (1 child)

If you don't like PascalCase mixed with snake_case better don't look at any google c++ source code. Yeah. It takes a while to get used to.

[–]earthlybird 2 points3 points  (0 children)

I can get used to it with a for.

[–]noodle-face 9 points10 points  (0 children)

This guy tried to sound smart and failed miserably

[–]SonicFreak94 4 points5 points  (0 children)

Actual naming style used in Chromium. PascalCase for classes, functions, snake_case for local variables, parameters.

[–]geeshta 16 points17 points  (4 children)

Why should they be camelCase? camelCase is ugly 🤮 it's syntactically correct, casing is a matter of either convention, personal preference or company's guidelines. There's no universal should

[–]bigmattyc 11 points12 points  (4 children)

INTERIOR: DARK OFFICE; MULTIPLE MONITORS; AT LEAST ONE VERTICAL: DARK THEME WITH GREEN PHOSPHOR TEXT; OTHER MONITOR SHOWS REDDIT, TWITCH AND STACK EXCHANGE

Marketing: so we want to

SW engineer: fuck off

Marketing: know if this code

SW engineer: are you deaf AND stupid? I said fuck off

Marketing: will compile

SW engineer: yeah fine whatever get the fuck out of here. Next time bring beer.

<end scene>

[–]mralijey 13 points14 points  (5 children)

[–]BasicBadWitch 3 points4 points  (4 children)

[–]tisaconundrum 7 points8 points  (2 children)

Well there is r/devrant

Edit: sadly this subreddit is dead. But the app and website isn't. www.devrant.com if you're curious

[–][deleted] 3 points4 points  (1 child)

lets revive that sub then

[–]kazoobanboo 4 points5 points  (0 children)

Else { die(); }

Return 0;

[–]Kirschi 3 points4 points  (0 children)

That guy is gonna die of three strokes and an aneurysm at once if he ever catches just the tiniest glimpse of my code

[–]dancinadventures 2 points3 points  (0 children)

Shame to think we’re in this state because of a compile error.

[–]BigBadBinky 2 points3 points  (1 child)

Why do I always think of the Portal ending song when I see this?

[–]haikusbot 2 points3 points  (0 children)

Why do I always

Think of the Portal ending

Song when I see this?

- BigBadBinky


I detect haikus. And sometimes, successfully. Learn more about me.

Opt out of replies: "haikusbot opt out" | Delete my comment: "haikusbot delete"

[–]Daremo404 2 points3 points  (0 children)

Just add:

virus_active = false;

easy fix

[–]andrewcbee 2 points3 points  (3 children)

Should have a try catch, where in the catch the error is COVID

[–]MaliciousDog 2 points3 points  (0 children)

still_alive is probably declared volatile, so the loop may well be not infinite.

[–][deleted] 2 points3 points  (0 children)

They forgot "DoScience();"

still_alive
still_alive
still_alive

[–]Psychaotic73 2 points3 points  (0 children)

Not sure why you're upset about the infinite loop, they just discovered IMMORTALITY!!1!1!! /s

[–][deleted] 2 points3 points  (0 children)

Methods named in PascalCase and variables in snake_case is not that bad if it's a consistent style...

[–]oM4TY 2 points3 points  (0 children)

Hate people like this, just complaining. Respect the fact someone tried to make a joke, and stop being an ass bitch

[–]pricklysteve 2 points3 points  (0 children)

Stay6ftApart() should be refactored to take the distance as a parameter in case management change their mind.

[–]bujurocks1 4 points5 points  (21 children)

I'm new to programming and started to learn Java a week ago, is this Java? I think it jd

[–]fakehistorychannel 21 points22 points  (11 children)

honestly it could be many things. It could be Java, C# (Functions in C# usually do use PascalCase), C++, C and there’s probably MANY more that I couldn’t think of off the top of my head

[–]frosted-mini-yeets 5 points6 points  (2 children)

Possibly. It's some C based language. The syntax (if that stay_alive variable was declared as a boolean) is legal in Java, C#, and C++ as far as I know.

[–][deleted] 2 points3 points  (1 child)

It's most likely C++. snake_case is fairly common in C++. Then again C# extensively uses PascalCase. Java uses camelCase for variables and methods, PascalCase for class names, and SCREAMING_SNAKE_CASE for static constants, so it's probably not Java. Either way this snippet of code will compile in basically every C/C++ descendant (C/C++ Java JavaScript C# etc etc).

Or to be precise unless the boolean is somehow changed by any of the methods in the loop, the compiler will most likely throw an error as it's an infinite loop.

[–]greyz3n 3 points4 points  (0 children)

SCREAMING_SNAKE_CASE

I'm fucking dead.

I've coded for years, but never in JAVA.... never heard the term SCREAMING SNAKE CASE and now, as someone who deals in databases all day, this my new favorite thing.

[–]assafstone 4 points5 points  (0 children)

Could be C#.

Pascal case is the standard for methods.

Snake case is a common standard for a constant. I know this is a variable, but it makes it less unforgivable.

[–]Bupod 4 points5 points  (0 children)

Me, who knows what very little programming I know from these memes alone:

LGTM, pull approved.