Live data from Hacker News

Learn C

medium.com

31–40 of 182 posts

Re: Learn C

#31
post #24

Earlier quoted context omitted.

"lisp compilers are the simplest to write" I think Forth may have that honor, and people have done some pretty amazing things with simple Forth implementations. I do agree, though, that writing a simple Lisp compiler is a worthwhile exercise, and the Lisp In Small Pieces is a book everyone should have on their shelf.

I would say Brainfuck is even easier.

Really? I'd say that a Forth compiler in Forth is going to be somewhat smaller than a Brainfuck compiler in Brainfuck.

Re: Learn C

#32
post #7

How does a musician without any formal CS education and a admitted lack of understanding of some very fundamental software things, such as pointers and memory, land a San Francisco dev job? I thought those jobs were in very high demand

As a person with a masters in music, a bachelor in film, and now programming for a living, I def. believe that having a persistant interest in learning about those "fundamental software concepts" is what makes such a gig achievable, especially if you keep doing the extra work in your spare time (like taking Dan Grossman's unbelievable Programming Languages class or going through Zed's LCTHW).

Re: Learn C

#33

We need less code written in C, not more. We already have a problem with a massive, unreliable, insecure ecosystem of legacy C code that is hard to escape; writing more software in C makes that problem worse. Most software is written to solve high-level problems. Using a high-level language is sensible, time-saving, budget-saving, improves portability, and saves on headaches later. The same rule that applies to COBOL…

My point is there are fundamental computing concepts that you can pick up by learning C. In a world of high-level, low-LOC languages you can get by without learning those concepts, but it serves your and the ecosystem's best interest to learn them.

I think the disagreement we have may stem from our notions of what constitutes "fundamental computing concepts." I rank the lambda calculus much higher than C or assembly language when it comes to that. I would say that knowing your data structures and how to analyze algorithms asymptotically is vastly more important than knowing how code is being executed at a low level.

Even for the cases where low-level code must be written, I would say we need people who know assembly language and compiler theory more than we need people who know C. There is no particularly good reason for C to be anywhere in the software stack; you can bootstrap Lisp, ML, etc. without writing any C code. We need people who know how to write optimizing compilers; those people do not need to know C, nor should they waste their time with C.

Really, the most important computing concept people need to learn is abstraction. Understanding that a program can be executed as machine code, or an interpreted IR, or just interpreting an AST, and that code can itself be used to construct higher level abstractions is more important than learning any particular language.

Re: Learn C

#34

We need less code written in C, not more. We already have a problem with a massive, unreliable, insecure ecosystem of legacy C code that is hard to escape; writing more software in C makes that problem worse. Most software is written to solve high-level problems. Using a high-level language is sensible, time-saving, budget-saving, improves portability, and saves on headaches later. The same rule that applies to COBOL…

> We already have a problem with a massive, unreliable, insecure ecosystem of legacy C code

A ton of the world's software with the highest reliability requirements is written in C and C++.

Nuclear power plants? Yes. [1]

Joint Strike Fighter? Yes. [2]

Mars rover? Yes. [3]

Your Tesla? Yes [4]

US telephone systems. Stock exchanges. Bloomberg. Your cell phone OS (incl. many years before smartphones). The list goes on and on.

C and C++ are the most general and well-supported languages we have. They can solve problems on any architecture with a good tradeoff between efficiency and generality (over assembly) and predictable performance. Reliability and security requirements are up to the developer to impose on any language (see: the github PHP SQL injection search). C is not, in itself, a problem towards these goals and those who build upon C are always improving it [5].

[1] - http://www.nrc.gov/reading-rm/doc-collections/nuregs/contrac...

[2] - http://www.jsf.mil/downloads/down_documentation.htm

[3] - http://compass.informatik.rwth-aachen.de/ws-slides/havelund....

[4] - http://www.pcworld.com/article/260883/tesla_cto_talks_model_...

[5] - http://msdn.microsoft.com/en-us/library/8ef0s5kh.aspx

Re: Learn C

#35
post #8
post #6

