Stack OverflowWhy did you learn C?
[+40] [111] Dinah
[2009-04-21 22:14:02]
[ c polls ]

For those who know or are learning C: Why did you choose to learn C?

Was a school or job requirement? Curiosity? Boredom? Personal growth? ...

I'm especially curious to know how many learned it to better understand the inner workings of their language of choice. If this is your reason, was it prompted by Joel's suggestions?

(13) I hope no one learned C just because Joel mention's it all the time. That would be super lame. - Brian Gianforcaro
(100) For the girls... -
(9) "It seemed a good idea at the time" - quant_dev
I think you made a mistake. It appears you've marked one answer to the question "Why did you choose to learn C?" as correct. How is any answer to that question more valid than another? (Unless everyone else is lying, which you'd have no way of knowing) - Wallacoloo
@wallacoloo: I'm sorry you don't like the convention of accepting an answer for subjective questions or questions about personal experiences but it is the standard here. - Dinah
for the money, for the glory, for the fun! Mostly for the money (Bandit) - Andrea Girardi
[+82] [2009-04-21 22:18:38] Stephan202 [ACCEPTED]

C is part of the curriculum of many Computer Science programmes, for obvious reasons: it allows one to program on a relatively low level (esp. compared to more modern languages), while still being able to write useful programs with ease. It is also the de facto system programming language, and requires the programmer to know how the machine works. And despite its age, it is still very popular and certainly not outdated.

Myself I learned C as part of an undergraduate course at university.

[+73] [2009-04-22 12:47:00] community_owned

After learning A and B it seemed to be the logical choice. Or at least that's what my pre-school teacher told me at the time. I just wanted cookies.

(7) +1 wish i'd gone to your preschool! - kjack
(7) But why just stop at C? :) - RobS
(3) Followed by C++? That can only mean more cookies right? - xenon
Seconded the LOL \o/ - Camilo Martin
(5) @RobS - C is for cookie. That's good enough for me... - Derek Adair
I wish I could do +9001 - polemon
@Derek Adair: Cookie, cookie, cookie starts with 'C'! - bcat
(2) Suitable as a comment.. but I don't think this should be here as one of the top voted answers. - bobobobo
[+46] [2009-04-21 22:15:34] Charlie Martin

God, it was almost 30 years ago, who remembers? ;-)

Seriously, UNIX was the New Thing, and C seemed to offer a lot of the advantages of assembler, while being more productive.

And, sure enough, once I'd learned C, it did indeed offer the power and flexibility of assembly language, while offering the clarity and maintainability of assembly language.

(7) I'm pretty sure you meant 'while offering the clarity and maintainability of a high level language' :) Regardless, I'm just like you, 25+ years ago, SO much better than the alternatives at the time (and still pretty sweet, if you ask me) +1 - KevinDTimm
(13) I like it as written :P - Neil Williams
(13) I think I've heard that saying before somewhere, pretty sure it was intentional. - ryeguy
(1) I meant it as I wrote it, and it's either a quote or a close paraphrase, but I'll take credit for it. - Charlie Martin
(8) fwiw, Charlie, I'm pretty sure I saw (roughly) that quote go by in the cloud of answers to the "Java: all the elegant simplicity of C++ combined with the blinding speed of smalltalk" quote someone floated in the early java days. - simon
(1) OH yeah. But the C/assembler riff predates it. There were some others, about Prolog and APL as I recall, when I was in grad school -- which was significantly before Java was even a tiny acorn. - Charlie Martin
(1) somehow that doesn't surprise me at all. "all the x of a, and all the y of b" seems a pretty well worn template, truth be told. I wouldn't be surprised if a marketing guy told it first either (rapidly followed by a coder flipping the irony bit) - simon
(19) Yup, here we go: "C is often described, with a mixture of fondness and disdain varying according to the speaker, as "a language that combines all the elegance and power of assembly language with all the readability and maintainability of assembly language". --- Straight from the jargon file, and I'm sure it was there when GLS still maintained it. - Charlie Martin
I stand by my original remark (though I do understand where the quote came from). Reason being, I find it extremely easy to read as opposed to assembler. But, I'm guessing if I wrote assembler for nearly 20 years, it would be pretty clear to me too :) - KevinDTimm
Same reason for me. C was the first language I could stomach the performance hit of writing at a higher level than assembler. It was also more portable relative to other languages at the time. - Van Gale
(1) @kevin, you need to dig up the Obfuscated C contest. - Charlie Martin
Charlie, I always hated that Obfuscated stuff - offensive to my engineering sensibilities (essentially anathema to why I code) Just my $.02 :) - KevinDTimm
Oh, yeah, it's the blue-language humor of computing. But it does demonstrate what can happen when a C programmer turns to the Dark Side. - Charlie Martin
[+20] [2009-04-21 22:24:04] not really Jake

I'm currently working with C (a lot!) to program to a device.. I have a Velleman k8055 [1] interface board, with a USB interface that I would like to connect to a (hacked) Western Digital My Book World, which runs a minimal version of linux.

Sounds like a mouth full, but it is actually pretty fun to talk directly to the device, take measurements (such as temperature), and then activate a switch, while storing all this information into a SQLite database, and then connect to the SQLite database through a web interface .. and all that because of C!

I love C ;-)


[+12] [2009-04-21 23:04:52] johnc

It was what Nethack [1] was written in. It was also the 'professional' language back when I started looking at non-BASIC programming


(6) ++ for Nethack! The codebase is kind of a mess, of course (dirty dirty macros, and is it tabs or spaces?) - guns
:) true but inordinately fond of it still - johnc
[+8] [2009-04-21 22:17:31] Zifre

I learned C because I wanted to try programming in a language without GC (having only used Java and Logo), and C seemed the easiest. It really did open up a whole new world. Now if only I could manage to learn Haskell...

