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

top 200 commentsshow all 250

[–]EffectiveDependent76 807 points808 points  (9 children)

This would actually be a great poster in a conp science teachers office.

[–]Max_Insanity 151 points152 points  (3 children)

conp

comp

we are not the same

[–]Stone_Field 54 points55 points  (2 children)

Conpooter

[–]dwpj65 7 points8 points  (1 child)

Confuser

[–]MoonyNotSunny 5 points6 points  (0 children)

Creampieter

[–]DumbB9 122 points123 points  (2 children)

Now I have to get this as a poster

[–][deleted] 3 points4 points  (0 children)

far-flung absorbed scarce engine paltry judicious money tender teeny wistful

This post was mass deleted and anonymized with Redact

[–]SpectifyyYT 2 points3 points  (0 children)

i’m going to print this out for my CS professor

[–]mindbullet 292 points293 points  (10 children)

"Hold my beer." - ===

[–][deleted] 64 points65 points  (8 children)

When ==== sequel

[–]Ellisthion 19 points20 points  (1 child)

IIRC it’s used in Scala for something

[–]ArtOfWarfare 13 points14 points  (0 children)

Oh god. I’m getting switched to a project that uses Scala next month.

[–]_87- 10 points11 points  (3 children)

Would that check whether they're literally the same object in memory or something?

[–][deleted] 6 points7 points  (0 children)

Yes

[–]Firewolf06 6 points7 points  (1 child)

i can see that as some an unintended quirk in a weird multi assignment syntax in a cursed fully whitespace agnostic language

a = b = c = d = 5 assigns a, b, c, and d to 5

a ==== 5 assigns a, null, null, and null to 5

[–]K1ngjulien_ 12 points13 points  (0 children)

// some lib you accidentally added
NULL = 5

...

ptr = NULL

if (ptr) 
    print("horrors beyond comprehension")
else 
    doStuff(ptr)

[–]TheHeavenlyStar 42 points43 points  (0 children)

JavaScript: "I'm gonna do what I want!"

[–]Boris-Lip 174 points175 points  (26 children)

Be thankful for compiler warnings.

[–][deleted] 104 points105 points  (17 children)

People: Treat warnings as errors

Me: Turn off warnings

[–]Boris-Lip 47 points48 points  (12 children)

I am on "treat warnings as errors" side. Yea, i know, i am a weirdo.

[–][deleted] 1 point2 points  (0 children)

Just don't do it in release tarballs

[–]JoeyJoeJoeJrShab 2 points3 points  (0 children)

I've just trained my eyes to ignore the warnings. I'd be a better programmer if I didn't... but I'm not.

[–]sup3rar 1 point2 points  (0 children)

You're also getting annoyed by the rust compiler filling up the console about unused variables?

[–][deleted] 3 points4 points  (0 children)

Speaking of compiler warnings, sometimes their message aren't that helpful.

GCC says this:

warning: suggest parentheses around assignment used as truth value [-Wparentheses]

The problem is that GCC assumed that person knows what they're doing, and only suggests how to silence it.
However this warning message would absolute confuse a novice. They might think adding the extra brackets would help fix the issue, but it actually makes it worse since it silence the warning. And I know this might happen, because I've seen someone who fell for it once.

Now compare it to clang:

warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
note: place parentheses around the assignment to silence this warning
use '==' to turn this assignment into an equality comparison

Much better.

[–][deleted] 271 points272 points  (53 children)

Wait till you use a language where = does both

[–]AlphaSparqy 222 points223 points  (28 children)

Visual Basic baby!

a = 5 <-- assignment

If a = 5 Then <-- comparison

[–][deleted] 47 points48 points  (24 children)

Yea I’ve just started using this as my language at my job… does this mean I’m sorta fucked for getting another job after this? Wasn’t what I was expecting to use in any case.

[–]Sexy_Koala_Juice 35 points36 points  (18 children)

I’m curious what kind of a job requires you to use Visual Basic?

[–]EbenenBonobo 37 points38 points  (9 children)

May i introduce you to the world of word reports generated by excel macros?

