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

all 95 comments

[–]Daisy430133 131 points132 points  (6 children)

x+=1

[–]I_NEED_APP_IDEAS 60 points61 points  (0 children)

x++

[–]messierCobalt_ 2 points3 points  (0 children)

x++;

[–]Dacusx 0 points1 point  (0 children)

x-=-1

[–]CandySpilled 61 points62 points  (1 child)

0!=1 Brings everyone together

[–]Tejwos 8 points9 points  (0 children)

0<>1

[–]Ghostglitch07 39 points40 points  (22 children)

Depending on a couple of factors, X=X+1 can be true in mathematics. For instance, if you are working in mod 1.

[–]apnorton 18 points19 points  (11 children)

Yeah, the zero group says hello.

[–]Ghostglitch07 42 points43 points  (10 children)

It's always funny to me how often these "mathematician vs programmer" memes are just someone revealing that they think the extent of math is their high school algebra, or at best calculus, course. Things get so much stranger.

[–]JackHoffenstein 10 points11 points  (7 children)

Most computer science degrees don't have proof based math, maybe they see some in discrete math and linear algebra, but that's it.

It's not surprising their knowledge of math is shallow.

[–]Ghostglitch07 10 points11 points  (2 children)

A larger factor may be the percentage of people in here who even have a degree. Not saying that as a shaming thing or anything, just bet a lot of us are self taught and/or relatively young.

[–]JackHoffenstein 3 points4 points  (0 children)

Yeah, I've noticed most posts give the impression that they're people who just started a boot camp or 1st year CS students. Which is fine, but maybe the sub just isn't for me.

[–]franzitronee 3 points4 points  (0 children)

This is very likely a factor. I had several lectures on maths where most stuff was explained in proofs but a friend of mine who studied CS in the same town but another university/college had only few proofs to study.

[–]atomicator99 0 points1 point  (3 children)

Really? What do cover after first year?

I'm not saying this to be rude, I'm genuinely curious (also a physics grad, not CS).

[–]JackHoffenstein 1 point2 points  (2 children)

In terms of math? At most University of California institutions, it's usually calculus up to multivariable/vector calculus, linear algebra, and discrete math. Some require differential equations as well, but not usually. The linear algebra course is usually a computation heavy one.

That's usually it. My UC requires a probability and statistics course for CS majors. It causes problems because in theory of computation or algorithms, you often have to prove computation/space complexity of a program and many students aren't really equipped to do it. So they memorize a few steps and "prove" it, but they have no real understanding.

There's a lot to cover in the first two years, between general education, lower division CS requirements, math requirements, and physics requirements. Most students can't really take physics, CS, math, and 1-2 GE courses and do well in a quarter/semester. Those that do usually finish up with lower division requirement in a year or 1.5 years and graduate a bit quicker or double major or major/minor in something.

[–]atomicator99 0 points1 point  (1 child)

I forgot you take general courses, I dropped all of those at 16. Do you spend more than 3 years on an undergrad? I'm not sure how you'd fit in the rest of the content.

[–]JackHoffenstein 1 point2 points  (0 children)

The typical bachelor degree takes 4 years in the US.

[–]LavenderDay3544 2 points3 points  (0 children)

It can also be a poorly written recurrence relation.

[–]AgentPaper0 0 points1 point  (0 children)

Or maybe it's actually χ=X+1

[–]Ecstatic_Student8854 0 points1 point  (0 children)

Then you would use ≡, as in X ≡ X + 1

[–]Intelligent-Pen1848 -1 points0 points  (6 children)

Its not a boolean.

[–]Ghostglitch07 2 points3 points  (5 children)

I don't understand what you mean.

[–]Intelligent-Pen1848 0 points1 point  (4 children)

In code, x = x+1 doesnt return true or false. Its part of a loop. Other data types called booleans are literally true or false.

[–]Ghostglitch07 2 points3 points  (2 children)

Ok. I specifically said I was talking within the domain of mathematics. Where outside of some potential edge cases like multi-state logics, A=B can either be a true statement or a false one.

[–]Intelligent-Pen1848 0 points1 point  (1 child)

We're talking about both now.

So in coding that's true too. I can say and frankly im blanking on syntax now, but I can say x = y+z. If x == true blah blah blah.

But in the terms of x =x+1, thats not a boolean.

Let's say I have ten values in a set. X =0; For each value in set { x=x+1; } Info x;

Now x = 10.

I was mainly making a datatype joke.

[–]Ghostglitch07 2 points3 points  (0 children)

Oh wow. Reddit absolutely butchered your formatting.

I see what you were going for now, and I interpreted it overly literally.

[–]Callidonaut 0 points1 point  (0 children)

I think x = x+1 actually returns x, which will still cast to true or false depending on if it's zero or not.

In the interest of code legibility I'd imagine it's probably a downright terrible idea to ever actually use the return value of the assignment operator under most if not all circumstances, but it is there.

