←back to thread

517 points petercooper | 1 comments | | HN request time: 0.209s | source
Show context
marcofiset ◴[] No.8558994[source]
I honestly think this is ridiculous. Sure, this is an incredible feat, and congrats. But serioulsy, I would be ashamed to publish such unreadable code under my name.

What about naming your variables with descriptive names?

What about extracting complex conditions into well named function to understand what is going on (thus defeating the purpose of the "4 functions") ?

This list could go on forever...

Writing software is not a contest for who can write the most amount of code in the most cryptic way.

replies(12): >>8558999 #>>8559001 #>>8559009 #>>8559056 #>>8559071 #>>8559139 #>>8559196 #>>8559249 #>>8559421 #>>8560270 #>>8560608 #>>8561021 #
cbhl ◴[] No.8559071[source]
I actually found the code surprisingly easy to read; "tk" stands for "token", "ty" for "type", and so forth.

It's worth noting that compilers don't pop out of thin air -- you have to start with something simple in order to compile a more complicated compiler. Bootstrapping your own self-hosting compiler is a useful academic exercise, and you should try it sometime if you haven't already: http://en.wikipedia.org/wiki/Bootstrapping_(compilers)

replies(1): >>8559108 #
marcofiset ◴[] No.8559108[source]
Well, if this particular compiler is defined in 4 functions, why couldn't it be made out of more functions, enhancing the readability and maintainability of the code?
replies(2): >>8559144 #>>8559242 #
1. afandian ◴[] No.8559144[source]
Who says it's designed to be maintainable? Not everyone writes code for the reason that everyone else does.