Live data from Hacker News

Learn C

medium.com

71–80 of 182 posts

Re: Learn C

#72
post #51

Earlier quoted context omitted.

People who use the preprocessor heavily tend to use a fairly non-OO design. See http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html for an interesting example of a design technique enabled by that. I also note that said technique is problematic in practice not because it isn't good - it is - but because it causes people to suffer a brain freeze.

I tend to see these as orthogonal. What does a macro do but generate more code? So shouldn't the use of macros be reducible to ordinary code? That, and you can still employ this stuff at the micro level and your chatter between compilation units or library boundaries can still be OO.

In my experience, people who like to use the preprocessor come up with very non-OO abstractions. Similarly people who program heavily using templates in C++ tend not to use a lot of the OO features there either.

I may be more aware of this than you because my design sensibilities by nature are not particularly OO. This is not to say that I can't produce and understand OO designs. I both can and do, particularly if I have to cooperate with people who expect that. But given the choice, I'm more likely to head in a different direction. (A dictionary full of closures can be surprisingly useful...)

Re: Learn C

#73
post #23

For anyone who hasn't browsed through Peter Seibel's "Coders at Work," one of his subjects is Fran Allen...it's kind of funny because I do agree that learning C has been valuable to the high-level programming I do today (but only because I was forced to learn it in school). But there's always another level below you that can be valuable...Allen says C killed her interest in programming...not because it was hard, but…

While I'm very sympathetic to Allen's viewpoint, it seems that there was, and still is, a large class of problems where C-like languages (where the programmer does the optimizations) are better than high level languages with optimized compilers.

The best example for her case would be Fortran, where the language is both higher level, and faster, because the compiler can make much more assumptions (my understanding is the restrict keyword somewhat evens the playing field with C, but that is kind of a hack).

However, plenty of numerical work is also done in C, in spite of Fortran's availability.

Re: Learn C

#74
post #31
post #24

Earlier quoted context omitted.

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.

We are talking about interpreters here, not compilers. Binary Lambda Calculus has both Forth and Brainfuck beat, with a BLC interpreter in BLC of only 206 bits (under 26 bytes).

Re: Learn C

#75
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

I was in a similar situation to the author: largely self-taught, very little formal training or knowledge of the "big picture" ideas.

It's a bit like learning a language. You can learn a foreign language without formally studying grammar, and most of the time you will instinctively get things right, and have an intuitive idea of how grammar works.

But formally studying the grammar of a new language makes learning much faster, and you have a deeper understanding.

Re: Learn C

#76
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).

Given that you have a masters degree in music I would wager it would take me a very long time to get to your level in playing, writing and understanding music. It's doable of course, but I would have a lot of learning and work ahead of me. I think the same would apply to you catching up to someone having a masters degree in computer science or related fields.

Re: Learn C

#77
post #72

Earlier quoted context omitted.

I tend to see these as orthogonal. What does a macro do but generate more code? So shouldn't the use of macros be reducible to ordinary code? That, and you can still employ this stuff at the micro level and your chatter between compilation units or library boundaries can still be OO.

In my experience, people who like to use the preprocessor come up with very non-OO abstractions. Similarly people who program heavily using templates in C++ tend not to use a lot of the OO features there either. I may be more aware of this than you because my design sensibilities by nature are not particularly OO. This is not to say that I can't produce and understand OO designs. I both can and do, particularly if I…

I guess I don't see a strong distinction (or see them on the same axis) because I like the preprocessor and use it when I feel it's useful, but I still write fairly OOP-like public interfaces to my code.

Re: Learn C

#78
post #74
post #31

Earlier quoted context omitted.

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

We are talking about interpreters here, not compilers. Binary Lambda Calculus has both Forth and Brainfuck beat, with a BLC interpreter in BLC of only 206 bits (under 26 bytes).

Are you sure? From where I stand, it looks as though andrewvc and betterunix were both talking about compilers rather than interpreters, while dysoco didn't specify either, so I inferred that the compiler topic still stood.

Re: Learn C

#79
post #31

Earlier quoted context omitted.

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

Well probably... but no one said anything about bootstrapping being a requirement.

The LiSP book only describes self-hosting implementations while in Forth it's heresy to implement it in anything else than Forth or assembly. Well, perhaps Java implementations are excused for not being implemented in terms of themselves. :-)

Re: Learn C

#80
post #53
post #21

Earlier quoted context omitted.

Was there any study done to the (un)reliability of C? I know for a fact practically every piece software I use is programmed in either C or C++. The sole exceptions are Anki and Gentoo's portage system, both Python. And I'm pretty sure the reason portage is so extremely slow is because it is in Python (I've checked, it's not I/O-bound). And Anki is some very unreliable software. In fact, give me a single big desktop…

Just three, ask for more if you wish: The original version of Skype was done in Delphi. The first versions of Mac OS were done in Apple Pascal. Photoshop was originally done in Apple Pascal.

To be honest, I was looking for some more recent software. Skype is 10 years old and both Mac OS and Photoshop are both decades old. And Pascal is not "better" than C, it is not a high level language.
Post reply on HN