Skip to content

Comment on Ask HN: Current college student with big goals.parent

Comments

I agree with most you said except a small detail: how is C good at expressing algorithms? There are far more expressive languages in the C family. The point of learning C I would argue is to have at least one low level language in your toolbox.

how is C good at expressing algorithms

Fundamental algorithms can't be expressed sanely in anything other than C. How the heck do you implement a hash table in perl, for example?

Sure, higher-level languages provide some data structures; but they're not always going to have the internal tradeoffs required to make them a good fit for your problem space. A few weeks ago I had to rewrite malloc (well, technically I added a caching layer in front of it) in order to get a 4x speedup to my code -- you're never going to do that in a language which doesn't even admit that malloc exists.

I'd argue that it teaches you how to express the algorithms in an imperative manner, which most of the world will use. That way, you'll be able to more easily read the code the rest of the world writes.

Or perhaps it's to teach you how poorly some languages express algorithms.

Learning C is also a very important step to understanding operating systems.

Which is actually not vital for doing a successful startup.

The parent said _understanding_, not writing your own[1].

To take an example of a web startup (just because the are the most common), here are some question that require understanding the basics of operating systems:

1) "why is my database cache constantly being swapped out to disk when there's enough memory in my machine"

2) "why are the pages taking so slow to load, even though I'm only serving a few hundred hits a second"

3) "what is my webapp doing that's making python/ruby take up 100% of the cpu" (to find this out, you'd likely be using gdb, ltrace and strace which very explicitly require at least a passing familiarity with C and POSIX)

4) "why is there a process showing up in ps/top that I can't kill even with kill -9"

Finally, you certainly have to be a good programmer to start a startup: not the best one, not a "10x programmer", but a good one (irrespective of what sort of applications you write). You can't be a good one without understanding how your programs work.

[1] That said, I had my hands dirty in Linux source code when debugging an issue while working in (of all places) an email security company.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.