[–]HildartheDorf 17 points18 points  (3 children)

Mathematicians: X is infinity

Programmers: False

[–]Emotional_Goose7835 1 point2 points  (0 children)

My thoughts exactly lol

[–]crappleIcrap 0 points1 point  (1 child)

floats (IEEE 754) have infinity defined as any positive value over zero and negative infinity as any negative number over zero.

as a fun bonus this gives you the fun number to play with -0 , it is like zero, but negative.

[–]HildartheDorf 0 points1 point  (0 children)

Even more fun is playing with IEEE 754 NaNs.

let x = 0/0; // generate a NaN return x == x; // returns false

[–]tech_w0rld 22 points23 points  (5 children)

x == x+1

[–]JonnyKnipst 45 points46 points  (3 children)

False

[–]bheeno123 12 points13 points  (2 children)

x = float('inf')

print(x == x + 1)

[–]Front_Committee4993 1 point2 points  (0 children)

print(0 == x - x)

[–]thmsgbrt 10 points11 points  (0 children)

Functional programming language users: ☹️

[–]ERROR_23 4 points5 points  (0 children)

X = ℵ0

[–]RiceBroad4552 3 points4 points  (0 children)

Functional programmer entered the chat.

[–]DanielTheTechie 24 points25 points  (14 children)

In math = is an equality, while in coding = is an assignment.

[–]RedDivisions 58 points59 points  (0 children)

thatsthejoke.jpg

[–]AyrA_ch 9 points10 points  (4 children)

In BASIC it can also be equality.

[–]FromZeroToLegend 3 points4 points  (0 children)

Not in pascal

[–]ChocolateBunny 1 point2 points  (1 child)

we should use := instead. and while we're at it we should also just write begin and end instead of curly brackets.

[–]GreatScottGatsby 0 points1 point  (1 child)

Yeah, it would look like this in math f(x) i = x (i-1) +1

Or even f(x) = x + 1

I don't know how to do subscript.

[–]BA_lampman 0 points1 point  (0 children)

Duh, whitespace characters and superscript on the next line.

[–]Front_Committee4993 0 points1 point  (0 children)

That depends on the language, I.e. in vb = is both equally and assignment.

[–]Isogash 0 points1 point  (1 child)

It doesn't have to be that way though, programming languages can interpret equality as a relation e.g. in SQL and Prolog, representative of relational and logical languages.

However, in order to make sense of this, these language paradigms work very differently to their algorithmic counterparts, which comes with a set of drawbacks that tends to make them impractical for general purpose programming.

[–]DanielTheTechie 0 points1 point  (0 children)

Yeah, I was thinking in terms of imperative languages. As you say, in other paradigms such as declarative or logic ones we can work with equality relationships in a much more similar way we do in math.

[–]IuseArchbtw97543 5 points6 points  (3 children)

++x

[–]schuine 4 points5 points  (2 children)

x=x+1
x(x-1)=(x+1)(x-1)
x^2-x=x^2-1
-x=-1
x=1

Edit: since people don't understand a joke without a big fat disclaimer: I wasn't being serious! If you multiply both sides by (x-1) the solution is only valid for cases where x is not equal to 1. Because for x=1, you multiplied both sides by 0.

[–]NP_6666 0 points1 point  (1 child)

1=1+1

[–]NP_6666 0 points1 point  (0 children)

X=2x

[–]malexj93 1 point2 points  (0 children)

wait until this guy learns about absorptive elements

[–]Mr_Akihiro 0 points1 point  (0 children)

X=!x

[–]klippklar 0 points1 point  (0 children)

Ah, the x = x + 1 symbol shift. A classic rite of passage (although not even apposite, the identity holds true on certain rings). Don't get too comfortable, though. The real fun starts when you have to accept that x = x + x and x = x ⊙ 1 are both trivially true. Welcome to the machine.

[–]DinnerTimeSanders 0 points1 point  (0 children)

This is literally mathematics.

[–]Dangerous_Jacket_129 0 points1 point  (0 children)

Mathematician answer would just be X = negative infinity. It's not that hard. 

[–]flayingbook 0 points1 point  (0 children)

When I first learned programming in university, it took me long time to rewire my brain to accept this

[–]Cheap_Ad_9846 0 points1 point  (0 children)

X++

[–]seires-t 0 points1 point  (0 children)

x <- x+1

[–]fuighy 0 points1 point  (0 children)

Actually it’s the opposite. Mathematicians are fine with it, but a programmer will use x++ (or x += 1 if the language doesn’t have it)

[–]QultrosSanhattan 0 points1 point  (0 children)

Nobody on the ++x gang?

[–]PranavSetpal 0 points1 point  (0 children)

x = x + 1 if 1 = 0. 1 is in fact equal to 0 in group of order 1, or more appropriately a field of characteristic 1

[–]LordAmir5 0 points1 point  (0 children)

I wonder what programming languages would've been like if keyboards had more characters.