(2) is a great site to learn Haskell - Michaël Larouche
[+7] [2009-04-21 22:22:21] Michael

Best way to do game development on MS-DOS. This was in the early 90's.

[+6] [2009-04-22 04:30:21] OscarRyz

I have never thought about it until this day.

My teacher first taught us data structures using lisp in the first two months, and once we understood it we make the switch to C

It was pretty easy.

That semester ( 2nd semester ) ruin my relationship with the subsequent teachers that was not as crazy as my first one. They insisted I could make loops using for and while's but the only artifacts I used were if and pure recursion.

By 9th semester and once the original teacher was not longer at university I switched back to "normal" style, and use if's in conjunction with for's and while's and ( omg ) do{}while's ... :-S

So, I learned C at school. I have never had the chance to use it at professional level.

Actually I remember the day we start learning Java we said:

It's very easy, we just take this C source code and add public class Something { at the beginning and } at the end. We know Java already!!! ...

And indeed my first java programs were pretty much like this.

[+5] [2009-04-22 17:44:41] NTDLS

I started with C because it was the first language I stumbled across back when I was 11ish years old (I am still so thankful for that!). I bought Borland 5.0 from Best Buy with my allowance. Before that, I was building push-pull audio amplifiers - I guess programming was just a much less expensive logical progression.

Whatever the case: C/C++ has kept me happily employed ever since. It’s amazing what you can do once you conquer C!

[+5] [2009-04-21 22:21:40] John Saunders

I learned C when I got a job where the code was mostly written in C. In retrospect it was written in C because C was, to some extent, cross-platform. We were able to find a subset of C which, when we added enough #ifdef's, would allow the same code to compile on VAX, DEC-10/20, MS-DOS, PC-DOS and CP/M.

[+4] [2009-04-21 22:17:34] Rob

I was fed up with my "text editor" whinging about "compile errors" whenever I accidentally hit F5. God knows if I remember what the IDE was called, but it was quite old, and ran on an Amstrad IBM-compatible.

Looking at the help was probably my first programming mistake.

Sounds like it might of been Turbo C from Borland. - mctylr
[+4] [2009-04-21 22:20:34] ctacke

I learned C because I wanted to know what was happening below the code I wrote. I started high and kept working down 'til I hit assembler. I did they way before Joel made the suggestion.

[+4] [2009-04-21 22:32:13] Jordan

For me, like others, it was years and years ago. It was the Spring of 1982 and I was in my Freshman Year of college at UC Santa Cruz. Was just completing the two quarter Intro to CS sequence and after Karel the Robot and UCB Pascal.

We were a Berkeley Unix shop and I had been learning and playing with the C-Shell for several months. C seemed the next logical step and so I purchased the 1st Edition of K&R and had at it that Spring and Summer.

Worked as a programmer writing systems for the University that Summer with a focus on integrating the Unix-based systems and the legacy mainframe systems (hey, we still had punch card readers around).

I took to C like a duck to water. Loved it and have had it in my tool kit ever since. Put those skills to work after graduation testing Apple's C compiler for MPW. Later went back to Pascal to work in Object Pascal, then Objective-C, some C++, and then onto Ruby and JavaScript.

I think my story reflects how a lot of us come to be using a particular language or technology. It isn't part of a grand strategy. Rather, it is just how things played out.

That said, I am glad with how things turned out in my case.

[+3] [2009-04-21 22:19:41] Muad'Dib

Req for my CS degree.

[+3] [2009-04-21 22:17:56] Jon Ericson

I had some C code to debug and maintain.

It was probably the third language I learned after BASIC and Pascal. I remember my cousin being excited about obtaining a C compiler because it would let him do "structured programming", which was a buzzword at that time.

I still use C for programs that interact with binary data and where processing speed is critical. In addition, I've got lots of code in C that still needs to be debugged an maintained.

[+3] [2009-04-21 22:22:59] GoatRider

I was developing on the Amiga, and AmigaBasic wasn't cutting the mustard.

(1) Lattice/SAS or Aztec? - x4u
Lattice I think. But it was like 20 years ago, hard to remember. I may have used both at some point. - GoatRider
[+3] [2009-04-21 22:30:12] Michael Todd

Because other than BASIC, it was the only game in town on an IBM PC that was not Fortran, Prolog, or some "obscure" enterprise-level language. Turbo C had recently been released which made it that much easier to gain access to it and it was certainly more affordable than other languages. Turbo Pascal was nice, but it seemed too "rinky-dink" to be considered a real language. That plus low-level access via asm, and C was the way to go for me.

[+3] [2009-04-22 05:45:57] Graycode

Because C is as close as one can get to assembly language speed, without losing your mind.

Also because the Linux kernel is written in C and I needed to mess with it a little.

[+2] [2009-04-22 08:35:35] Mark Ingram

Because it's fast.

[+2] [2009-04-22 04:25:45] Steve Rowe

I learned C as a gateway to C++. K&R looked a lot less intimidating than the C++ Programming Language. K&R is still the best programming book I've read to date.

When I learned C Java was just launched. I actually learned Java 1.0. Most other modern languages either didn't exist or hadn't escaped the niche communities in which they were created.

[+2] [2009-04-22 05:45:03] Michael Buen

Flexibility with pointers. This particular feature alone compels me to learn C, otherwise I would have stayed with Pascal.

[+2] [2009-04-27 20:18:45] Rev316

Finding out how much of today's software either was 1) influenced by it, 2) abstracted by it, 3) inherited directly from it or 4) created with it.

Anywho, it seems to be the backbone of many languages/ideas/methodologies... can't be a bad thing to learn I think.

[+2] [2009-04-21 22:25:02] Mehrdad Afshari

I loved computers!

