Comments by "Anony Mousse" (@anon_y_mousse) on "everyone is coding like yoda. (should you?)" video.
-
This is one of those few things that Pascal actually did better than C. In fact I opted to copy that for my own language, := to assign, = to compare shallow, and == to compare deep. Well, copy and amend. As it turns out, I do assign variables at times in condition headers, and it would be quite annoying to give up that ability or make it a warning/error. The solutions that people come up with often make no sense. Like in Java, "gee, using goto is problematic if you don't know what you're doing", "we'll just delete it from the language and it'll be fine." Turns out that sometimes your code looks worse without it and is even more spaghetti-fied. The same could be said for Yoda notation which wouldn't catch if ( a = b ) errors, if it's not intentional.
5
-
2
-
2
-
1
-
1
-
1