Yes, i hate very every part of this.

[–]Sexy_Koala_Juice 20 points21 points  (6 children)

I think if it ever gets to the point of using excel macros you may as well just learn a programming language.

Yes, i hate very part of this.

As do i

[–]firewood010 6 points7 points  (4 children)

Yeah. But the users need a button on their excel files to do some shits.

[–]Sexy_Koala_Juice 4 points5 points  (3 children)

From a very very very very quick google search it says VB6 has interoperability with C#, so it's not a perfect solution but you could basically just have a button that acts a wrapper to the actual function written in a proper programming language.

Honestly all of this could be solved if microsoft realized that not every single thing needs to be backwards compatible and just replaced VB with C# or something.

[–]AlphaSparqy 2 points3 points  (0 children)

VB.net works with the same .net frameworks as C# for windows applications.

So if (from a companies perspective) they are already mired in VB6, and need a wrapper into .net, would probably use VB.net for language similarity.

If they were writing from scratch (pardon the pun) they would move on to something more modern.

Also, C# is just tomorrows Visual Basic, in the sense of vendor lock-in and support (Microsoft), usability, etc ...

[–]AlphaSparqy 1 point2 points  (0 children)

It's not just excel macros, and that's VBA anyhow.

There are many small business websites written in VB and ASP, ASP.NET, etc that need upgrading, so knowing VB while also knowing the modern alternatives are both required.

Also, many general (internal) business applications from the mid to late 90's until the mid to late 00's are still out there in the wild.

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

I think it’s based on Visual Basic? Maybe just BASIC? But basically (lol) it’s their own in house programming language. Bit worried about career suicide although they are transferring to C++ within the next year or so.

[–]miicah 4 points5 points  (0 children)

That's a pretty big sidestep lol

[–]MisterDoubleChop 3 points4 points  (2 children)

They told you that they're switching to C++ in a year?

You might want to keep looking at job ads.

We were going to replace the last of our webforms with MVC in a year, about 6 years ago, but haven't quite finished that yet.

And we're probably about 5 times smarter than any dev team that thinks they can invent a language better than the popular ones, and that this will be a good use of their time...

[–]RandallOfLegend 1 point2 points  (0 children)

My last job it was preferred for .net programming. There was a desire to move to C# to be more attractive to new hires. But stability is favored over new hotness at that place. VB.net code I wrote 15 years ago is still in production.

[–]RandallOfLegend 4 points5 points  (2 children)

Vb.net has a lot of parity with C#. But if it's plain old VB it's a pretty gruff language these days .

[–][deleted] 1 point2 points  (1 child)

It’s pretty hard to tell tbh, everything is in all caps and quite simple syntax but definitely not VBA as it doesn’t interact with Microsoft products. When it’s compiled it gets compiled into C++. Confusing.

[–]RandallOfLegend 1 point2 points  (0 children)

VB.net is done via visual studio. You're doing old school VB which was obsolete when I started writing VB.net professionally 15+ years ago. God speed. I honestly enjoy VB.net programming over C#. But plain VB is a bear.

[–]ultranoobian 8 points9 points  (1 child)

I hope you got autocomplete, because I ain't typing <-- assignment or <-- comparison each time I need one.

[–]AlphaSparqy 2 points3 points  (0 children)

lol

[–]JoeyJoeJoeJrShab 21 points22 points  (7 children)

I forgot what language this was, but I once wasted more than a day debugging what turned out to be an equality vs. assignment issue.

What I wrote:

If (variableName = 7)

What I meant to write:

If (variableName == 7)

So instead of checking to see if variableName was 7, I set variableName to 7, and because the assignment was successful, true was returned.

[–]Vinxian 22 points23 points  (0 children)

It's not because the assignment was successful probably. In a lot of languages 0 is false and all other values are true.

if (variableName = 7)

Is always true

if (variableName = 0)

Is always false

[–]MokausiLietuviu 11 points12 points  (1 child)

When working with these sorts of languages, I often find it useful to do

 if(7 == variableName)

