Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
A Scripter at Heart (codinghorror.com)
23 points by bdfh42 on Jan 26, 2009 | hide | past | favorite | 17 comments


Well... While coding mostly in Python, I am still a programmer. I am only using a more refined tool more adequate to my needs than C would ever be.

Obviously, I disagree with the "C programmers have to be masochists" view of the article. C is powerful and can be cruel and unforgiving, but once you get it (and it's not that hard), you can appreciate how powerful it really is.

As for the pain of going from interactive-prompt-nirvana to edit-compile-link-run-wonderwtf-reboot hell, it took me years to learn C++ because I was introduced to OOP in Smalltalk and then wrote some stuff in Actor. C++ most definitely, did not look like a step in the right direction. In fact, it wasn't.

For years, I used the following tagline in my BBS messages:

"Hello World in Assembly: 30 bytes, Hello World in Turbo Pascal: 10K, Hello World in C: STACK-OVERFLOW: SYSTEM HALTED"


IMO, knowing C is absolutely essential for a true understanding of how modern computer systems work. It should not be avoided, even if it is "hard".


10-12 years ago I was hearing people say that exact same thing about asm when I was first learning C. I wonder what they will be saying in 10 years is essential?


Uhm. Maybe 25 years ago. That was when you had to actually check the output from time to time because the compilers were so bugged and often terrible at their job. 10 years ago you needed to learn C to understand how Perl worked.

In 10 years "they" will still be saying learn C because C is nothing but a glorified assembly language with some syntactic sugar. C shows you how your computer works. There is very little to gain by using assembly over C (with the special exception of specialized instruction sets, like SIMD).

Until the computer changes so fundamentally that a simple imperative language no longer matches the hardware, or some other simple imperative language does a better job (unlikely), learning C will always be good advice.


In 10 years "they" will still be saying learn C because C is nothing but a glorified assembly language with some syntactic sugar. C shows you how your computer works.

It's possible to be a solid C programmer (ie clear understanding of pointers, stack vs. heap, etc) while still not having the depth of knowledge one gets from understanding at least some assembly. When I first learned about the concept of stack overflows (ie as explained in Smashing The Stack For Fun And Profit: http://insecure.org/stf/smashstack.html) my understanding of C really expanded, mostly through the added insight provided by thinking about C in the context of assembly.


I would say that assembly taught me more about how my computer works as compared to C, than C did as compared to perl.

Maybe I just didn't dabble with C enough before dabbling in assembly, but that was where I really learned about the stack, registers, variable allocation and function calls. With C I mostly just thought in terms of perl and ignored the implementation details. Static typing, malloc/free, strings-as-arrays and arrays-as-pointers were new to me, but I don't feel like I really understood what was going on at that point.


"10-12 years ago I was hearing people say that exact same thing about asm when I was first learning C"

Learning assembly does teach you quite a bit. I think that at some point every programmer would benefit greatly from knowing (an) assembly language and C.

Is it absolutely essential? (Depending on what exactly you are doing) No. Is it very useful? Definitely.

For that matter, an understanding of digital electronics, sufficient to understand how the CPU , ALU, memory caches etc work, can be very useful as well.

My 2 cents.


"Learning Ruby will really teach you about the low-level fundamentals of the computer."

May it never come to pass...


I think it would be great to see a day when the relative abstraction distance between Ruby and C is negligible compared to the available programming abstractions. A day when you can tell computers what to do in English, and when commanding the machine via any articulate and pedantic programming language is thought to teach one about the fundamentals of a computer.


I don't want to program in English...

"The horse rode past the barn fell."


I don't want to program in English...

When you tell someone to do something, do you lament the fact that you can't tell them in a programming language, detailing every single step precisely? When I talk about programming in English, it is not the kind of "programming" that you're used to. It's obviously subject to all the ambiguities and interpretation problems that humans have, yet somehow we manage to get by pretty well with it.

I didn't think I would have to actually explain that. Do you want me to put it to you in a programming language?


What's essential to being a good programmer now will not necessarily hold.

Personally, I think the importance of C will remain, as it's basically portable assembly. But time will tell.


I still think asm is essential to know. And I'm not even an old fart. Knowing assembly makes it far easier to rationalize about what my C programs are doing, how things will perform, what the machine actually does, and so on, even up into my Ocaml code (which is what I tend to work in for much of my code these days).

Even C doesn't teach you about cache behavior, register spilling, calling conventions, and so on.

Plus, it helps to know assembly massively when you're in the embedded domain, or whenever you're close to the metal.


The best way to understand how a modern computer system works is to learn the ASM of that language, read the manuals for the CPU/motherboard. You need to learn about registers, memory addresses, L1 and L2 caches, interrupts, etc. I don't see how C forces you to learn about any of that aside from memory addresses which you don't really need to deal with much (aside from passing pointers around and using malloc/dealloc).


It's often a better design to keep the parts that are largely set/need to be efficient in a "hard" language like C (or something like Common Lisp with type annotations), but keep the parts that need to be flexible in a "soft" language like an embedded Lua, Python, or Scheme, etc. You don't have to use just one language.

http://c2.com/cgi/wiki?AlternateHardAndSoftLayers


Larry Wall's epic Programming is Hard, Let's Go Scripting attempts to survey the scripting landscape and identify commonalities.

I would hardly call it an "epic". To the contrary people I spoke with who saw his state of the onion keynote that year said that unlike his prior presentations (which were often entertaining) that one was a disappointment especially considering the state of Perl at the time.


Why are we continuing to have the same old conversations about these things?

So-called scripting languages were discussed a decade or so ago.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: