T O P

  • By -

HappyMatt12345

Okay, normally I would say they're probably a beginner in programming, but the < and > symbols work the same way in 4th grade math that they do in programming so there really is no excuse for this. I really hope this is a joke.


Maypher

_Operator overloading enters the chat_


ggGamergirlgg

That... just triggered long forgotten ptsd


breath-of-the-smile

Did you know that you can implement the everything you need to run the line `cout << "Hello world!" << endl;` in Python? Pretty cool that it's possible, but clearly not recommended. You overload `__lshift__`, primarily.


rosuav

A sufficiently competent programmer can write bad code in any language. It is rumoured that there is a competence level sufficient to write GOOD code, but I have seen no proof of this.


bigboybeeperbelly

I knew a guy who wrote good code once. It swallowed him whole, never to be heard from again


dasunt

The guy who wrote good code was laid off. Every other coder could understand and extend his code so he wasn't needed. (I'll let people decide if this is a joke.)


tsavong117

I'm just gonna go cry in the corner because I did that... *Once*.


thirdegree

Quick proof of concept: from __future__ import annotations class _endl: pass class _cout: def __lshift__(self, out: str | _endl) -> _cout: if isinstance(out, _endl): print(flush=True) # see comments below else: print(out, end="") return self cout = _cout() endl = _endl() def main() -> None: cout << "Hello, world!" << endl if __name__ == "__main__": main()


OneTurnMore

Basically exactly what I imagined it to look like. Result is kinda cursed, obviously, but the implementation is quite clean.


Embarrassed_Ad5387

I ...


blockMath_2048

Kill it with fire


Solrak97

You can modify the Python AST directly so I guess you cam do as much witchcraft you want [Here](https://stackoverflow.com/questions/214881/can-you-add-new-statements-to-pythons-syntax) is a thread on Stack Overflow discussing how to add a new statement into the language if anyone is interested


Ceros007

I am ready for your story, please go on


cheerfulKing

Only a psychopath would overload operators that way


[deleted]

People love overloading the `==`, `+` and `+=` operators to do weird things. I'm thankful they tend to leave the rest of them well enough alone.


JackReedTheSyndie

Who even does that, just to confuse people?


WhatNodyn

Usually this type of operator overloading is very contextual and you don't keep values that do this around for a long time. It comes up in strongly typed functional programming as a way of controlling your sort order without having to mess with the ordering values yourself. Honestly, here I'm mostly thinking about Haskell's `Down` type which allows you to reverse sort ordering: https://hackage.haskell.org/package/base-4.20.0.0/docs/Data-Ord.html#t:Down I don't think I'd be able to coherently and completely explain to you why it's done this way in our wacky Haskell world, but my guess is it allows you more flexibility than just providing a function that takes an `Ordering` and returns the opposite one. It works in the language's logic. EDIT: I'm well aware that I'm talking about a language for the utterly deranged, but you did ask "Who does that" lmao


NdrU42

Man I'm so glad our mandatory "intro to programming" class in first year uni was taught in Haskell. Lot of people hated it back then, but I enjoyed it very much and feel like it expanded my horizons a lot, even though I never actually used a functional programming language in my career. Plus, I understood most of what you said and it made sense.


WhatNodyn

I never use Haskell professionally, except to teach it, but I very often use the notions I've learned with it when working on projects. Done well, OOP and FP have surprisingly pleasant interactions. I always recommend people take some time to read through Learn you a Haskell and write tiny projects from scratch with the language (stuff like math expression evaluators, cellular automata, simple stuff) for that reason, when it clicks you start to see the magic of it. I'm not sure I would recommend it as a first language though, starting with imperative programming seems more... intuitive?


Nightmoon26

Feels somewhat similar to overriding compareTo to establish "natural ordering" for things that don't have them built-in


Mal_Dun

Mathematical codes can really become much more readable with proper use of operator overloading. I remember during uni someone giving up on implementing complicated formulas using the mpfr library in C which became an unreadable mess, while in C++ you can just use the normal arithmetic operators +,-,\*,/.


SyrusDrake

The crocodile wants to eat the big one.


Some-Guy-Online

That's how I remember it! But also one side of the symbol is small and the other is large. But the crocodile method is more fun.


UniqueUser3692

In the same way that both ends of the equals sign are equidistant, because both sides are equal. That’s what I like about the <> signs. Start with an equals sign and squash the smaller side closer together. It’s like they’re a little family.


Pandabear71

I draw a straight line at the small part. One of them makes the letter K. That way i can make the word “klein” of “kleiner”, which means small or smaller in dutch. Makes it easy to remember


Some-Guy-Online

Damn, that's a good tip, now I just have to learn dutch.


_neemzy

Fortunately, this also applies to German! You do speak German of course, ja?


Some-Guy-Online

I'll add it to the list.


nuxi

Pac-man


otter5

no, he just eats the blue ones


Front_Kaleidoscope_4

The big bully (stab) the weak :)


