r/java • u/nlisker • Mar 26 '26
Carrier Classes & Discussing Syntax with Brian Goetz - Inside Java Podcast 52
https://www.youtube.com/watch?v=b6cXuA84c9g
86
Upvotes
r/java • u/nlisker • Mar 26 '26
View all comments
Show parent comment
12
u/brian_goetz Mar 27 '26
There are good reasons that Pascal and its ancestors picked this syntax, and its not only "looks like an equation but isn't." If you use `=` for assignment, you have stolen the best syntax for the comparison operator. (After 50 years of C, we're now used to `==` as the equality comparison operator, but it was decidedly weird at the time.) Other contemporaneous languages picked backarrow for the same reasons.
But of course the power move is to do what functional languages do; rather than picking a different syntax for assignment, they went the other way, by ensuring that `a = exp` is a statement of equality, making the problem moot.