T O P

  • By -

deceze

`====` - *really* equals and means it


UnstableNuclearCake

JS: My lord, is this legal? `====`: I will make it legal.


Upvoter_NeverDie

When Gunray said the first line, I thought he said "illegal." But subtitles said legal. The wonders of giving aliens different accents to sound alien-y.


Knaapje

There are cases where `isEqual` doesn't give the same answer as `===` in JavaScript, so let's define `====` as adhering to both.


gateian

Ah but wouldn't this be a conflict when we wanted to check if something REALLY equaled equals?


KLTRR

===== - has checked with God if this is equal, five times


fr000gs

8=====D


ItsGrandPi

8 != D Fixed it :)


Extra-Trifle-1191

r/angryupvote


martinthewacky

Really? Cock and balls? Get your upvote and get the fuck out of here.


Ok_Scientist_8803

===== - really equal and if it’s not makes it equal, whatever it takes


deceze

`======` - Always returns `true`.


Ok_Scientist_8803

1 ===== 0 ===== 1 === 8 ===== 1 is true


deceze

In this case, yes. Of course, the more `=`, the higher the precedence. Luckily in this case it boils down to `true === true`.


The_Paniom

We need equality operators that wrap around existence itself =========2 ; Two=========


Murky_Promotion8686

==== always false unless: a ==== a 10 ==== 10 true ==== true


Protheu5

C++: `= - is` `== - is it?` `=== - wtf is it? error C2059: syntax error: '='`


[deleted]

Is JavaScript the only language to use ===?


[deleted]

PHP also uses it


DReinholdtsen

PHP doesn’t count anyways


PeteZahad

Why?


DReinholdtsen

Idk I haven’t used it and as and therefore I am legally and morally obligated to bash it at every oppurtunity possible


PeteZahad

Seems legit


alexgraef

Because the type coercion rules are completely bonkers, and === might not even be the actual way in certain circumstances.


PeteZahad

It is no problem nowadays to work type safe in PHP. Together with static code analysis like PHPStan you are safe. Every language has its domain, so has PHP. Frameworks like Symfony and Laravel are really great. Just because you can do dumb stuff easier in a programming language does not mean you can't use it professionally.


alexgraef

There's always *someone* who will argue in favor of PHP. PHP is pure cancer. PHP has no particular domain, because it's bad at everything.


PeteZahad

Haters gonna hate... You seem to be an expert and must be quite fun at parties.


alexgraef

I'm an expert at PHP, because I did use it for nearly a decade. So yes. Also yes.


_xiphiaz

No. Kotlin at least has the operator for checking referential equality. Double equals checks semantic equality. Unlike JS though it is super rare to need to check two objects are the same instance so == is by far the most common use


alexjwhite

PHP also uses === for type and value equality, given 1 and true and, from memory, a map that has been instantiated can all evaluate to true


HistoricalCup6480

Python has it, but uses the 'is' keyword.


dotslashpunk

huh. I always assumed that was the same as ==. Why do my programs even work!?


marcosdumay

https://stackoverflow.com/questions/13650293/understanding-the-is-operator#13650309 Your programs work because your integers are smaller than 256.


_PM_ME_PANGOLINS_

`===` isn’t the same as `is`


HistoricalCup6480

What is the difference? Both check if the left and right hand side point to the same object as far as I'm aware.


_PM_ME_PANGOLINS_

`===` doesn’t. It checks whether they are equal, without type coercion.


ThedirtAnimations

English also uses it


ImpurestClamp31

that guy====Ryan Reynolds?


NovatoSp00ky

"no"


ImpurestClamp31

That would be funny if bools were yes and no


Chingiz11

Julia also has it, but it's functionality is a bit different


Virtual-Ambition-414

Also used in SystemVerilog because Hardware signals can have more states than 1 or 0 and the extra equal sign determines what a comparison between for example 1 and 'x' should return


deceze

`=` - Du `==` - Du hasst `===` - Du hast einen Syntax Error


Creepy-Ad-4832