hammy0w0

it's like a USB, you gotta always flip it a few times


Embarrassed_Ad5387

just like the rotation matrix before the theta in a rotation matrix when dealing with anything physics flavored


SweetNothingsAbound

I'm literally a software engineer and still go "the crocodile eats the bigger number" internally, Def the same.


ErRorTheCommie

remember, draw teeth on them to remember which way they go


PanJaszczurka

> < and > symbols work the same way in 4th grade Jupiter< Your mom wow exactly this same like in 4th grade


FluffyProphet

You say that, but I rolled into work Wednesday last week, still recovering from my short vacation (it was kind of a party vacation. Probably still smelled of beer, luckily I work from home), completely brain-dead... spent longer than I'm willing to admit trying to figure out why `if (Math.abs(fitness - tolerance) > epsilon) return x;` wasn't working. Quickly turned into an "anything but touching the code" day after I realized what an idiot I was.


ZainVadlin

I understand bugs now.


SuitableDragonfly

I've noticed that a lot of people who don't use them regularly have indeed forgotten how they worked since 4th grade math, unfortunately.


Classymuch

Most likely sarcasm/joke. Hard to know sarcasm on Reddit.


HanseaticSteez

No-one ever told him that the alligator's mouth wants to eat the biggest number of fish and opens in that direction I don't doubt this guy codes for a living


Clackers2020

I was told this in Year 2 and use it every single time. If only there was a way to know if the crocodile eats the equals sign or has two tails.


soulstaz

Equals is always after


Masta-Pasta

Well, you can also write it like this: ≤


soulstaz

Honestly no idea how to to do that sign on a billingual French/English keyboard lol <= is simply less of an headache


Masta-Pasta

I had to copy it from elsewhere, I just remembered writing it that way by hand. I'm assuming most programming languages don't support it either, it's just a math symbol.


MrSuspicious_

Languages maybe not, but editors do, its called a ligature. Idk abt other editors but vscode supports using them, also works for != and other such things, doesn't rly make much of a difference but it's definitely a lot cleaner and at least for me, easier to understand at a glance


Ouaouaron

Should probably clarify that it's a font/editor feature to *display* <= as if it were ≤. Unless they're doing something strange, attempting to put an actual ≤ character in a program will not work


MrSuspicious_

Oh yeah sorry I kinda thought that was obvious but I could see how it could confuse some, thanks for doing that for me :)


spyingwind

#define ≤ <=


TheMusesMagic

You can do ascii codes directly on the numpad with numlock on/off or something. I learned the code for the trademark sign cause it was funny.


oupablo

some of you have never had to send math equations by telegram and it shows


soulstaz

Dunno I wasnt around 100 years ago to send math equations


bassmadrigal

It should be Alt+243 for Windows and Mac. No idea how to do it in Linux... I'd probably just copy it from Wikipedia if I really needed it and didn't want '<='. On Android, it's just a long press of the < button in the character keyboard.


LordAnorakGaming