(1) And I'm sure you still do! :) - Stephan202
@Stephan202: Oh really? :-? Never thought about that :-" Now I understand why gals were jealous of my MacBook Air. - Mehrdad Afshari
;) Poor gals! Perhaps you can accommodate them by applying some time-sharing :D - Stephan202
@Stephan202: I'll happily do so as soon as they can make themselves as thin as the Air! :)) - Mehrdad Afshari
[+2] [2009-04-21 22:21:49] Stefano Borini

I always liked to program. I coded in BASIC and then in assembler on the C64 for years when I was a child.

I met C when I was 12, but my mind did not get it, as I could not grasp the very fact that another language could even exist. Then, I went to the university, and I learned Fortran, but it wasn't good. But there was internet, and so the chats (you had to use telnet to connect)

I wasted my time on these chats, and I got curious about understanding how they worked. They told me you could download the code, so I did it, and started peeking into it. The chat was quite similar to a textual adventure, and I wanted to make it even more similar, like, you know, those things that were first called MUD and then MMORPG.

So I started coding it. At first, I just translated the messages in my native language. As I delved more into the 7000 lines of code, and started reading some C books, I learned C.

So basically it was to fuel my preferred way of wasting time: chatting ;)

[+2] [2009-04-22 02:45:22] Syed Tayyab Ali

C enable you to see the data structure more closely. In term of pointer, memory management, resources allocation, initialization of variable. and lot more..

[+2] [2010-04-13 01:39:46] ohho

When I was in college, Pascal was the de facto language.

I hate typing capitalized letters during programming. That's why I wrote fewer than 500 lines of COBOL in my entire life, given COBOL was the business language. I didn't like those BEGIN / END in Pascal either.

In the second year, there was a telecommunication project. The requirements are:

  • there are 3 PCs, say, A, B and C
  • each is equipped with 2 serial ports
  • each PC is connected to other 2 PCs, in a ring
  • each PC should be able to send/receive files from any of the other two, even one of the three connections is broken
  • for example, if the connection between A and C is broken, A should be able to send files to C via B

that was a serial port programming exercise, interrupt driven stuff.

In the same time, there was another COBOL project. I forgot the requirements ;-) Anyway, our team (5 folks) should finish both projects before certain deadline.

Luckily, we make a (clever) decision to split the team into two group. Three folks (Keith, Wayne, Alison) were in the COBOL team. Another folk (Terran) and I were in the comm port team.

Terran and I bought the K&C book. OMG, it's still the best computing book I've ever read. The language is powerful. The syntax is elegant. The { } saves lots of BEGIN / END typing ;-)

That's how I picked up c.

p.s. anyway, as a side note, we scored 'A's in both projects. That was year 1989/90.

[+1] [2010-09-12 01:50:36] abelenky

I went to the software store intending to buy a Turbo Pascal, as that was what I had learned in school. I was on a very limited budget, and Turbo C was about $10 cheaper. Even though I didn't know what "C" was, it looked similar to Pascal, and I wanted to save a few bucks.

Best damn decision I ever made. :)

[+1] [2010-04-13 15:10:53] Tim Post

I ran a pretty successful dial up BBS in the late 80's / early 90's. The source code to the software that I ultimately settled on was available, written in C. In the space of a few months, I learned several hundred very bad habits by studying the code that took years to shake.

At around the same time, Linux booted with GNU and I was a UNIX refugee. The sheer and utter joy I felt when I finally got both to compile and boot was .. well .. pretty awesome. That was on a 386 DX/33. To this date, I still do not take having a pre-compiled version of gcc for granted.

Its hard to describe how cool having a computer in your house running something UNIX-like made you at that point in time. I fondly remember a friend of mine calling me to report that he finally got some 50 Ohm terminators and now had an Ethernet network in his house. I blew his bubble by saying "I got Linux with GNU to boot".

It wasn't long after that jobs started appearing for people who knew how to write portable programs. Keep in mind, POSIX first appeared in 1988 and adoption was slow, GNU/Linux came pretty damn close out of the gate. It was and is truly a developer's OS. I made some beer money, but it was mostly just a hobby. Debian meant the start of a career for a lot of people.

Writing services and device drivers now feeds me. It will continue to feed me. Almost every wildly popular interpreted language that I can think of is written in C. Every working kernel that I've ever seen is written in C. And wow, now we have hypervisors!

I know PHP, Perl .. some Python, BASIC and others but C remains my favorite language. First love, I guess.

[+1] [2010-09-12 01:04:30] anijhaw

I never really learned C, I am still learning it everytime I read K & R I find something new.

[+1] [2009-07-11 11:04:13] Nazadus

I'm assuming you mean straight C, not C++?

In all honesty.. my dad made me'ish. I was coding in BASIC when he went "ok, time to learn something better... here's a book and the F1 key... oh, by the way, I uninstalled BASIC... good luck" and walked away on to a plane (seriously, he flew out a lot then).

I initially hated it and refused to use it... until I needed to get some stupid things done... lo and behold, it wasn't so bad. Funny thing now is, I work with people who code in C# and there have been times we needed to code in a non-managed environment (we were handed stuff from outsiders and didn't have a way around it). Had it not been for me knowing straight C, we likely would have been screwed.

It's amazing how many people live and breathe with OOP and can't deal without it.

oh, and if it matters.. my first baby was encryption... seriously starting with ROT+X (not just ROT13; still funny realizing that ROT is where I started... haha) and moved on from there. I liked hiding things... until several years later I realized I had nothing useful to hide.

C and C++ are different languages... - Eric M
"I liked hiding things... until several years later I realized I had nothing useful to hide." ... that made me laugh. :) - mizipzor
[+1] [2009-10-09 00:12:45] Bob Cross

I learned C because, while I knew TRS-80 Basic, some Z-80 Assembler and had taken a class in Pascal, the BSD Unix that we used on our PDP-11 and, later, Vaxen was written entirely in C. Essentially, there wasn't anything interesting that you could do on our big machines (and they were intimidatingly big) without C.

