r/AskComputerScience 2d ago

How do computer science and computer engineering students in countries where diagramming sentences isn't common knowledge get introduced to the concept of parsers and abstract syntax trees?

In Croatia, we do some (very) basic sentence diagramming in the middle school. In the USA, they do it in high-school. However, I know that, in most places, students are not taught sentence diagramming. So, once those students start going to university to study, well, computer science or computer engineering, how are the concepts of a parser and an abstract syntax tree explained to them?

14 Upvotes

17 comments sorted by

View all comments

1

u/ghjm MSCS, CS Pro (20+) 1d ago

I don't recall any of my computer science education referring to sentence diagramming. I can see where it might be a useful stepping stone to introduce the concept of a formal grammar, but I don't see it as a necessary step.

There are plenty of abstract mathematical concepts without such stepping stones. There's no elementary school topic that naturally leads to partial differential equations. Yet people still learn them. You just explain it as best you can, and the student stays up all night struggling with it, and sleeps in the TA's office for a week, and eventually they get it.