4 ms·
Traditionally? I don't think there was a "tradition". ":=" was used in Algol. "=" was used in Fortran. COBOL didn't use either "=" or ":=".
by AnimalMuppet 9y ago
Traditionally? I don't think there was a "tradition". ":=" was used in Algol. "=" was used in Fortran. COBOL didn't use either "=" or ":=".
- Certhas 9y agoFrom the article: > Looking at this as a whole, = was never “the natural choice” the assignment operator. Pretty much everybody used := for assignment instead, possibly because = was so associated with equality. Nowadays most languages use = entirely because C uses it, and we can trace C using it to CPL being such a clusterfuck.
- AnimalMuppet 9y agoAnd I dispute the "pretty much everybody used" part. In fact, I think the article contradicts that opinion. Algol used it, and so did Pascal. But Pascal was only a year old [Edit: at the time the choice was made for C] - it [Pascal] hadn't set the world on fire yet (to the degree that ever did). That leaves Algol using ":=", and FORTRAN, COBOL, and Lisp not using it. That's not "pretty much everybody used".
- hwayne 9y agoYeah, it's probably more accurate to say that "everybody from the Algol line used := for assignment", with C being the first language of that line to stop.
- kps 9y ago> From the article: Articles, like desserts, aren't always right. I am sorely tempted to pull out Sammet's book tonight and start counting.
- kps 9y agoToo late to edit, but I've gone and done it: scanned through Sammet's Programming Languages: History and Fundamentals for languages with identifiable assignment statements. I skip assembly-style, English-like (COBOL etc.), and functional-style (LISP etc.) syntax, and for summary purposes ignore accompanying keywords like BASIC's LET. Results: ν = ε 18 (AMTRAN, BASIC, COLASL, CPS, FORTRAN, FORTRANSIT, JOSS, JOVIAL, Klerer-May, Laning & Zierler, MAD, MADCAP, MAP, MATH-MATIC, MIRFAC, PL/I, QUICKTRAN, UNICODE) ν ← ε 4 (APL, DIALOG, IT, LISP2) ε → ν 2 (MADCAP, NELIAC) ν := ε 1 (ALGOL) ε * ν 1 (BACIAC) So pretty much everybody used ‘=’. ALGOL was an outlier, though admittedly more influential than BACIAC.
- deleted 9y ago[deleted]
- Retric 9y agoFORTRAN was far from the first high level language. Plankalkül for example was out a decade earlier and used →. EX: P1 max3 (V0[:8.0],V1[:8.0],V2[:8.0]) → R0[:8.0] https://en.wikipedia.org/wiki/Plankalk%C3%BCl https://en.wikipedia.org/wiki/Plankalk%C3%BCl So, there really was a lot of languages out there, but := was fairly common because it was easy to parse and type.
- jandrese 9y agoPlankalkül had the advantage of not having to run on a real machine. As far as := is concerned having to use the shift key for an assignment is less than ideal but there really aren't any better options on a modern keyboard. I think C's use of = is a bit braindamaged but it is nice and quick to type.
- roywiggins 9y agoIt didn't actually contribute much to the evolution of other languages though, right? Had anyone even heard of it when Fortran/ALGOL/etc were being designed?
- 80386 9y agoZuse seems to have been under the impression that some of the ALGOL designers were aware of it: https://books.google.com/books?id=AsvSBQAAQBAJ&pg=PA522&lpg=PA522 https://books.google.com/books?id=AsvSBQAAQBAJ&pg=PA522&lpg=... Rutishauser was, at least.
- dragonwriter 9y ago> "=" was used in Fortran. And most BASICs, though some (most?) required the keyword LET to introduce an assignment, as well.
- raverbashing 9y agoLet became optional quickly it seems But most BASIC versions would accept 'let a = 1' Personally, I don't see why the big fuss. If your assignment and comparison operators are the same the only thing you lose is doing x = (y == 2); kind of expressions (since you would disambiguate from conditional expressions). Now, assignments are done more frequently than comparisons, hence why it makes sense for it to be the simpler/shorter one.
- boomlinde 9y agoYou wouldn't even lose that if you can accept that assignments can't be expressions, which seems like a bit less of a loss.
- kbp 9y ago> And most BASICs, though some (most?) required the keyword LET to introduce an assignment, as well. LET was virtually always optional; an expression by itself on a line (like 'X <> 10') is a syntax error anyway, so removing LET doesn't introduce any ambiguity.