So I learned it. It wasn't that hard when you had an entire operating system serving as a set of examples.

[+1] [2009-10-09 00:21:43] Nosredna

I learned C because it was clear because everyone else was learning C. I held out as long as I could, programming mostly in assembly language until about 1993.

[+1] [2010-03-10 14:19:10] PrgTrdr

I had written in a variety of languages, BASIC, FORTRAN, Assembler, etc. when I read a quote by Dijkstra, "It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration." Of course, I took this as a personal challenge and bought K&R. It took me all of 2 weeks to write my first commercial c app--which became a best seller.

[+1] [2010-03-10 14:32:43] mizipzor

The very first programming book I had the chance to lay my hands on was a book about C. However, the first "real" application I wrote was in C++. It was actually a few years later that I discovered that they were, in fact, different languages.

[+1] [2010-04-13 01:19:40] MPelletier

I didn't go to a JavaSchool. I went to a VBSchool :)

There was one class on C++ near the end, and I thought it was a shame we had been shown VB all that time.

Later, at work, I got handed a C project. That got me going, but the lack of objects threw me off a bit at first.

[+1] [2010-04-13 01:33:25] Wallacoloo

When the only compilers available for the platform you want to develop for are Assembly and C, it's a good time to learn both.

[+1] [2009-04-24 08:58:22] tomash

To get a huge consultation fees when the 2038 year problem arrives!

[+1] [2009-04-24 09:03:59] AnnaR

Because I love learning from my mistakes. C gives you plenty of opportunities to make mistakes if you aren't careful.

(3) C most certainly allows you to make more mistakes! - Dinah
[+1] [2009-05-15 13:19:27] Silfverstrom

I was 14, found a book at the library about c-programming and read it. That was what got me stuck on programming.

When I became old enough to really understand programming, it was too late. I had become a C programmer.

Some days I wish that book had been about fishing, visual basic or motorcycles. But I suppose that's the irony of fate.

[+1] [2009-05-15 13:32:56] the_drow

I actually picked up a C++ when I was 11 and it was basically C with cout, cin, new and delete up until the end of it where they explained a bit of STL.
I never found a good use for it since I like OOP too much.
yeh you can do that with C as well but it's a pain in the ass.
I actually see no reason to learn C by itself, it's useful if you are used to it but you can also program embedded/RT in C++ and it will be pretty much the same imo.

[+1] [2009-06-26 22:20:40] Marco van de Voort

I started because I needed to translate C code into something else (usually Delphi) First only headers, later also code.

Later when I got more proficient, and I did some microcontroller work in C. Mostly because while there were other compilers and languages, the C compiler was maintained best.

[+1] [2009-04-21 22:29:52] Uri

I used to know Pascal, and I felt it wasn't a mainstream language anymore. So when I was 15 or so I got hold of a Borland C++ compiler and learned C. I later learned C++ from a book because I missed the classes and virtual functions that Borland Pascal supported

[+1] [2009-04-21 22:30:26] samoz

If I didn't, I would have failed CS 240 C Programming. :)

I'd say that was a pretty motivating reason.

[+1] [2009-04-21 22:18:16] none

In order to be able to do low level coding (e.g. OS or drivers), and to be able to get involved in projects that require C programming (i.e. compiler writing).

(1) What?! Compiler writing doesn't require C. I'm writing one in Python right now (or atleast I was until SO distracted me) :S - Wallacoloo
of course compiler writing does not necessarily require C knowledge, but most C or C++ compilers are written in C or C++ and not in Python, Haskell or LISP. And even there, knowledge of C would still be pretty handy. - none
[+1] [2009-04-21 22:18:30] DeadHead

I learned it when I was first getting into programming, and at the time, I didn't know much about the different languages around. I chose C because it was recommended from a friend who did use C a lot. Now, I keep using it because I enjoy programming in lower level languages.

[+1] [2009-04-21 22:21:20] CodexArcanum

I originally learned C because my school's CompSci program started you out with it.

I picked up C again recently because I wanted to program in D and it can interface with C libraries, assuming you have a wrapper. I have to know some C in order to properly convert it to D.

Now, I'm glad I know a little C because it gives me more insight into the underworkings of higher level languages and since the C-Style syntax is so prevalent, I have a good leg-up on the most popular languages.

[+1] [2009-04-27 20:23:28] Bill K

At the time--it was the only game in town really. Virtually all new coding for PCs was done in C.

[+1] [2009-04-27 20:32:12] Dmitri Kouminov

I switched to C from Pascal when I started programming for Windows 3. The only available good book at that time was "Programming Windows" by Charles Petzold. All samples was on C. So I had no choice ;-)

[+1] [2009-05-01 19:58:03] Marco van de Voort

I needed a compiler for some odd embedded device, and I couldn't use a suitable Pascal.

Learning the inner workings was not so much of a problem, since it maps 1:1 to Pascal.

The usual syntax gotcha's like = vs == (and most importantly, the routine to avoid making them all the time) took some time longer. And still.

[+1] [2009-05-01 20:41:40] Chris Reynolds

I started learning C because I wanted to program video games. All of my research at the time seemed to indicate that if you wanted to be an SE for console and PC game development, then C and C++ were the ticket.

[+1] [2009-05-01 21:40:51] David Thornley

I started learning C because I was annoyed at the limitations of the Pascal compilers I was using. However, the C compiler I had at the time (on a TRS-80 Model 4 running CP/M) was excessively awkward to use, so I didn't get very far.

When I got to grad school, it was what everybody was using. Most of the intro to programming courses were in C, and all the neat available software I was interested in (this was after Richard Stallman was pushing Free Software, but before "open source" was used as a near-synonym) was in C. I did find that I didn't want to learn vi and C at the same time, so I learned C using Lightspeed C on my Macintosh SE.

