Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
alyx17238y1970 - Niklaus Wirth creates Pascal, a procedural language. Critics immediately denounce Pascal because it uses "x := x + y" syntax instead of the more familiar C-like "x = x + y". This criticism happens in spite of the fact that C has not yet been invented.
http://james-iry.blogspot.co.uk/200... -
TheSamsa868yBecause := makes it clear that it is an assignement.
= could be mistaken with a comparison. Also a = in a if clause could easily be overlooked as ==
;) -
@alyx But doesn't `=` feel much more right?
I mean maths taught us stuff like that? -
@TheSamsa okay i can get that.. might be the c-style thing that bothers me there. I guess back in the days such things were understood different.😊
-
vringar16198y@daintycode x:=y+z is defining x as y+z , while x=y+z is assigning the current value of y+z. Or at least this is what I remember to be taugh.
So in the second case x would have a fixed value, while with the first you had a function x(y,z) that always changed with it's (implicit) parameters.
So :
Z=3
Y=5
A:=z+y
B=z+y
Z=4
A has the value of 9.
B is 8. -
crisz81918yBecause in math notation, when you want to define something, you use := instead of =.
= should be used only for equations, when you're defining a variable or a function (still talking of math!) you should use the notation with colon. -
sirjofri5178yVery interesting in this context is metafont/metapost. It makes a big difference between comparisons and assignments. So if you type:
x=1
y=3x
y=4
It will tell you that y is off by 1.
Oh, and by the way: mf/mp understands things like: a+3b=c. If you give it more information like a=2 it uses all the relations between your variables to form a solution (or complains because of inconsistency).
Anyways, it is possible to explicitely assign a value with, guess what, d:=3
Metafont/metapost is great! -
In maths, assignments to variables are :=. 1=1 is basically an if statement which HAS to be right...
Pascal took this a step Fürther
Related Rants
-
linuxxx32*client calls in* Me: good morning, how can I help you? Client: my ip is blocked, could you unblock it for m...
-
IAmNotARobot67What. The. Fuck. Did. Just. Happen. A random girl followed me on social media. She looked nice and intelligen...
-
BrainDrain7Amazon Drive offers the most comprehensive data redundancy known to mankind. "Your data synced. A LOT."â„¢
Why `:=` instead of `=`?
undefined
curiousnow
pascal
dafuq