Hacker News new | ask | show | jobs
by ogre_codes 2151 days ago
It's easy to skip a lot of fundamental classes and classes which are less interesting. Lots of people would skip "Boring" topics like data structures and databases and focus primarily on just piling into learning Swift or Kotlin to build apps on the platform of their choice.

Math is another biggie I think a lot of people would skip. While I'm not quite sure everyone needs 3 semesters of calculus to be an effective programmer, I think it is helpful to understand at least the basics of calculus and trigonometry.

There are also a lot of aspects of formal schooling that help you prepare for work/ life later on. If you see a degree on someone's resume, you know they've done a least a little bit of collaborative work and building an app to someone else's specs.

5 comments

I absolutely, 100% regret not studying computer science in college, or at least learning CS fundamentals earlier in my career.

I spent years struggling to write quality code, and I couldn't figure out why: I knew syntax inside and out, but still struggled with tasks my peers could do while watching YouTube videos and chatting with their friends.

It's like I could spell but didn't know the first thing about grammar.

I eventually went back and took some classes online to fill in the gaps, but I feel like I would be much further in my career had I just went ahead and done it in the first place.

> It's like I could spell but didn't know the first thing about grammar.

That's a great analogy and I think often missed by many people. Spelling and arithmetic seem obvious as limitations in more complex fields (where communication and mathematics are involved). No one would say: "I can spell 'journalist' so I should be the editor-in-chief of the Washington Post." or "I can add 2 and 2 so you should hire me as an electrical engineer." (certainly not once they've grown up a bit, at least)

You have to advance to grammar, geometry, algebra, and more to find success in those fields.

But with programming, many people seem to stop at the point where they can program, and don't realize how much more there is to it (or not until much later). Programming is just the spelling/arithmetic level. Being able to design systems, select between different data structures and algorithms, understanding what a state machine is and how to structure your program using that concept, etc. These are the algebra and calculus of the field.

> understanding what a state machine is and how to structure your program using that concept

I don't really understand this when people say it. My first instinct is that you're talking about keeping functions as pure as possible.

The other thing I think of is simply understanding all (Or most) of the possible states in your program, which seems like common sense.

A lot of programs, or critical parts of them, are really just state machines. A concept exercised especially in freshman/sophomore CS and EE courses. If you understand them well enough, you can make implicit, ad hoc state machines explicit. This leads to much cleaner and more maintainable code. This is an ad hoc state machine not far from what I've seen in real code:

  ok_to_change = var1 && !var2 && var3 < 10;
  if(ok_to_change && ...) ...
  else if(ok_to_change && ...) ...
  else if(!ok_to_change && ...) ...
  ...
ok_to_change was added after someone realized how much redundancy was in the tests. But the whole thing was a state machine and could've been expressed better as such. There are lots of ways to do it. You could make a more explicit state variable (or function that returns the current state from a set of variables), use lookup tables, or have functions that call each other to represent the current state of the system (mutual recursion is nice). But by making it an explicit part of the system design it usually leads to clearer, more concise, and more consistent code (IME).
A state machine is more about modelling and restricting the transitions between states of your program. This is a great way to make complex algorithms tractable and less bug prone.
> It's like I could spell but didn't know the first thing about grammar.

Love this analogy for programming...

It also reminds me that English and Public Speaking are very important skills I picked up in college which are easily neglected in a DIY program.

What English skills did you acquire at uni? My English has always been quite good and I don't feel like formally studying English has helped me that much.

Perhaps I've just forgotten about how much I've actually learnt though.

A lot of people are not good at English, though. Especially public speaking.
Yes, definitely. That's why I'm curious about the specifics of what they learned rather than just "English".
My writing has been pretty decent since high school, but I did pick up some public speaking skills in college.

If you have great English/ Public speaking skills this isn't so important. But I know a lot of people have really mediocre communications skills.

Being on a student newspaper probably gave me some of the most valuable skills that I acquired in school.
I believe that could also be the case because of the amount of practice your colleagues could have had during college.
It's not knowing what you don't know. Sure, you can stumble into things, reinventing the wheel from time to time, but life gets a lot easier when you know what wheels are going in. I'm put in mind of Konrad Zuse finding out that Boolean algebra was a thing while he was wrestling with the mechanisms needed to make his first machines - just knowing that there was an established formalism and a calculus for binary made a huge difference in how and how quickly his work progressed. If he'd also learned about recurrence relationships, Z2 nd Z3 would probably have been Turing-complete by design rather than merely in potential restrospectively.
Practice isn't enough. Deliberate practice that pushes your boundaries with feedback is the critical part. That's much easier to get in a school, or a professional environment if you have a good mentor, which constantly pressures you to go deeper into the field and try new things than solo practice. Working on your own it's tempting to reach a level of comfort and not go further, or to reach a point where your skill level seems "good enough".
There's a reason why whiteboard interviews are so popular: they seek to find candidates that have strong CS fundamentals. It's much easier to jump from languages to frameworks or ecosystem once you have a strong grasp of fundamentals than it is if you only learned how to make apps using one framework.

I've seen self taught students really struggle with introductory courses because they assumed they would breeze through fundamentals because they already knew how to build web-apps.

Honestly, I would say skip calculus and go for linear algebra instead.

Really, 90% of the advanced mathematics I do is linear algebra, and I don't have a code-monkey job. Linear algebra has so much mathmetics bang for very little complication bucks.

Take them both.

Those subjects are the foundations on which practical and applies computer science and programming are built. Not having a thorough understanding of them is like building a house without an understanding of its foundation. Don't be surprised if your magnificent Swamp Castle burns down, falls over, then sinks into the swamp if you don't know about foundations.

If you want to do Machine Learning or 3-D Graphics, you'll need more than 3 semesters of calculus, though.
As someone who doesn't particularly like math but thinks robotics is cool, I had the horror of having to encounter this type of thing: https://www.rosroboticslearning.com/jacobian
Robotics also requires a thorough understanding rotations and transformations (and its time derivatives), thus requiring a bit of Lie algebra. The calculations itself aren’t that complicated, but the concept is still quite confusing for beginners and quite intimidating if you go deep down into theory.
In addition, almost any control system with feedback requires some variant of PID control. “I” as in integral and “D” as in derivative makes it hard to get away from calculus concepts
I took a grad robotics course while in grad school for another degree. Doing all the translation matrix multiplies by hand was so much fun before something like Matlab existed. (As was going to the computer lab at 3am to do the simulations because that was the only time there was time available.)
For ML you really need both a class on probability theory, linear algebra, and/or a dedicated ML class. Lots of ML math ends up being the same principals over and over again. They may be borrowed from bigger subject matter, but often times you don't need to be an expert in those to get far. That said, if you're an ML researcher, then you definitely benefit from a very solid math/physics background. But if you're an ML researcher, chances are you did not only undergrad but a PhD as well, and you're not just considering an online certificate.
You need to know what grad is, that's Calc III. Is SVD even covered in Linear Algebra I? Convergence rate is also something you should understand.

This stuff is all pretty deep into undergrad curricula.

Data Structures is one of the best CS classes I've taken so far. I can now easily solve problems that would have seemed nearly impossible beforehand. I enjoyed it so much that I'm planning on taking an optional class next semester that goes over lesser-known and more advanced algorithms.

Once you know a lot of these algorithms, it becomes painfully obvious which developers haven't learned about them. For instance, I know someone who works as a driver for UPS and they have a piece of software that automatically plans a route to each delivery and pickup. There's a lot of variables such as certain packages that have to be delivered before noon, business deliveries that have to be done before the business closes, etc. The software they are currently using is not efficient at all. It will have them deliver to a building, drive down the street and deliver somewhere else, and then drive back and deliver to the building next to the first one. It's so painful to hear about this software because I've solved a very similar problem in under an hour at a programming competition using Dijkstra's Algorithm and Traveling Salesperson. Obviously, my solution didn't have nearly the same level of variables, nor was it held to "enterprise" standards. However, considering the level of inefficiency the software constantly produces, I'm convinced that it isn't using any standard algorithms but instead some hacked-together solution from a programmer who hadn't learned the established way to solve similar problems.

I guarantee that UPS has had teams of computer scientists, mathematicians and probably statisticians working on package scheduling and routing over the decades. The traveling salesman problem, which UPS package routing is, is an NP-hard problem, which means that guaranteeing an optimal solution is going to take an exponential amount of time. There is no "established" way to exactly solve NP-hard problems with large inputs in a reasonable amount of time. Rather, there are approximate approaches which use domain-specific information to inform what kind of heuristics one can use to achieve a tolerable result.
Totally agree with you. Oddly enough I am currently doing a market research project on commercial applications for Quadratic Unconstrained Binary Optimization (QUBO) and also Constrained Binary Optimization. Anyway we were talking about UPS, and just for reference if I search my 3 degree network on LinkedIn for the combination of CPLEX (an IBM optimization package) and UPS I got almost 400 hits. Now admittedly some of those people used to work at UPS, some work there now. But there are clearly many, many computer scientists, operations research scientists and mathematicians working on these and other optimization problems at UPS.

On the other hand the grandparent comment just illustrates how even with all those optimization resources individual "decisions" may still be stupid in the moment even though the overall solution is "good enough".

Yeah, UPS is pretty famous for how much effort they put into optimizing routes: https://www.ups.com/us/en/services/knowledge-center/article....

I highly doubt someone could beat them in an hour at a hackathon by just saying “shortest path first” and calling it solved.

I know this personally because I took Computer Information System in college and not Computer Science. So we covered databases, but more or less glossed over a lot of important algorithms which I'd have loved to have later in life.

Though there is some benefit to having a business degree as well so it's not all bad.