[+1] [2009-05-03 14:30:30] community_owned

In college my first language was assembly, but as I worked more on embedded systems I realized that C would help me to make more portable and easier to manage code. C is great for low level work (I do embedded programming), and is very close to assembly which I like.

[+1] [2009-04-22 05:41:48] ojblass

I could not get my first data structures program to work using Pascal (Thank God).

[+1] [2009-04-22 04:30:42] Agnel Kurian

My parents forced me to take up a summer course in GW-BASIC during the summer holidays after 10th class. I had forced them into a position where they had to constantly chide me for wasting my time and being "good for nothing". I fell in love with computers while studying GW-BASIC and soon managed to prove that I was no longer "good for nothing". I studied C as a follow up to GW-BASIC.

Thanks, Ma. Thanks, Dad. Love you both. :D

[0] [2009-04-22 04:31:35] Naren

I learn't it at university. I don't think there is an engineering or computer science degree that does not teach C. I reckon, it should be the first programming language everyone learns. It gives a good grounding into the inner workings of the computer.

[0] [2009-04-22 04:35:14] John Dunagan

It was the "next" language. I cut my teeth on Applesoft Basic back in the day, and programmers who wrote working C code were making many times what I was making as a tech writer / support monkey. I'm on C# now, and I love making breakthroughs in my own personal knowledge in that space just as much as I did when I discovered how to do the next thing in C.

[0] [2009-04-22 04:43:27] billyy

Well I am just learning C, just doing this and that and in the meantime try doing a few things with C. I'm not realy good at it, but I'm learning it to make a few programs for secondlife, my first language would be LSL (realy easy) and from out there I need to learn PHP and such to do what you can't do in an LSL script.

In C I might in the future work to make sculpting (SecondLife Feature) easier.

[0] [2009-04-22 04:50:41] yetanotherdave

I learned C to get a better job. That was a long time ago. But learning it made me a much better coder because it offered a lot of power that had to be used carefully. For example, learning memory managment was key to being effective in the absence of garbage collectors. Doing so made me stronger as a coder. Unless you paid attention to honing your skills you condemed yourself to being assigned only fluff projects. So in that respect, learning C forced me to become a wiser coder.

[0] [2009-04-22 04:55:26] Simeon Pilgrim

Because a friend of my father's gave my a book, and a some floppies that had Turbo-C and it was so much cooler that MS Quick Basic.

Months later some friends got there hands on Turbo-Pascal, and I knew I was onto the real winner (C)....

it's unclear whether you're saying C or pascal is the winner - kjack
C, definitely C - Simeon Pilgrim
[0] [2009-04-22 05:16:26] thomasrutter

I learned C++ before I learned C.

C++ was a natural progression from Pascal for me (well, with no formal programming training, it seemed like a good idea at the time). It could do more, and I thought it was more powerful, but it allowed you to use the same basic procedural syntax. I didn't use actual 'C' until years later when I was at university. Since then I have found it helpful when modifying some open source code like audio/video codecs.

[0] [2009-04-22 05:22:15] tomjen

I couldn't find a pascal compiler for my Linux box (that was before I had internet at that computer) so I couldn't program using the only language I knew at the time (Delphi 3). However they did have this pascal to c compiler. But the output was horrible, so I had to learn c to hack that.

[0] [2009-04-22 05:23:46] justinhj

I knew assembler (Amiga 68000) when I got to University. I was frustrated with all the lisp and prolog, and wanted to do something that produced an executable, and that involved bits, bytes, and pointers. So I taught myself C alongside my AI courses.

[0] [2009-04-22 05:27:09] Badri

For programming games.

[0] [2009-04-22 05:30:45] Ken

Because my Apple II only had two compilers (Pascal and C), and most of the docs and examples were in C.

As soon as I went off to college and got access to a real computer (DECstations! OSF/1!), the first thing I did -- before even signing up for any computer science courses -- was teach myself Lisp.