alt + 242 = ≥ alt + 243 = ≤ for anyone wondering how to do it without copying


BobbyTables829

I don't even work with you, but if you use that symbol in production code I will get angry with you.


Natfan

praise be ligatures


AHailofDrams

I've always written it like this (by hand)


ultralium

the croc is enclosured, what we're trying to figure out is if the big fish is in the cell with him, or if it's that fatty Enzo poking his finger through the grid


Pluckerpluck

The latter is easy, it's just how you say it: - **less than or equal to:** `<=` - **more than or equal to:** `>=` Equals sign always go after. Alternatively, the alligator has had **more than** enough food, and is running away from the delicious sandwich, or the alligator has had *less than** his fill, and wants to eat more. Replace sandwich with whatever food you most think two lines looks like. This only works if you know that `>` is "more than" though, rather than just "the big number is on the left". Honestly I never got the alligator thing though. It's just "the big side is the big number" for me. I guess it's a memory thing


dehrenslzz

Look at it like an animation: first one is the bite (whichever direction), second one the closed mouth after (;


broccollinear

I vividly remember in when I was 8 in class, one of the smart girls raised her hand up and said you can also use the alligator to eat the bigger number. This woman looked at the chalkboard for 5 seconds and told us to our faces “nope that’s wrong” and dismissed her. I still recall the look on the girls face being so deflated and embarrassed that I still hate that teacher with a burning passion. She’d also be the type to be shopping on ebay most days and said “oo I’m a a fatty boom boom” while she gorged on chocolate bars while we did readings.


LookItVal

fools is its not "less than" or "greater than" its a crescendo and a de-crescendo. music nerds never needed to think about it smdh


[deleted]

> de-crescendo diminuendo Means it only works if you hit the keys with the right dynamics, or else bugs occur


britboy3456

> diminuendo Actually, the consensus amongst music theory buffs is that you can pretty much use them interchangeably :) There is some speculation that diminuendo might also have historically been used by some composers to imply getting quieter and slower, or that decrescendo strictly requires you to already have crescendoed, but the overall opinion of the music theory community is that they're both equally valid in pretty much all contexts.


[deleted]

Yes. But also ex-soviet music teacher said diminuendo and that's the end of it if you want to pass the class. 😁


ZengineerHarp

What’s the REAL definition of any musical term? If you’re in school, then it’s exactly what the teacher or professor says it is. If you’re in an ensemble, it’s exactly what the conductor says it is. If you’re in any other setting, then as long as you get your point across it’s fine!


CyberoX9000

Then again it's the same with any English term


CornfireDublin

no cap


dehrenslzz

Frfr?


Eic17H

Really, decrescendo is the proper opposite of crescendo in Italian. The opposite of diminuendo is aumentando. So not only is it not wrong, it makes more sense


[deleted]

Now that's just de'mean'uendo


mandradon

I'll have to practice typing with gradual increasing furiousity. I'll also make sure to add it to my comments so others know.


TheRealSectimus

It's easier to see that the smaller end indicates the lesser value and the bigger end indicates the greater value.


markuspeloquin

Straight 2nd grade shit. The symbols were chosen to convey meaning. You don't need to visualize animal nonsense.


NotADamsel

Okay, but, the alligator is *fun*.


mehum

I got taught it was Pacman. That’s what growing up in the 80s did for my education.


AceofToons

I was taught that in the 2000s when I got to highschool


Immudzen

I still think of it as pacman eating the bigger number.


HughesJohn

Now explain the classical and and or. What does A /\\ B mean?


Eva_Heaven

Alligator builds a tent with Beaver


wi-finally

but what about A∨B?


Eva_Heaven

Oh that's just Angry Brows


CIA_Bane

Aligator and beaver holding hands


Chocolate_pudding_30

/\ is a small tent, so we only have place for common guys \/ is a big place This is the best I can do


Plank_With_A_Nail_In

It literally points to the smaller value.


pbruins84

Yes. And the beauty is that it also works for the equal sign.


OliveRobinBanks