I started programming for iOS via the same route, playing around with Objective-C in Xcode, but have since learned C. I have found that an understanding of C proves to be essential if I try to do anything reasonably complex (e.g. https://github.com/conradev/BlockTypeDescription ). I have also found that another area in which newer developers fall short is understanding how Xcode works. Those familiar with interpreted…

Might could do that! Actually one of the biggest mysteries to me for a while was how header files worked, how the compiler finds symbols, build dependencies, linking libs, etc. Having to mess around with Makefiles helps you digest those things, but then Xcode treats them in an entirely different way. #include is a complex beast

#include is actually a very simple beast, once you realize that it's much easier to digest.

Re: Learn C

#36
post #34

We need less code written in C, not more. We already have a problem with a massive, unreliable, insecure ecosystem of legacy C code that is hard to escape; writing more software in C makes that problem worse. Most software is written to solve high-level problems. Using a high-level language is sensible, time-saving, budget-saving, improves portability, and saves on headaches later. The same rule that applies to COBOL…

> We already have a problem with a massive, unreliable, insecure ecosystem of legacy C code A ton of the world's software with the highest reliability requirements is written in C and C++. Nuclear power plants? Yes. [1] Joint Strike Fighter? Yes. [2] Mars rover? Yes. [3] Your Tesla? Yes [4] US telephone systems. Stock exchanges. Bloomberg. Your cell phone OS (incl. many years before smartphones). The list goes on and…

"Reliability and security requirements are up to the developer to impose on any language"

This is a common fallback in these discussions, but it is misguided. Yes, you have to work to make software secure in any language; no, this does not mean C is equivalent. In C, you still need to worry about high-level problems like SQL injection, while simultaneously having to worry about low-level problems like integer overflows, dangling pointers, etc.

That critical systems have been written in C or C++ is not relevant -- it does not mean that it was a good idea to do so.

Re: Learn C

#37
What you really want to say is not "learn C", but "learn computer architecture, algorithms and programming language semantics", C just happened to be the most convenient medium for this for a long time, but today there are perhaps better choices, like Go and I really hope C will finally go away one day, while people will still have to understand things like indirect addressing, hashing, pass-by-value vs. pass-by-reference an so on and so forth.

Re: Learn C

#38

A little off topic, but I think people need to realize that when someone says they're a programmer, all they mean is that they write code. I know a lot of my friends (especially the ones in tech heavy cultures like Google, Facebook, Palantir, Dropbox) easily forget that when someone says "I'm a software engineer," they mean they write code. It doesn't mean they've gone through the same coursework, can reduce 3-SAT to…

http://en.wikipedia.org/wiki/No_true_Scotsman

Re: Learn C

#39
post #10

Earlier quoted context omitted.

> when someone says they're a programmer, all they mean is that they write code. How is this an inaccurate or misleading statement? If they write code for a living, they're programmers. > A little off topic IMO that's an understatement.

There is a difference. The difference between someone who works as a programmer, who takes it just as a job but of course can be extremely good at it - just like anything else you practice a lot; and someone who is a programmer. They are lexically the same but they mean different things. The last one, beside working (or not) as a programmer, does it for the art of it. Who not necessarily learns or does something (shi…

That's hazy territory. While I understand what you're trying to get across, there's really no point adding layers of hidden meaning and subjectivity to the term "programmer".

(non-software) engineers, lawyers, graphic designers, accountants, chemists, doctors define themselves by occupation and not some subjective non-metric of passion. Why exactly should programming be different?

I'm not arguing that programmers shouldn't be passionate about their work, or work on side projects. However, there's really no point in prevaricating over what a "Real Programmer"(tm) is, beyond the very simple working definition we have.

Re: Learn C

#40
post #15
post #4

This is a fair point, but it brings to mind another point I didn't really understand till the last couple of years. Learning about how compilers work is just as important. Building a small lisp compiler was a life-changing experience for me in terms of going one level deeper, as much as understanding C was. For those who've never written lisp before, the reason I recommend a lisp compiler is that lisp compilers are t…

I do recomend SICP .

The SICP Stanford videos by Sussman from the 80s and reading the book was an experience that sounds almost exactly like the author had learning C. It was one of the moments where I realized I enjoyed programming as much (or more) than design.
Post reply on HN