(P.S., if you want to better understand the inner workings of Lisp, C isn't going to help a whole lot. Almost all of the Lisp compilers I've worked with have been self-hosting, so it's just Lisp and assembly down there.)

[0] [2009-04-22 04:29:51] community_owned

I learned C because I needed it for my work. For me it was the next step on from FORTRAN. FYI, I started out in a scientific applications environment.

It gave my program the chance to interact with the OS, an RTOS in this case, so that I could look at the args provided to me when the program was invoked.

It was so cool to be able to get access to the program args without some magical OS trickery.

It did not take me long to get proficient in it. I was very proud, but I could not understand why people said C was little more than a portable assembler.

I was naive.

Five years later, after some experience with regular expressions, awk, perl and some early C++ I fully understood why C is a portable assembler. After all with such a stingy library you could hardly call it a platform.

[0] [2009-04-22 09:50:05] MeThinks

C was my second programming language at Imperial College during my first year of Electrical and Electronic Engineering degree. They taught us Pascal, then C and finally C++/Java. This later become useful for a third year embedded design project as part of my BSC project.

[0] [2009-04-22 10:51:27] IanW

I learned it as part of a HNC in Electronic Eng I took on a day release course back in the early 1990's. We had a pretty good lecturer which was essential since we never touched a computer during the entire course ! I went out and bought myself a copy of "Turbo C" to play with it home and it all made sense but I remember that a lot of the other course members struggled. Oddly the first programming we did for that qualification was 8085 assembly language a year before.

Just one of the many joys of British Polytechnics.

[0] [2009-04-22 05:51:55] Dr. Watson

I first learned C because at the time I wanted to learn C++ and back then it was suggested to me that one should learn C and then C++.

I'm glad I did though, because so much of the software I write today still requires (for the most part) C:

  • Windows device drivers
  • hard real-time applications on embedded systems
  • UNIX kernel modules
  • firmware on micro-controllers

[0] [2009-05-15 12:50:15] kmarsh

I needed to use C at work, at the same time it was the hot language at my University. The entry level Comp Sci classes were still in Pascal but within 2 years they switched over to C (late 80's). We had a huge VAX cluster and a couple of little BSD VAX 780's at school and everyone wanted to use the Unix machines. All the hot jobs after graduation demanded C.

At work, C was the best way to wring Unix Workstation performance out of 286's and 386's. A PC was 2 grand and a Unix Workstation was $40K. Any other language was a better choice, it could be argued, assuming you were making that choice on a big, fat, expensive Unix workstation like Masscomp/SGI/Sun/Apollo*/Whatever. (But not a VAXStation. There were no good choices for a VAXStation, because no matter what you chose, you were still stuck on a VAXStation).

Don't forget, C is everyone's favorite portable Macro Assembler for DEC-like CPU's. Comparing it to high level languages just isn't fair. Remember CPU's ran from 20MHz to 90MHz and the pre-Synchronous DRAM was slow, slow, slow. C was the only option for both portability and performance. If you chose Pascal you had to write to a C API anyway. If you chose Ada you got stuck with a 500K runtime link linked to your program (effectively tripling its size). If you chose Smalltalk it wasn't leaving the University environment.

*OK So Apollo wasn't exactly Unix. It was still better than using a VAXStation.

[0] [2009-05-15 13:05:10] MikeJ

In the days of yore, it was the only language that really allowed you to exploit the capabilities of the machine you were using, especially if you wanted to do graphics programming. Whether I found myself on PC's, Sun's or when I got my first dream job coding phigs/GL for SGI (R.I.P) in the late 80s/early 90's you had to use C.

the relative portability also helped, so if you had a toolbox of goodies that made your life simpler, C would be a good bet to have it working in short order on any new machine/architecture you might encounter.

It was also the fun and productive language to code it - 5000 lines of C was joy and could do so much in those days. 5000 lines of fortran, pl/1 or cobol in those days seemed more like a tax audit and 5000 lines of assembly, while very very fast was more like some form of morse code - C had the right amount of expressiveness that you can understand WHAT was being done and not how.

[0] [2009-04-22 18:07:04] Todd

C was actually the last programming language I took a course in. Ironically before starting to maintain legacy code written in ANSI C, I decided that in order for me to really become more actualized as a programmer I needed to be able to grok the concept of pointers and memory management. All of my education and experience was with languages with garbage collection (Java, C# etc.) and I really needed to get "closer to the metal" without delving into a low-level language like assembler.

In sum, I'm glad I did--not just for the obvious purposes of my job but as mentioned before C strips away a lot of abstraction and enables you to grasp more thoroughly what happens under the hood, as many popular language interpreters(Ruby, PHP, Python) and operating systems are written in C.

Learning C for the programming practitioner is analogous to learning Latin is for the linguist (save the fact that C is far from dead!).

By the way--ditto to the comment about the K&R. It's the definitive work.


[0] [2009-04-22 18:11:17] community_owned

In 1982, someone handed me a desmet c-compiler on a 5-1/4" floppy.

I was writing in COBOL and compiled BASIC at the time. I wanted to show my kids the difference between an interpreted language and a compiled one. A simple program, to count from 1 to 10000.

First, interpreted Basic. . . and wait for the answer Then, BASCOM (compiled Basic) and wait for answer, although not as long.

OK, let's try C. Compile it, and run it. Holy Crap!

I never wrote another BASIC program.

I didn't have a COBOL compiler on my IBM PC 8088, COBOL was on a WANG mini -- but I very quickly became aware that C programs were a lot smaller for the same task.

Working on a PC with quick edit-compile-run cycles did wonderful things for my productivity. (Yes, oh a 5MHz 8088).

I'm still writing almost exclusively in C.

[0] [2009-04-22 18:18:15] Ferruccio

I wanted to write a Pascal compiler.

I was high school and couldn't afford any of the commercial Pascal compilers. There was a free compiler called Tiny Pascal but it was worthless for any real work.

So, I decided to write my own.

I purchased a copy of the Software Toolworks C compiler ($39.95) and set about writing a Pascal compiler with it. By the time I had written the lexical analyzer and started working on semantic analysis & code generation, I realized that C was so much more flexible that I forgot all about Pascal and dropped the project.

[0] [2009-04-23 13:15:36] AlexanderJohannesen

For a professional application where speed and closeness to the processor was vital (doing real-time video processing with 33 MHz processors and 640Kb RAM!!) there really was no better option, rather than going assembly-insane. It wasn't really any question of options, really.

[0] [2009-04-24 08:21:34] unwind

Because it was there, it dazzled me with its inherent beauty, and since it indeed was a language that was easier to be productive in than MC68000 assembly, which was what I mostly used at the time I started learning C.

[0] [2009-04-24 08:37:27] RBerteig

I was given a choice between C and VAX MACRO-32, (not to mention BLISS, and TECO). I was encouraged by the hackers around me to choose C for practical work, but to learn as much as possible about as many other languages as I could.

I never wrote a line of MACRO-32, but I did maintain a real application in MACRO-11 for PDP-11's running RT-11 and TSX+. I have written non-trivial programs in TECO on that same PDP-11. Thankfully, I never had to write a line of BLISS for either the PDP or the VAX, but I did once have to read some to answer a question about a utility that wasn't covered in the documents. VAXen at the time commonly shipped with a copy of the VMS source kit (for the kernel and most system utilities) compiler listings on a deck of micro-fiche, and I still have a copy in a drawer somewhere.

Somehow, I did avoid being traumatized by early exposures to BASIC and FORTRAN while in high school...

Since I ended in embedded systems, I have never regretted learning C as a first "real" language.

[0] [2009-04-24 08:47:23] Pratheeswaran.R

C was a part of my college curriculum and that's how I started learning C. I learned most of the programming concepts through this language and even today (I have worked with C++, Java, ROR, etc) I love this language the most. Simply the best.

[0] [2009-04-22 03:55:29] Dan.StackOverflow

I wanted to be a hacker. Back then the advice was set up a linux network and learn C. So I did. I bought the K&R book, did all of the exercises and then...nothing. Probably due to lack of creativity and broadband (it took forever to download lcc at 14.4kbps). I didn't program again until a few years later when I took pascal in high school.

[0] [2009-04-22 04:20:21] Norman Ramsey

I learned C in order to write a program for my boss Carl Franck, who needed a C program to help design an X-ray mirror. At that time I already had moderately extensive experience in APL, PL/I, IBM Pascal/VS, and Digital BASIC, as well as enough FORTRAN and JCL to be dangerous. Kernighan and Ritchie was a pleasure and still is to this day.

I was awfully glad when ANSI C introduced prototypes, though...

Yep, K&R is still the benchmark of really well written programming books. After coming off of Fortran, I read K&R like it was a novel. This was after the PC first came out, and fortunately, there was a port of a CPM C compiler for the PC. Pascal and Basic weren't viable options to me. And PC Fortran was a bad joke. The beauty and impact of C cannot be underestimated, IMHO. - xcramps
[0] [2009-04-22 04:24:46] Amit Saxena

C was part of curriculam. I liked C, once got the basic then it was fun

[0] [2009-04-21 22:35:56] Ben Collins

I had to learn it to prepare for some systems-level courses in university (e.g., operating systems, etc).

[0] [2009-04-21 22:37:16] abababa22

I got bored of Turbo Pascal's strict type system, and all demo coding tutorials were in C.

[0] [2009-04-21 22:49:52] Dave

I learned some C in school, but never really applied it in the real world until I started working with microcontrollers.

AVR RISC chips and AVR-GCC.

[0] [2009-04-21 22:52:48] Albi

I learned C as part of my undergraduate studies in CS. We had worked with Java up till then but it was used in a computer graphics course. After that it was used a few times in my undergraduate and graduate studies, for example in compiler construction. Now I work with C all the time in embedded systems as part of my job.

[0] [2009-04-21 23:06:43] ceretullis

Required prerequisite to C++ course :P

Since then, I've come to appreciate the austere beauty of C by itself though - mostly through Unix system API's.

[0] [2009-04-21 23:22:38] Yassir

I m a CS student it is the first programming language they taught us

[0] [2009-04-21 23:36:41] Kim Reece

We happened to have a compiler for it.

We didn't have compilers for any of the other programming languages there were books for in the house.

And I was really bored of qbasic.

[0] [2009-04-21 23:40:02] toto

I learned C because that's what we use at school (although it's more C++), and I'm glad I did. I also encourage people to learn the C standard library instead of the C++ library. It's much better and it doesn't hide how things work.

[0] [2009-04-22 00:22:40] NotDan

Because I didn't know any better and thought C was the only thing other than BASIC.

[0] [2009-04-22 01:09:39] Costo

I learned C during the very first year of my Electrical Engineering degree. The second year I had a very succinct C++ course.

The only time I re-used C, it was for a Microcontroller programming course. That was the last time I used it.

[0] [2009-04-22 01:16:39] Joel Potter

As an electrical engineering student, I learned C because it was essential to any kind of low level programming.

Most microcontroller manufacturers offer a C compiler for their particular brand of assembly (generally in the form of gcc extensions), so it makes it really easy to write embedded code for multiple platforms.

[0] [2009-04-22 01:20:40] Scott Evernden

i got a part-time job while in college at the Boston Children's Museum during the mid 70s. They had a PDP11-40 computer and it was running this new kind of operating system called Unix Version 6 that had been licensed from AT&T. Apparently the museum was the very first licensee of this OS

The only way to write programs for the kids was using a language called C, so I had to learn that...

[0] [2009-04-22 01:23:44] Monkey
  • Programming for embedded devices, servomotors microcontrollers
  • Calling functions to talk with the kernels of UNIXish Operating Systems
  • Optimized number crunchers (SSE, funky memory organization)

[0] [2009-04-22 01:30:30] Genericrich

For the lulz!

Seriously, to write "Hello, World!" and see it appear on the screen. I actually made a noise out loud the first time I did that.

[0] [2009-04-22 02:05:31] Jonathan Leffler

I learned BASIC, Fortran, Pascal before learning C. Some of the work we were doing was not sensible in Fortran (a GKS - Graphical Kernel System - graphics library for Fortran), so we used C. It gave us 2 extra letters of freedom for choosing function and variable names (8 instead of 6!) which mattered because the externally visible names all started 'g', the non-public names all started 'gk', and the driver specific names all started with a driver identifier such as 'gk0p', leaving only 2 characters for the 'real name' of the Fortran functions! Yes, gk0paa, gk0pab, ... they existed; C gave us a let out. Cool. (The ultra-gurus on the team coded the machines in microcode though!)

This was a long time ago, though - 25+ years ago. Prototypes were a nice addition to the C language too, many years later. And Sun had these cool workstations using M68000 chips.

[0] [2009-04-22 02:40:26] Martin Beckett

Because the only other thing we had was Fortran. (I'm older than I look!)

[0] [2009-07-11 10:42:20] plan9assembler

Because, nothing beat c.

[0] [2009-04-24 09:09:06] Xetius

1) it was the language to program Windows in (when I started with Windows 2 and 3)

2) it was possibly the most powerful language at the time (very subjective, but to do what I wanted, it was the next best thing to assembler)

3) it was low level enough to do anything.