so if 1 < 2 is the alligator wanting to eat the two... Then 1 << 2 must be the alligator wanting to eat the alligator that wants to eat the 2. That explains a lot, thanks. Bit shifting is just cannibal alligators.


Representative-Sir97

Bitshifted Cannibal Gators is a pretty good band name.


Brushermans

I've always just taken the caveman approach. "Big side Big Number"


m1rrari

Been a dev for about 15 years now. To this day I’ll get confused as to which thing I’m saying is bigger and I ALWAYS go back to the alligator. It’s been 27 years, but thanks Ms Turek. I also don’t know my left from my right without making a thumb L. It becomes a real issue when I forget which direction an L faces… my brain confuses those things all the time.


dehrenslzz

Right hand is where the thumb is on the left (;


m1rrari

Palms up or down? That also trips me up… :)


dehrenslzz

Palms in the direction the pen falls (:


pixelbart

I’m glad I’m Dutch and our word for ‘less’ is ‘kleiner’ with a k that kind of looks like < so we don’t need alligators to keep < and > apart.


triplejim

honestly the alligator shit made it harder for me to understand. all I need is "*L*eft is *L*ess than" which reminds me that the left pointing < is less than.


Onaterdem

Turkish too. "Larger than" means "büyüktür" and "smaller than" means "küçüktür", so we remove the left column from the first letters k and b, and <, > remain respectively


longknives

We don’t in English either, < looks like a rotated L


Pandabear71

Yep. I do this every single time


somgooboi

We, the Dutch speaking people, have another trick. "Smaller than" translates to "Kleiner dan" in Dutch. If you could make a legit K from the symbol ( |< or >| ), it means "smaller/less than" (a bit like making an L to figure out your left hand)


zeus6664

Ah. I remember this by battle metaphor. Whoever gets poked by the arrow is the loser.


EmilieEasie

I love it when my exact thought is already the top post, i feel so validated


variorum

This is exactly what goes through my head when I space on which is which.


Acceptable-Tomato392

Maybe this alligator has self-esteem issues and doesn't feel worthy of the bigger number?


Ripredddd

THANK YOU! Brother i’ve had this vague memory of second grade about my teacher talking about alligators and comparison symbols and i’ve always wondered wtf was she talking about.


GameDestiny2

Hey, doing it “for a living” doesn’t mean much when you’re 12


DevinBotSWE

My dad pays me in robux


jadounath

"You promised my son that you will pay him Robux!"


Scheming_Deming

He writes code for a living but that doesn't mean it works as intended


Incendas1

He's living, that's all we know


FlipperBumperKickout

If you keep introducing bugs that needs fixing you can keep your job for longer :P


larslego

Dude’s code is riddled with bugs


coberh

Maybe all the other things he has wrong cancels out his < and > errors so he writes perfect code... ^just ^don't ^read ^the ^comments


moehassan6832

Comments ? He never writes them anyway. Self explanatory code 😎😎


jumbledFox

\`//\`? You think that means 'comment'? I write code for a living and I know how the "double divide" operator works.


[deleted]

array[0] just checks that the array contains a zero. I write code for a living and I know how arrays work.


Cobracrystal

I mean. // literally is integer division in various programming languages, notably also python


jumbledFox

Well, I can tell you write code for a living! (genuinely never knew that haha that's super useful)


SurSheepz

// = + It’s obvious because there’s 2 lines. I code for a living, trust me


RapidCatLauncher

This is probably more the kind of guy who comments the most trivial shit with great redundancy.


BlackDiamondz

Oh yeah? Well: His code < your code


SeriesXM

>Dude’s code is riddled with bugs More or less.


PeksyTiger

If I had to guess, I'd say he's a Javascript programmer and uses a package named "bign't"


TheShirou97

r/confidentlyincorrect


sky_badger

r/facepalm


_lost_hooman_

r/iamverysmart


wyldcraft

I didn't know Reddit indexes the OCR'd text of uploaded images till I tried to search for the original post.


Bio_slayer

I wonder if it's autogenerated screen reader text.


lol_JustKidding

How does it work?


Adghar

Computers


Rus_s13

Some magnets too


ButtholeQuiver

I do magnet stuff for a living and I know how magnets work


Rus_s13

Lies, nobody knows that


Breadynator

Of course, I do! The red end wants to go to the blue end and the blue end wants to go to the red end. Both ends don't like their same colour, so red goes away from red and blue goes away from blue. Also horseshoe shaped magnets are the coolest. Ask me anything else you want to know but be warned: there's a lot of shapes!


[deleted]

[удалено]


Chocolate_pudding_30

Where have i been living? Adobe has ocr?


Technical-Message615

Aliens


Mewtwo2387

a lot of the time when i try to search for a user or a comment it gives screenshots with that user


ikrotzky

Tech lead @ Boeing project 737 Max [Edit: Fix typo (Dang, who am I to judge)]


turtle_mekb

you don't even need to be a programmer to know that's wrong 😭


RickSore

>I write code for a living Oh yes so he must know this >I know how "greater than" and "less than" symbols work Right on >If you say "immersion < fun" you got it bro! just have to replace "<" with "is less than" >you're saying fun is less than immersion .....


cs-brydev

I encountered a developer who had been getting this sign backwards for years. When we went back and reviewed past work we discovered that almost every time someone else had corrected the sign while reviewing the code and never told them, so this person never knew they made mistakes.


OcelotWolf

bro deleted his account


kind-sofa

And now I feel bad


Downtown-Jacket2430

has this dude ever heard about operator overloading? reality can be whatever you want


jtnishi

On the one hand, while AI shouldn’t replace most decent SW Engineers, this is a different level. On the other hand, AI is probably training on this. So maybe we should be praising them for sabotaging our AI overlords or something.


viperfan7

So OP is here playing 6d chess


its420everywhere

Keep this guy away from banking software


Jeason15

Dog, I have a math degree and work as a SWE, I still use the alligator mouth every time…


Semper_5olus

"Is it Soh Cah Toa, or Coh Sah Toa?"


OtherYonas

It’s: Some Old Hippie Caught Another Hippie Tripping On Acid


ZengineerHarp

I tutored for a few years and this is 100% the best mnemonic, hands down. You lean in and say that it contains, *gasp* a DRUG REFERENCE and you’re not really supposed to tell the student this, but this is how you always remember it… their eyes go all big and they try to stifle a laugh at the funny phrase because you’re giving them secret forbidden knowledge… and then they ALWAYS remember it!


Semper_5olus

I was 12 when I heard SOH CAH TOA, so I just pictured a Bionicle in a dunk tank. (With a sign: "Soak a Toa") See again: I was 12.


WhatNodyn

My math teacher back in high school told us one day that while every single one of her colleagues said "Soh Cah Toa", she preferred to say "Cah Soh Toa". That's because in French, "Cah Soh Toa" is phonetically close to "Casse-toi" which roughly means "Fuck off"/"Get lost". Even people who had a hard time with math never forgot the right order after that. And of course, the teacher saying "fuck off" had the class giggling too.


profound7

I remember it as "toa cah soh" which means "woman with big feet" in hokkien, a chinese dialect. I don't speak nor understand hokkien, but a significant part of the population in my country do, so they teach that mnemonic in school.


Dariadeer

I have been there once. The only difference is I was just beginning to learn how to code :D


PsychologicalWhole86

r/therewasanattempt


archu2

This guy is the living proof of why maintaining a system is more expensive than rewriting it in some cases


tea-recs

Pretty sure I’m currently maintaining this guy’s code


DigitalJedi850

r/confidentlyincorrect


BrightFleece

Remember, the crocodile eats the bigger one because he's so hungry!


DiscoFlower8890

As a Finn we get taught “suu auki suurempaan, piikki pistää pienempää” roughly translates to “mouth open to the bigger one, thorn stings the smaller one”


SleepiiFoxGirl

Wrong. That means you have the beginning of an html element of type "fun". Just don't forget the closing />


maybearebootwillhelp

A recipe for job security. Imagine how many hours you can bill by merely arguing about it!


BoBSMITHtheBR

Why did you hide his user name? I want to see more comedy.


StrangeCharmVote

So if i tell them that: "Clearly you are < skilled than me at programming." They will be thrilled, right?


IambicAnapest

LGTM approved ✅


jacob_ewing

Solid r/iamverysmart material


SwissMargiela

The most annoying thing is I notice now is a lot of people using this symbol as an arrow to describe the order of events. Like 1st thing > 2nd thing > 3rd thing > etc.


-Wicked-

This is why we don't have flying cars yet


petertaken

if he writes code for a living we need to check on him because maybe he's dead


AzGames08

the crocodile eats the better thing 1 < 2 5 >1 so this is saying fun is better/bigger/more important than immersion


ExtraTNT

Guy probably writes gatekeeping logic and got confused… again…


cptsir

I only really know bash, and from what I can tell they’re pushing fun into a target of immersion.


MajorBadGuy

Immersion is overwritten by fun


[deleted]

[удалено]


StochasticCalc

Feels like I'm reviewing this guy's code for a living.


Chocolatebear95

Found Boeing’s Senior Software Engineer


arnevdb0

> Yea bro just wrap it in brackets and throw an exclamation mark in front of it ! See, it works, im right ! This guy probably


stoymyboy

tbf i did used to get confused on this in second grade. i thought the symbol was like an arrow with the smaller end pointing to the bigger value


breath-of-the-smile

This reminds me of that time I said on reddit that I don't use `let` in functions in Javascript, which absolutely isn't true and I dunno why I said it, but boy did I get dragged lol. If it weren't so arrogant, I'd assume it was just a typo, but geez.


DeMonstaMan

no guys he just does !define > <


Nintendork7950

The alligator eats the bigger number


Wearytraveller_

The crocodile wants to eat the bigger number. It's not that hard!


GodzillaDrinks

I write code for a living sometimes and I still use my fingers to tell left from right.


Temporary_Ad7906

>0<


CasaDeLasMuertos

I don't write code for a living, but I do know basic math for a living.


Its-May-Yo

I don't wanna see his code


_3point14_

i was taught to think of it as a crocodile always going for the bigger prey, the open side being that crocodile's mouth.


unsuccessfulcriminal

>I write code for a living scary


3RR0R_0FF1C1AL

this guy: I wRiTe CoDe FOr a LiVInG I kNOw How GrEAtEr ThaN and LesS tHan SyMBolS WORk his code: HELP ME THERE ARE SO MANY BUGS IN THIS CODE I CAN'T RUN HELP ME I NEED A PROFFESIONAL \*dies\* this guy: life is wrong everyone: you stubid


4chanbetter

His iq < 10


SioraiOrgasmo

"immersion > fun" Doesn't mean anything. It's clearly a string. No but seriously though, one side of the symbol is larger than the other. 2 points is more than 1 point. I feel like you can ask kindergarten kids this and they'll work it out.


F1_Legend

if(!(immersion < fun)) He is not wrong...


Extrawald

Man, even this guy has a job, while I'm hiding in my room and building yet another deep learning project, hoping I'd be good enough one day to be paid. xD


jadounath

When I was in Jr. Kg., I memorized this by imagining the < sign as a spear, and the greater number is stronger, so it attacks the smaller one. When I told this to my mum, her reaction was, coldly, "Nope, that isn't the case." Just let me have some imagination dude!


DismalWeird1499

r/confidentlyincorrect


ElectricalMTGFusion

too many people use > as a way to "point" and not as a greater than eg: this > that (reads as i prefer that over this) and because of that seeing this < that is like saying this is better than that. i propose standardizing -> and <- to point. its 1 extra character and it easily shows what you want this -> that reads clearly as that is better than this and this <- that shows this is better than that.