

Ask HN: Academic Foundation When Learning To Code? - learncode

Often when learning to code, people say "just create something." And while that's certainly valid advice, which I am following, I feel I am skipping out on the entire academic component. When I see ideas that push the envelope, I can't help but feel there are at least basic academic (mathematics, algorithms, etc) concepts involved. Learning to code for the web, from books and tutorials online, seems to just involve tossing text about, unless you're academically trained. So I guess my question is: Should I try to incorporate academics in my pursuit to become a coder? Would you recommend MIT OCW? Or will I eventually learn this through the creation process on a need-by-need basis?
======
kd0amg
Data structures, algorithms, language/automata theory, computer architecture,
set theory, logic, graph theory, linear algebra, combinatorics, and abstract
algebra have been the subjects I got the most mileage out of.

Data structures and algorithms will teach you to do more complicated tasks
than "tossing text about." Languages and automata lead into algorithms for
text processing. Architecture may be less generally useful, but I find it
interesting (and unavoidable since I'm interested in compilers). Set theory
and logic are sort of the base language for other topics in math. Abstract
algebra seems to be the canonical way to really learn how to prove things.
Graph theory and linear algebra have some more direct ties to computer science
topics (e.g. linear algebra comes up a lot in 3D graphics). Combinatorics does
too, but a lot of it seems to be a quick way to realize that brute force is
going to be a bad idea. There are a lot of ties between some of these
subjects. Algebraic graph theory applies linear and abstract algebra to graphs
(I recently had a chat with a professor on applying algebraic graph theory to
characterize finite automata). A lot of graph processing algorithms, of
course, make more sense with a good background in graph theory. I've also run
into some other interesting topics for which the math background was
necessary: for example, error-correcting codes are easily understood with
linear and abstract algebra.

The best thing studying math has done for me is to give me many different ways
to describe a problem. Chances are one of the ways will have some well-
developed theory behind it revealing a nice way to solve the problem. What you
specifically will gain from such study will depend a lot on what you work on.

------
gdl
The answer to this depends pretty heavily on what you're wanting to program.
If you're planning on writing protein-folding software, or CAD, or a database,
by all means dive deep into math and algorithms. A typical web or desktop app?
Not so much.

A general understanding is helpful to form an intuition about what options are
available for a given problem and what the tradeoffs would be, but in most
cases you'll rarely have any reason to write the hard bits yourself. That's
what library code is for.

That said, if you have an interest in that kind of stuff, learn it! Even if
you rarely use the more complicated parts in practice it will give you a solid
base for deciding how to implement things, and you'll get a good sense of just
how efficient things _can_ be so that you'll be more able to recognize poor
solutions when they show up.