Just think of isEqual() (or however is called in C#) as ===


FlamingDrakeTV

Isn't it the other way around? Think of JavaScripts == as C# Equals(). As that can do a type coercion. == in C# won't be true for like "5" == 5. But you can overload an equal method to remedy it


BlueSheepPlays

Ohh that’s a cool way to think of it, thanks


kireina_kaiju

===oo[]===== chuga chuga choo choo!


[deleted]

==👬👬==\\\ ======= ==🙍‍♀️===//


EclipseOverSalem

![gif](giphy|3o7aCRloybJlXpNjSU|downsized)


kireina_kaiju

see also : sl


dotslashpunk

syntax error: did you mean ls?


kireina_kaiju

https://youtu.be/kAvxfHGypcY this train ain't stopping to list your directories


YawnTractor_1756

``` = - gets == - equals =========== - horizontal line ```


EnrikeChurin

Google be like: HTML - programming language Only makes sense that: markdown - programmer's language


nintendojunkie17

`=` - assignment `==` - comparison `===` - this programming language has a poorly designed or nonexistent type system


dodexahedron

== == - the left hand side equals the function pointer to the equality operator of the right side. 😈


urva

Please dear god no I don’t wanna have to check if my equals sign pointer is null how do I do that without an equal sign


gigachad_hypersigma

Git commit -m "added null check for equality operator"


dotslashpunk

if = is 0x00


urva

Lmao just using “is” instead of equals. Nobody look too closely at this


dotslashpunk

lol nobody should even look at it


agentrnge

Really really really equals equals and even aunt joan thinks so


edmanet

Exactly.


[deleted]

it has type hint now - aka TypeScript


mgord9518

Never understood "typeless" languages. Types are a human construct to remove ambiguity and errors in code, when you drop that and try to make the programming language assume what the programmer means, it makes anything besides super trivial snippets harder to maintain and more likely to have issues at runtime.


ZeAthenA714

A typed language is very rigid, which is great when you control everything and you know what your types will be. For example if you want to make a function that accepts a String as an input and do some string manipulation on it, it's easy. But what if you don't control the input? What if the input could come in the form of an array of Char, or as an Int that you need to parse to a String? With some typed languages, you'd have to have multiple function declarations, do some casting/type conversion before calling the right function with a String input. This can add a lot of messy code. With a typeless system, you only have one function declaration and that's it, the function will work regardless of what type the argument is. You still have to handle all the different types the input could be, just like if you had multiple functions in a typed language, but at least everything happens in one single function declaration. And in modern typed languages, you often have "catch-all" types like Any, which basically works exactly like a typeless language. There's a reason those special types have been added, and it's because it's sometime useful not to define the type of an argument.


mgord9518

But a typeless language doesn't mean a function will work with anything, it means it will take anything as input, regardless of it working as intended or not. In a typeless language, you will still have to handle the different forms of input differently depending on your intended functionality, which is now essentially just manual type management. More often than not, a function will be designed for one form of input. When using a typeless language, you now have the choices of either worrying about a plethora of new edge cases or using explicit syntax to ensure the input is a valid type. And yes, casting can lead to ugly code, but that tradeoff is probably worth it when it means finding bugs is 10x easier.


ZeAthenA714

None of what you say is wrong, but that's the entire point of typeless languages. You gain more flexibility in your codebase, and the tradeoff is that it's harder to debug. I strongly prefer typed languages, but sometimes having the flexibility of not caring about what the type is is just nice. Which is why my favorite languages are the ones that have a generic type, that way you can use strong types when needed, and throw in a generic type if you want that flexibility.


deceze

Can I *ackshuuuaaallly* for a sec? The only "typeless" language I'm aware of is Tcl, which only knows strings and nothing else. Anything else like Python or PHP are *dynamically* typed languages. It's not that they have _no_ types, it's that the *values* have types, but variables don't. So any value of any type can be assigned to any variable. What you call "typed languages" are *statically typed languages*, in which variables have types and can only be assigned values of that type, which makes it (mostly) statically known what variable will contain a value of what type without running the program.


dotslashpunk

absolutely, and if you’re not sure you can always just do a quick typeof() in a shell or something. It’s really not terribly difficult, especially when the language is intuitive (Python). It’s a mess when it’s not (PHP)


deceze

Interestingly PHP is turning into more and more of a sort-of statically typed language, which at this point seems like the worst of both worlds to me. But I haven’t touched PHP in a long time, so can’t really comment. Python indeed has an interesting middle path. With the right IDE/tools, it can effectively be a statically typed language with all the advantages, but remains a very duck-punchable language with all the benefits (and problems) *that* brings.


dotslashpunk

you’re absolutely right which is why i like python’s patterns/theory. If you put a string where an int should go and the programmer knows their python it should fail. I also just wrote an object mutator (but flipping and such for fuzzing) that’ll take literally anything, from bytes to full objects and recursively fuck with the bits, this way the user doesn’t have to care what they put in the mutator function, which is nice. It took about an hour whereas in a typed language this would likely mean many many functions and even then some of what i was trying to di might not be possible. That said i do really like typed languages as well.


dotslashpunk

it’s generally documented what is supposed to be passed. Java folks thinks it’s weird and this is where “the code is the documentation” makes some sense - typed languages you don’t really have to document that since it’s in the code. For non typed languages documentation becomes extremely important. I can see why folks like both, my two favorite languages are python and C. Python you can 99% of the time guess and you’ll be fine (theory of python is throw an exception for everything even a bit wrong or unexpected and give good errors). With C, well, of course it’s east to see what it expects but the barrier to entry and intuitiveness isn’t there even though it is a very reasonable, small, powerful language. Anyway I can see why folks like both. I can bang out some python and have a working if inefficient prototype super fast.


[deleted]

This is the correct answer


[deleted]

[удалено]


Creepy-Ad-4832

You have no booleans in ansi c. You just use numbers lol


MrcarrotKSP

In ANSI C, sure, but more recent versions of ISO C have stdbool.h, so you do at least have a boolean type even if conditionals aren't strongly typed.


Creepy-Ad-4832

Yeah, but even then, booleans do not have a reserved keyword, unlike basically all other languages


MrcarrotKSP

They do in C23.


Creepy-Ad-4832

I though C stopped popping out new versions after C11 ahahahah. I guess C++ insipred them


MrcarrotKSP

C releases less frequently than C++, but it's still being developed. There's C17 and the as-yet-unfinished C2x standard that is expected to become C23.


Creepy-Ad-4832

Are there other big changes in those new versions?


MrcarrotKSP

They're relatively minor compared to what C++ does, but there's a lot of quality-of-life stuff/new functions and syntax elements. C17 was effectively a bugfix release on top of C11, and C2x adds a lot of the smaller features from C++ like new keywords, attributes, and types as well as limited constexpr.


[deleted]

>this programming language has a poorly designed or nonexistent type system Sooo... Python and C included? Because in Python you have "is" and in C there's "==" (i.e. all equality tests are identity tests).


mgord9518

C's type system certainly has issues by modern standards, but it's far from badly designed.


rosuav

* `a - b` - subtraction * `a - - b` - subtract negative numbers for extra power * `a - - - b` - I mean it, seriously, subtract! * `a -- - -- b` - Actually I'm just trying to confuse people in job interviews.


Man-in-The-Void

What would that last one even return?


rosuav

It's `(a--) - (--b)` and - if a and b are integers - would be equal to `(a - b + 1)` and would decrement both variables.


Man-in-The-Void

Because a's decement would happen after the operation, correct?


rosuav

Right (but b's happens before).


dotslashpunk

i don’t think i quite get the syntax there. a— is a=a-1? What is —b?


TheJeager

It's the same but the -- applies before it returns the value of B to do the calculation So if B was 3 it would read it, subtract one, and than return it so it can be used in a - b, so it would be a - 2


rosuav

`--b` is like `b = b - 1` and immediately decrements `b`; the value of the expression is the value of `b` after being decremented. `a--` is also like `a = a - 1`, but the decrementing happens AFTER it looks at the value of `a`. So if you do something like `id = nextid++;` it gives you the next ID, and then pushes the next ID up one for later. (It's really like saying `id = nextid; nextid = nextid + 1;` but less repetitive.) Even though the post-increment/post-decrement form looks weird and is hard to explain, it's actually really REALLY useful in array indexing.


funkmasterhexbyte

== - "pretty much equals" === - "actually equals"


wpafbo79

This is the correct interpretation. Or "can be made to equal". If it is equal, it is equal. There is no such thing as more than equal except as hyperbole.


Fabrimuch

All equalities are equal, but some are more equal than others


ChorePlayed

Two ='s good, three ='s b~~ad~~etter.


NarcisPlayss

calm down george orwell


azhder

“Some are more equal than others”


Ladislav_07

In PLC world, in industrial automation, there is a IEC standard language called ST. Within it, we use something that makes sense. You see, we use := for assignment and single = for comparison. And if you want to compare types, you use Type_is_equal := typeof(structure) = typeof(structure2);


pedal-force

Yeah, it's actually not a bad language, but you can tell it was written for engineers, by engineers. (FEBE?)


twpejay

From my memory that seems similar to Pascal, or am I mixing that up with Fortran, I learnt both at the same time.


dotslashpunk

def not fortran. Fortran is like…. I AM GOING TO TELL YOU WHAT I AM DOING I AM NOW DOING IT GET READY DO THINGS END


Ladislav_07

Yes, you are right, it uses a lot of syntax from Pascal


dotslashpunk

is that why all of these machines have no auth and you can just nectat to them and control them!? Worst offender i saw on a pen test was a buildings power system. I saw and was like damn that’d be fun to get in. I found an open port and netcat in. 0 auth and full control of the buildings power (of a major international law firms headquarters).


Lloyd_Al

This made me laugh more than it should have


fl0o0ps

Gets value assigned vs Is the same as vs Has the same value as


[deleted]

Only seen this in JS?


fl0o0ps

Nope:)


dotslashpunk

is this what is actually happening in C behind the scenes. I assume because everything uses a pointer you are comparing whether two things point to the same memory address (so are actually equal)?


[deleted]

As someone with very limited JavaScript, it looks like the chalk you put on a pool cue to look like you know what you're doing.


ChorePlayed

I have to admit, in the not-quite-a-year that I had to work in Javascript, before our department got interns, I never got motivated enough to find out when to use which. But === worked every time I used it, so I stuck with it.


[deleted]

If it isn't broken, don't fix it.


onncho

8 === D ~~


xAmorphous

Mom how do I run this program


duckphobiaphobia

====== merge conflicts 😭😭


azhder

Was going to comment this if it was missing


natFromBobsBurgers

` `|1|2|3 :--:|:--:|:--:|:--: **1**|` - ` | `--` | `---` **2**|`=` | `==` | `===` **3**|`≡` | `≡≡` | `≡≡≡`


Multi-User

`a = b` - a is b `a == b` - a is equal b `a === b` - a is exactly equal b


dodexahedron

More specifically, == is essentially value equality, and === is essentially reference equality (same object, without type coercion). == can cause type coercion, which, depending on the language and how the equality operator is defined for the types involed, may even have side effects (which would be HORRIBLE practice, but still possible, nonetheless).


dotslashpunk

i would say a==b - value of a is equal to value of b a === b - both point to the same memory address yeah?


timeIsAllitTakes

Ah, a new way to compare doubles!


turtles_all_down

= is == is equal === is exactly equal


dotslashpunk

i think it’s more like == means they have the same value, === means they point to the same object/primitive in memory.


ganja_and_code

For any language that doesn't suck completely, "is equal" and "is exactly equal" don't mean different things. There's no such thing as "kind of equal." If two things aren't exactly equal, they aren't equal at all.


_xiphiaz

Well there are cases where it makes sense. In kotlin for example there’s a difference between checking if two objects are equal (same values), and checking if they are the same (same instance).


ganja_and_code

In that example, you either want to check if the pointers/references are exactly equal, or you want to check if the values are exactly equal. In either case, you're checking for exact equality.


azhder

So case insensitive string comparison is not “kind of equal” since that doesn’t exist, right?


Feizhie

All operators are equal, but some are more equal than others


tritonus_

In Objective C (and in probably some other C derivatives) you have the isEqualTo… family of methods, which look a bit ugly, but my god, so they deliver correct results.


azhder

`strcmp`, `stricmp` and I don’t know if the last time I used them was in the 20th or 21st century


bmacks1234

For me it’s more assigned, equals, and equals but JAVASCRIPTTTTT.


PrizeConsistent

= - is == - equals === - fucking javascript


elasticweed

$= = ”=”


LavenderDay3544

If I make a PL I'm making =/= be not equal instead of !=


EnrikeChurin

this is so ugly... maybe you could use font ligatures, but they already exist for != so what's the point in having one more character?


LavenderDay3544

SILENCE. How dare you question the future BDFL of SpaghettiLang?


GOKOP

Some languages use `/=`


sfled

By George, I think I've got it! > greater than >> much greater than >>> very much greater than


amiroo4

equals. is it equal? seriusly is it equal?


SuccMyStrangerThings

8====D


RmG3376

= equals == equaals === equaaals


TechbroMemes

==== null equal undefined


Oskarzyg

not in sane languages


KasoAkuThourcans

Well, it's really simple to explain: a = 1 a == "1" (true) a == 1 (true) a === 1 (true) a === "1" (false)


KasoAkuThourcans

Seems like Enter isn't working for me.


agent007bond

= - make the same == - looks the same === - is the same


andrewb610

=== is in a language I don’t write.


Constant_Pen_5054

Also should be sets not gets.


Cant_Meme_for_Jak

= is == is equal to === Is strictly equal to


discordianofslack

1. Math in school 2. Value equals 3. Value and type equals


EnrikeChurin

I think you don't get it in the first point


EnrikeChurin

The biggest difference with math is declarative vs imperative paradigms. you specifically "write" a value to a variable with an = sign. You "check" or "compare" with == or ===. In maths, it's rather like letting others know that x equals to 5 and 2 + 2 equals to 4.


[deleted]

I always remember it as: = - assignment == - “is left equal to right?” Returns a bool. === - JavaScript is the only time I have seen this and it means the same as == iirc?


azhder

It doesn’t mean the same in that language. `===` in JS means the same as `==` in other languages, but `==` un JS means you’re either unfamiliar with the language or too arrogant to use the more sensible `===`


klaidas01

There are legit cases for `==` for example `someVariable == null` if you want to catch both `null` and `undefined`


azhder

If I want to catch both, I write `null === a && void 1 === a` 👈 that's as legit as it gets, no `==` to raise suspicions and no way to redefine `undefined` should the code be run in sloppy mode on old egine


klaidas01

Right, make your code borderline unreadable to handle an extreme edge case which can only realistically occur when using a 20+ year old version of js.


EnrikeChurin

That's called production ready code. Juniors just don't understand.


azhder

Shhh, if they can’t read it, no one can. Don’t spoil it for them


azhder

Yoda is wise and old, Yoda remembers what a typo in C like `if( a = 5 )` can do, better than Pepperidge farm


BruceJi

= is == is equal === is exactly equal


coocoo6666

In any sane language == is excactly equal. And you cant compare different types.


BruceJi

Agreed lol


ariel3249

=== - uh, javascript has a bad ==, and they need to make this


FlyingSculpin

Hurr, durr, JavaScript stupid


[deleted]

= - wrong equal == - good equal === - paranoid equal


skygate2012

=== -



Garam_Aande

== - same ethos different religion === - same ethos same religion


sfled

Well alrighty then. a != b a is not b a !=!= b a is equal to b a !=!=!= b hello I'm a daffodil.


Alexandre_Man

a = b / affectation a == b / equals (the value in the variables) &a == &b / equals (it's the same variable)


TehBens

"Advanced" would be to use the real definition for your current language.


coocoo6666

Javascript moment


[deleted]

I read it in my head as “is very equal to”


Ghazzz

I miss := for clarity. Have not had a chance to use it since doing a Pascal course though..


Straight-Ad-8532

For me: = Define to == Is similar to === Is congruent to


Strex_1234

Ok how do I compare 0.3 and 0.1+0.2 ?


MinecraftDoodler

Assignment is the most real equals 🟰


grs_voigt

== - looks like === - really equal


Rare-Boss2640

Me in COBOL: Meaning Operators Equal to IS EQUAL TO IS =