4) it was fun

5) it was a gateway to understanding how the computer worked in a more structured manner than Assembler

[0] [2009-04-26 07:18:37] Tom

I learned Borland Pascal first, around 1992. There was not much Pascal in Dr. Dobbs and programming books, so I learned C and C++ to be able to absorb more books and articles about programming.

[0] [2009-04-26 18:36:21] dagw

I was finishing up my masters in math and needed a couple of courses. There happened to be a C course that fit into my schedule so I took it. My main motivation was partially that that it seemed like that sort of thing one should know (before starting my Masters I'd been passed over for a job I wanted in part because I didn't know C) and mainly that while writing numerical code in matlab or python is both quick and easy it doesn't run very fast, so knowing something that was fast would probably be quite handy.

After having taken the first course I went on to take the advanced course as well and basically came to the conclusion that I really liked programming in C.

[0] [2009-10-07 22:11:25] Eric M

Because typecasting an 8 bit int to & from a 32 bit int in pascal was a real pain in the neck.

[0] [2009-10-07 22:49:53] Nick Bedford

I learnt C++ during uni (I started of my own accord) so naturally C was only a hairs-breadth away but I've never really coded for C even if the C++ code I've written (say for a Win32 program) has never had any real C++ code in it (such as classes).

C/C++ are practically the most used systems programming languages in the world so it's a good reason to know them, IMHO.

