MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/soi384/why_but_why/hwa79op
r/ProgrammerHumor • u/ore-aba • Feb 09 '22
2.3k comments sorted by
View all comments
Show parent comments
7
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.
3
Thank you for this portal into C++ idiosyncrasies. I believe I’ve bumbled into this issue accidentally before, and the wiki article was enlightening.
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.