Hacker News new | ask | show | jobs
by QuinnWilton 2420 days ago
> For whatever it's worth, as a data point relating to a recent discussion on whether a university CS education makes you a better programmer or not: We literally started learning about algebraic structures in the first math class on the first morning of the first year of university.

My problem with this argument is that this isn't a universal experience. I went to Waterloo, arguably one of the best CS schools in Canada, and the CS program didn't even cover algebraic structures.

I learned about them, because I spent all my electives taking extra math classes, but the vast majority of my classmates never needed to learn any math beyond basic combinatorics and some introductory complexity analysis.

I believe that these topics are incredibly important, but I'm not convinced that a college degree is a reliable way to be exposed to them. If your school covers this stuff, great! But at least in my experience, I think it's disingenuous to act like all computer science programs will.

2 comments

I have an MA in math and I was somewhat exposed to category theory and algebraic structures in my time at the university. I find knowing math generally is useful for programming but I haven't found it useful for understanding functional programming in particular.

I think functional programming uses category theory in a different fashion than even fairly advanced mathematics; Breaking Hungerford's Algebra text, in the chapter on Category Theory, he writes, "A significant part of the elementary theory of categories is the attempt to generalize as many concepts as possible from well-known categories (for example, sets or modules) to arbitrary categories". Which is a rather different approach than building programs.

Which is to say that for most mathematics, categories are tools for generalization or for providing a firmer foundation for existing mathematical structures. For understands monads as used by FP, the description as "little languages" seemed the best - it's way of not having side effects by using functions to incrementally construct output instead of doing output in the middle of computation.

Much of software design is about composition, which is where category theory shines, just at the most shallow levels.

If I dream up a way to tackle a problem, have I made a category? If I have two modules, can I compose them into one, is there an initial or final module, is composition associative? If there's some underlying structure, what's the free module based on it?

Those questions can help make more durable designs.

Just another data point: first time I encountered algebraic structures during my education in the Czech Republic was last year of grammar school, in a seminar for students who took maths as part of the exit exam (https://en.wikipedia.org/wiki/Matura#Maturita_in_the_Czech_R...). And then in the second year of CS at the university.

Also, we did functional, logic and also imperative programming in the first year. I really did live under the impression that CS education is meant to give you all these foundations, and it's a TIL today that it's not universally true.