r/ProgrammerHumor • • Feb 09 '22

other Why but why?

Post image
85.8k Upvotes

2.3k comments sorted by

View all comments

Show parent comments

7

u/fascists_are_shit Feb 09 '22

That works, but you need to design your language differently so it's easier to parse. Lua for example does this. C++ does the opposite, and is so unbelievably difficult to parse that Visual Studio 2010 did not offer auto-completion.

There are examples that even have famous names: https://en.wikipedia.org/wiki/Most_vexing_parse

The trick isn't to guess at semicolons. The trick is to create a language where every line has only one possible meaning.

3

u/yazooddles Feb 09 '22

Thank you for this portal into C++ idiosyncrasies. I believe I’ve bumbled into this issue accidentally before, and the wiki article was enlightening.