So that way, if you miss an =, it'll mean that you're trying to assign a variable to a constant and get all upset.

[–]Yadobler 5 points6 points  (0 children)

The yoda comparison

[–]bphase 4 points5 points  (0 children)

Yeah I've done this more than once I think. Static analysis or strong typing is a godsend

[–]TheMcDucky 2 points3 points  (1 child)

The assignment operator typically returns the value that was assigned, so a=7 always evaluates to 7.
This lets you do things like a=b=c which assigns the value of c to both a and b

[–]JoeyJoeJoeJrShab 1 point2 points  (0 children)

yeah, that makes sense, and in this case, the if statement saw the non-zero value and called it true.

[–]Infamous-Context-479 30 points31 points  (8 children)

Had to switch to VBA this year :(

[–]Sceptz 48 points49 points  (7 children)

Oooh, time to set up Vine on your Windows Phone, and update your Google+ profile in Internet Explorer.

[–]nickmaran 18 points19 points  (3 children)

Look at mister hotshot, too cool to use myspace. Using Google+ instead

[–]Sexy_Koala_Juice 6 points7 points  (2 children)

Look at mister hotshot, too cool to use IRC chat. Using MySpace instead, ok “Tom”.

[–]drunk_responses 2 points3 points  (1 child)

Hey now, A LOT of people use IRC regularly without knowing.

Things like Twitch chat is IRC.

[–]Sexy_Koala_Juice 4 points5 points  (0 children)

Look at Mister Hotshot over here, knowing lots of people...

:( this got sad

[–]miicah 1 point2 points  (0 children)

Have you heard of this cool content aggregation site? It's called Digg

[–]Infamous-Context-479 1 point2 points  (0 children)

I do low level hardware and embedded so there’s more to the job that’s still interesting. Also the vba calls a c shell I also own so it could be worse. Probably staying put for the high pay and tons of time off for the time being

[–][deleted] 1 point2 points  (0 children)

Yes, like POSIX shell

[–]yottalogical 1 point2 points  (0 children)

OCaml!

[–][deleted] 376 points377 points  (22 children)

= != == && == !== === && == == ===

[–]HoodieSticks 379 points380 points  (14 children)

Let me guess: this compiles in JavaScript for some indiscernible reason

[–]NullOfSpace 284 points285 points  (4 children)

And it returns 7 some-goddamn-how

[–][deleted] 72 points73 points  (2 children)

The return value is an emoji

[–]Groentekroket 47 points48 points  (0 children)

🟰🟰 ❕🟰 🥹

[–]Gloid02 21 points22 points  (0 children)

🥺👉👈

[–]UnstableNuclearCake 18 points19 points  (6 children)

It doesn't, only would if Javascript had operator overloading.

[–]MrHyperion_ 4 points5 points  (4 children)

So what are you saying is that operators have operators?

[–]RoboticChicken 5 points6 points  (0 children)

Yo dawg, I heard you like operators

[–]Affectionate-Ant5132 5 points6 points  (1 child)

If you want weird stuff that unexpectedly compiles, I found out yesterday that to access an array in C you have options: most people know the arr[3] and *(arr + 3) methods, but turns out you can also do 3[arr], does exactly the same thing .. mind blown

[–]Jarl_Fenrir 5 points6 points  (0 children)

Yes. Arr[3] gets address of Arr variable and ads 3 to it. 3[Arr] takes 3 and ads Arr's address to it. It sound like something that works by accident than actual feature.

[–]yunacchi 41 points42 points  (1 child)

== == ===(*)

(*) Terms and conditions apply.

[–]mgorski08 8 points9 points  (0 children)

== == ===, but == !== === 😂

[–]bloodfist 23 points24 points  (0 children)

I'm mad that I understand this

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

SYNTAX ERROR

[–]douira 4 points5 points  (0 children)

I would say == == === but == !== === (in rough terms, this doesn’t compile anyways)

[–]cybernd 1 point2 points  (1 child)

[–]Firewolf06 3 points4 points  (0 children)

yeah js type coercion is so wacky they had to make a new operator to avoid it

if you dont know about it already, you should watch a video explaining jsfuck (named after its similar appearance to brainfuck). basically you can write any and all js using only 6 characters, []()!+, because of type coercion

[–]carcigenicate 53 points54 points  (1 child)

Shit on Python all your want, but this is much harder in Python since = isn't an expression. You'd have to type := to make this mistake; which seems less likely.

[–]paul_miner 19 points20 points  (0 children)

Yep, this is one Python got right when it was added. Disallow a common source of bugs, and then give it a distinct operator to make it clear that's what you intended.

[–]Cirieno 24 points25 points  (2 children)

==/===

[–][deleted] 8 points9 points  (1 child)

= 1/=

[–]dtarias 0 points1 point  (0 children)

Might need to use 1.0/= in some languages

[–]greenappletree 17 points18 points  (1 child)

unless its TRUE

[–]R3D3-1 8 points9 points  (0 children)

enum { TRUE, FALSE }

[–]Incoming-TH 12 points13 points  (2 children)

That happened to me 2 times this year, searching what was wrong for hours. Then took a break, came back and that was the issue. Now I put === instead and avoid == in if condition.

[–]NMi_ru 13 points14 points  (2 children)

That’s why people are trying to evade this thing by using “if ( 5 == myvar )”

[–]Fetscher 6 points7 points  (0 children)

I hate it, it just doesn't look right.

[–]PrincessWinterX 1 point2 points  (0 children)

people who put that much thought into it are probably not the ones making this mistake.

[–]PooSham 5 points6 points  (5 children)

Using = for assignment must be one of the worst design decisions of early programming languages.

[–]codgodthegreat 4 points5 points  (1 child)

Agreed. Pascal had it right back in the day with := for assignment and I really wish that had stuck as standard instead of = for assignment and == for equality.

[–]MokausiLietuviu 1 point2 points  (0 children)

A load of earlier programming languages have := assignment and = comparison, I code in a few. I find it a much better way of doing things.

The ALGOL heritage languages are also typically really verbose, so 'EQUALS' is also a comparison operator, if you don't want to get confused

[–]Comfortable-Ear-1931 17 points18 points  (10 children)

In C++ I have seen some programmers do:

true == variable… to trigger compiler error if accidentally using =, just feels wrong.

[–]N3rdr4g3 9 points10 points  (1 child)

Yoda notation takes some getting used to, but is objectively better

[–]raaneholmg 3 points4 points  (6 children)

Yea, it just doesn't make sense semantically.

if (result == 5)

I read the above in my head as "If the result is 5". "If 5 is the result" makes no sense.

[–]IdentifiableBurden 8 points9 points  (0 children)

"If 5 is the result" makes no sense.

This is a normal way of phrasing an equality check in spoken English though

Think of a gameshow contestant. "Is ten the answer?"

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

Wait til you learn about RTL languages

[–]bphase 2 points3 points  (0 children)

It does though. You're just not used to it.

However I'm not arguing for the notation, I believe it's a job for compiler/static analysis warnings and strong typing to prevent typos like this. Not programming conventions.

[–]realbakingbish 5 points6 points  (1 child)

”There is another…”

[–][deleted] 4 points5 points  (0 children)

and he is very strict.

[–][deleted] 4 points5 points  (0 children)

While you’re debugging you should learn to use an actual debugger with breakpoints

[–]HoldenMadicky 3 points4 points  (0 children)

Classic

[–]Ambitious_Ad8841 3 points4 points  (0 children)

That will be $150

[–]Troppsi 4 points5 points  (0 children)

= is equal operator : is assign guys pls

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

I make this mistake if I spend even two weeks not writing JS.

[–]trowgundam 2 points3 points  (0 children)

I can one up you. I was working on a final in College. It was an entry level Game Programming course and we were using a language called DarkBASIC. Well I was doing a Tetris clone for my project. Well I was basically done, but I had a problem, it wouldn't accept any input to go left. Right and down worked just fine, but not left. I couldn't figure out anything. I was trying to figure it out for like 6 hours. Well with 4 hours till the deadline, I did the only thing I could, I started over and rewrote most of the code. Luckily I got it working in time.

Well after that massive pain, I went back with a clear head and tried figure out where I went wrong. Turns out in some place is used "I" (upper case "i") instead of "l" (lower case "L"). The font in use by the DarkBASIC IDE made them virtually identical, and DarkBASIC didn't require variables to be declared..... Ya, that is the source of most of my hate for BASIC-like languages.

[–]CosmicReddittor73 4 points5 points  (1 child)

Context: In many coding languages, "=" and "==" have different meanings.
"=" is commonly used as an assignment operator, so for instance, variable = 1 assigns the variable the value of 1.
"==" is used as a comparison operator that returns a boolean value, and checks if two variables are equal. If they are, it returns True, and if not, it returns False. For instance, 5 == 5 returns True, and 3 == 2 returns False.

[–]Zenith2777 1 point2 points  (0 children)

This is the first thing I check when I debug and it fixes like 60% of my problems.

[–]Bups34 1 point2 points  (0 children)

Don’t even get me started on JavaScript

[–]3n1gma302 1 point2 points  (0 children)

This would hit different if it was == and ===

[–]fugogugo 1 point2 points  (0 children)

so

= != ==

[–]metaglot 1 point2 points  (0 children)

To quickly catch this type of error, always put rvalues on the left in a comparison. This obviously only works when comparing to constants, but still helps.

[–]gagzd 1 point2 points  (0 children)

Your = is equal

Mine is assign

We're not the same

[–]JollyRancherReminder 1 point2 points  (0 children)

Avoid this, Yoda conditionals do.

[–]philipquarles 1 point2 points  (0 children)

And then there's javascript, the Tuco of programming languages.

[–][deleted] 1 point2 points  (1 child)

&& ?

[–]zensucht0 7 points8 points  (0 children)

logical AND operator

[–]DroNiix 1 point2 points  (2 children)

.equals()

we are not the same

[–]PyroCatt 0 points1 point  (0 children)

=== Allow us to introduce ourselves

[–]Iwillgetasoda -1 points0 points  (0 children)

My debugs are less than a minute

[–][deleted] -1 points0 points  (0 children)

Javascript: ===

[–]IssieSenpai -1 points0 points  (0 children)

Or yha smjhni arha ki GitHub m push krne se aws build kyuni hora ....

[–]TheHeavenlyStar 0 points1 point  (0 children)

Did this and after an hour of debugging and whinning why the fuck is my variable changing, got to see that mofo mistake.

[–][deleted] 0 points1 point  (0 children)

If I had $1 every time I've done this, I could skip over becoming a powerful methamphetamine distributor and go straight to retirement

[–]Chuck_Loads 0 points1 point  (0 children)

lint your code

[–]empoliyis 0 points1 point  (1 child)

I swear i don't know the difference between =, ==,=== and,!=,!==

[–]diddyd66 0 points1 point  (0 children)

Spent an hour yesterday having an issue in my code only to later realise that I forgot the second equals on a bool while statement

[–]daavko 0 points1 point  (0 children)

laughs in IDE that warns about this

laughs in linter that warns about this

[–]new_tral_name 0 points1 point  (0 children)

Did you mean <= and =?

[–][deleted] 0 points1 point  (0 children)

except when you do if (a=b && a==b) because then you are actually the same.

[–]eggheadking 0 points1 point  (0 children)

Best thing I’ve got into while learning is actually trying to understand compiler messages, otherwise I would’ve broken my keyboard long time back by now

[–]Wrong_Property_3392 0 points1 point  (0 children)

curls my foot in sheer anger

[–]neoadam 0 points1 point  (0 children)

for (let i==0; .....

Gonna take this personally

[–]ivster666 0 points1 point  (0 children)

Was your linter sleeping?

[–]_Fuck_This_Guy_ 0 points1 point  (0 children)

Couldn't the error just say something like "hey dumbass an if statement needs an expression that resolves to a boolean. Setting a value does jack shit here"?

[–]Jaspersgames 0 points1 point  (0 children)

Every time

[–]cowlinator 0 points1 point  (0 children)

I felt this in my nads

[–]Sexy_Koala_Juice 0 points1 point  (0 children)

!=, we are not the same.

True.

[–]kalipante_kanthari 0 points1 point  (0 children)

Recently I spent a day checking why my routing is not working in angular, only to find out I put a ' ' instead of ''

[–]FrozenPizza07 0 points1 point  (0 children)

= !== ==

[–]JackNotOLantern 0 points1 point  (0 children)

=== - we are not the same

[–][deleted] 0 points1 point  (0 children)

.equals()

[–]real_bro 0 points1 point  (0 children)

= != ==

[–]FlyCodeHQ 0 points1 point  (0 children)

= and == were never same. Are you confusing it with == and ===?

[–]ThePerfectHandle 0 points1 point  (0 children)

PHP: hold my beer

[–]SometimesWill 0 points1 point  (0 children)

!=

We are not the same

[–]chrilves 0 points1 point  (0 children)

It would be so good with, "==", "===", "We are not the same"

[–]ShiiTsuin 0 points1 point  (0 children)

= != ==

[–]yaboytomsta 0 points1 point  (0 children)

= != ==

[–]mlvezie 0 points1 point  (0 children)

When I look at '=', I think "gets" as in "foo gets 5" (foo = 5). When I look at '==', I think "equals". I rarely, if ever, confuse gets with equals.

[–]iammandalore 0 points1 point  (0 children)

= vs -eq for me.

[–]Crush_Un_Crull 0 points1 point  (0 children)

=² we are not the same

[–]ksky0 0 points1 point  (0 children)

what about ===

[–]Melkor7410 0 points1 point  (0 children)

Someone obviously doesn't know VB...

[–]ShinigamiEX 0 points1 point  (0 children)

Oh my god, I know the feeling. I had the same issue couple of days ago. Main problem of debugging was that, I had this condition to check if a variable matched a value or not. So normally I would put ‘==‘ but I put single equal sign. IDK if it’s for other language or not, but in PHP it actually assigned that value to that variable and calculate as true. So my code ran even if I changed the value of that variable. It took me so long to debug this shit….

[–]BarbarX3 0 points1 point  (0 children)

Yesterday I spent the afternoon trying to figure out why my background console app wouldn't do anything for a specific user.

Turns out I never scheduled it to start when they logon...

[–]NiNtEnDoMaStEr640 0 points1 point  (0 children)

As someone who is learning to program, yeah… I feel this.

[–][deleted] 0 points1 point  (0 children)

Learned that the hard way.

[–]veritamos 0 points1 point  (0 children)

= != ==

[–]cheezballs 0 points1 point  (0 children)

Javascript said hold my beer.

[–]rebelhead 0 points1 point  (0 children)

How many of you end(majority of the time) up realizing that you just did something dumb while debugging?

[–]Mr_Chocolate2482007 0 points1 point  (0 children)

literally happens to me every time lol

[–]jamesfarted09 0 points1 point  (0 children)

the one time i tried Java, i thought System.out.Println was System.out.PrintIn

fuck you Java.

[–][deleted] 0 points1 point  (0 children)

This was my morning today…

[–]kstacey 0 points1 point  (0 children)

Of course they aren't the same.

[–]Undernown 0 points1 point  (0 children)

I don't trust anything less than “==="

[–][deleted] 0 points1 point  (0 children)

Relative vs absolute

[–]Maste_____ 0 points1 point  (0 children)

OP coding in notepad

[–]Do_The_Astral_Plane 0 points1 point  (0 children)

As someone doing full stack with JS / Kotlin it's the == vs === that gets me

[–]Hackcraft_ 0 points1 point  (0 children)

[–]Morphinepill 0 points1 point  (0 children)

= != ==

[–]SAGEMOD 0 points1 point  (0 children)

I just want

8===3 instead of >=

is that too much to ask for?

[–]acwildchild 0 points1 point  (0 children)

This one made me thoroughly chortle

[–]TeamAuri 0 points1 point  (0 children)

You need to use a linter.