The only problem I find now is that the magic is lost after several years of programming in it. Granted, coding these days is almost completely implementation and not lack of programming skill but there was something really cool about getting your first few programs up and running and them doing some cool things. Even beginners CLI games were fun to attempt.

Oh well. back to work!

[0] [2009-04-22 15:25:24] Darcy Casselman

Because it was how you wrote any sort of reasonable program on the Amiga. I mean, you could do it in BASIC, and there was okay library support for that, bit if you wanted to do anything sophisticated or performant at all, you pretty much had to do it in C.

That and, at 17 years old, I thought I was finally beyond BASIC and wanted to try something more sophisticated.

I was never very productive in C, though. Besides a bit of C++ in university, I didn't write significant amounts of C code till I got a job. (And at that point, it turned out to be a very useful skill to have).

[0] [2010-09-12 01:15:12] guidoism

I learned C because I was trying to write a Super Mario Bros. clone (my parents wouldn't buy be a Nintendo) and I was getting sick of the peeking and poking to do anything interesting in BASIC. I never did end up finishing that game. Programming, in and of itself, became the goal.

[0] [2010-09-12 01:26:10] Elf King

I think I started learning C, because it is the fundamental computer language and developed in conjunction with an operating system namely UNIX. The C language truly tied together how The UNIX operating system worked, with software development practice for that environment. This is, of course not unique to UNIX. We see similar approaches in Objective-C under NeXT or Mac OSX; or Visual C++ under Windows. The compilers here introduced specific syntax that helped extend the concepts that are represented within the operating system, in a way that would be natural for the programmer to use.

Of course this would bring us to lisp, a language so advanced and sophisticated, that an operating environment has yet to be built to fully understand the depths at which lisp works. This is akin to the Europeans building the rail tracks over the mountains in Austria, when an engine did not exist that was powerful enough to go up along these tracks. however, they knew, that one day an engine will come which would be able to close the journey. Lisp is that track, and Lisp OS is that system. All Hail Emacs. ( whoops, are my prejudices showing? -hehe )

[0] [2010-09-12 01:44:31] Matthew Rankin

As an electrical engineering student, the only programming classes I ever took were Fortran and assembly for embedded systems design. I used the assembly language as needed to program 8051 or 68HC11 and equivalent microcontrollers.

My primary programming language—if you could call it that at that time—was Matlab. Matlab was great for my needs, as I was almost always dealing with matrices consisting of complex numbers and wanting to plot results.

When I got into graduate school, I took a computational electromagnetics (CEM) course that required you to develop three different programs:

  1. Finite-Difference Time Domain (FDTD) solver
  2. Finite Element Method (FEM) solver
  3. Method of Moments (MoM) solver

Since all I really knew were Matlab and assembler, I decided to write my first project—the FDTD solver—in Matlab. This turned out to be a colossal mistake. I found Matlab's Achilles' heel—stepping through matrices one individual element at a time, which is required in an FDTD solver.

It took 2–3 hours to run the solver, and then many times I'd find an error. Even when I reduced the problem size, so that the matrices were relatively small, the time it took to debug was still unbearable.

For my second project—a FEM solver to calculate the characteristic impedance of a coaxial cable—I decided that in the 5 weeks we were given to complete the project, it would be faster for me to:

  1. Teach myself C
  2. Develop an FEM solver in C

That decision was one of the better ones I've made. With a copy of The C Programming Language , 2nd ed. [1] by Brian W. Kernighan and Dennis M. Ritchie, I taught myself C.

I still have the source code from back in 1999 when I took the course. It consisted of one function—main()—and was some pretty ugly code. But it sure was faster than waiting on Matlab.


[0] [2010-09-12 01:49:03] mway

The first thing I -really- learned was LPC (my first experience with coding was on a MUD), and it spread like wildfire after that. C, then a ton of high-level languages, then C++ for good measure... can't get enough. C and its syntax will always be my favorite, though.

[0] [2011-04-08 10:33:09] Sun

Well, that was the most advanced programming language in my college curriculum. I had to sit through BASIC, FORTRAN, COBOL and PASCAL to learn C. How is that for an undergraduate course in Computer Science? :)

[0] [2011-07-28 08:22:39] Awesomania

Windows device driver programming

[0] [2010-04-13 14:27:04] kilotaras

I started my learning of programming with Pascal. Soon after that i started learning C++. Actualy ACM contests helped me a lot in it.

[-5] [2009-04-21 22:23:06] Henrik Paul

...but I haven't taught myself C! Doing just fine without it, thankyouverymuch.