Skip

*(&wtfdoesthismean);
January 13, 2008 6:21 PM   Subscribe

I can handle Ruby, Python, PHP, Perl, and, sigh, Java. My C and C++ are purely academic. How do I get into 'real' programming as an undergrad.

So, I'm looking into internships this summer (pst, guidance appreciated), and seeing a couple that look for C++ and C, and one or two (Fog Creek) that look for serious pointers/recursion/functional abilities. I would like those abilities, and languages like Smalltalk, OCaml, Lisp, Prolog, and Haskell.

I'd like to find a way to learn these which will keep me engaged (I've learned my current languages because I had a use - web development - that has kept them sharp). The big problem, it appears, is that math does not enthrall me. I can understand it (Calc II, Linear, doneski), but doing it in my free time? Egh.

So... are there any non-math problems which these languages are well-suited for, and any resources you guys have found useful? Or thoughts on the usefulness of them overall? I seem to waver between thinking that they are essential for understanding the basics or of essentially theoretical usefulness (each seems to have one or two 'big applications' written in them).

Thanks for any help!
posted by tmcw to Computers & Internet (23 answers total) 15 users marked this as a favorite
 
What do you want to do? Learn C++ by writing programs? Learn specific skills for internships you are interested in?
posted by demiurge at 6:25 PM on January 13, 2008


Where are you seeing the "pointers/recursion/functional" thing from Fog Creek, as a point of interest? I don't see it here, that's all.

You may be mischaracterising what people want from programmers, especially with your focus on maths. I don't think employers look at it the way you're looking at it.
posted by AmbroseChapel at 6:33 PM on January 13, 2008


Be careful here. There's a big difference between learning a language to progress your career versus sheer interest / learning. C# would be far and away the most useful language to learn in terms of career prospects right now (assuming you know Java). Fog Creek is a reasonably exceptional development company in that it has a boutique attitude to development demanding a solid knowledge of computer science, whereas the majority of employers just want someone who "can code".. and those sorts of employers are looking for C# and Java types.

The big problem, it appears, is that math does not enthrall me. I can understand it (Calc II, Linear, doneski), but doing it in my free time? Egh.

Unfortunately (for you), computer science is math (a lot of computer scientists think the field is poorly named, it's really more like "computational mathematics"). If you don't have a passion for it beyond your job, you are probably best focused on becoming a really hot C# or Java coder. There's great money in that and it's a great job. People like Fog Creek, Google, and other progressive development shops, are typically looking for people who have a passion for computer science and development. If the thought of learning functional programming or building a LALR parser doesn't get you all excited and itching to start, you really need to think about your route carefully.

Forgetting all the above, if you really want to pick up at least a smattering of the ground knowledge you need to become a well rounded programmer, I'd start with a regular "how to learn C in 21 days" type book and get through it. Once you've done that, and pointers don't seem so alien, move to C++ (I forget who published it, but there's a "C++ in 21 days" book that's actually really good). All of that should give you a background in one large area of programming, but won't help with your knowledge of functional programming at all.

For getting smoothly into some of the deeper areas, and particularly functional programming, read Structure and Implementation of Computer Programs, probably the most cited computer science book in terms of "you must read this to be a real programmer." You can also follow some amazing MIT lectures based on material from the book. They are free to download and very compelling watching. If you watch the first one and don't feel the itch to watch the second, then my point from earlier in this post applies.. become a career coder.
posted by wackybrit at 6:37 PM on January 13, 2008 [2 favorites]


One way to learn C/C++ pretty thoroughly (i.e., having to learn a lot language features), is to write any kind of network-based program. For example, a simple telnet client or a basic HTTP-based file fetcher (a la wget).

Another way to learn pointers and recursion in C/C++ would be to write a simple ray tracer, but I only recommend that if you are already comfortable with the math involved (i.e., already know it, not just comfortable learning it). For bonus points, combine the ray tracer with networking to make a simple distributed ray tracer.

One other possibility, if you really want to get into it, is to build a (toy) OS, which is something that basically requires C. There are lots of sites that can help you with this. Somewhat easier would be to use a teaching OS like Minix and implement a new feature or remove and rewrite an existing one.
posted by jedicus at 6:38 PM on January 13, 2008 [2 favorites]


I would like those abilities, and languages like Smalltalk, OCaml, Lisp, Prolog, and Haskell.

Just an extra tip.. employers very rarely look for people who know languages like Smalltalk, OCaml, Lisp, and so on, for practical reasons. They don't use those languages and don't want you to build apps with them. Progressive employers do, however, consider the fact you've at least played with these languages, and have a knowledge of the concepts they use, as an indicator that you're actually interested in computer science to some level.

So, really, don't set out to "learn" these arcane languages, but just become vaguely familiar with them, have a play with them, write a program or two, and get to grips with the various pros and cons. That's what the progressive employers are looking for.. not actual OCaml or Haskell development skills, per se (there are exceptions, of course, but you're talking about some really arcane jobs there).
posted by wackybrit at 6:40 PM on January 13, 2008


Fog Creek is definitely a weird place. For one thing they use their own programming language based on Visual Basic and ASP (*gag*) that can be cross compiled into either ASP or PHP. That's for their flagship project.

Pointers are not very hard to understand if you have a firm grasp of how computers work. Just think of them as array indexes, except to an 'array' that contains all the memory on the system (or at least what your program can address)

And also, I'm not quite sure what you're talking about when you say "non-maths". Mathematics, beyond basic arithmetic doesn't come into play unless you're building something complex, and then you'd be dealing with discrete math issues that look more like 'programming' anyway.

It's not something you would have to deal with on an every day basis unless you're working on video games (3d math) or perhaps machine learning, and maybe some other esoteric fields.

Anyway, if you want to learn C or C++, try writing some applications using gcc to compile console text apps, or download visual studio express and write win32 programs. It's not too hard if you know java. Pointers can be a problem but they're really, really simple once you get it.
posted by delmoi at 6:49 PM on January 13, 2008


Write some C and C++ programs for windows using the win32 API. See Petzold's old Programming Windows books. You can do C++ using the win32 API or use Microsort's MFC. Beware that the win32 and MFC APIs are pretty ugly. But you can still learn some useful C/C++.

Write some console programs, no GUI needed, and you exercise your C/C++ skills. Work though Kernighan & Richie, or work through Kermighan & Pike's "The Practice Of Programming". There's tons of exercises in Stroustrup's The C++ Programming Language.

Write some embedded code in C for some simple device. See Make Magazine for some of their embedded projects like this.

Lots of open source stuff is written in C. Look around and read some code.

Write an application in C/C++ for the people in this thread using this library.
posted by DarkForest at 6:50 PM on January 13, 2008


Seconding network/OS stuff for C. That stuff is great for two reasons: 1. it's what C was designed for, and 2. you'll get lots of practice reading specifications (for network protocols, PC hardware like disk controllers, etc.).

You might want to try working through the exercises from this course; they're extremely well laid out. It'll be hard if you haven't done low-level stuff before, but, hey, might as well jump right in, no?
posted by equalpants at 6:54 PM on January 13, 2008 [1 favorite]


Oh, hey, thought of another one: write an NES emulator. There's plenty of documentation out there, plus open-source emulators to study.
posted by equalpants at 7:02 PM on January 13, 2008 [1 favorite]


@wackybrit: Just to clarify, I'm interested in this stuff mainly because I'm personally interested, rather than for a job. OCaml will do me as much good in the job hunt as my religious studies minor, but it might be a cool thing to have. And I like some of the more mathy parts of CS, like formal algorithm analysis, but higher-level (let's say... Calc II and Number Theory) math on its own seems insane and provokes insanity in otherwise normal people who chose to major in it.
posted by tmcw at 7:15 PM on January 13, 2008


Write a language interpreter in C. I suggest lisp/scheme or FORTH. Both are tiny languages that are easy to grasp, but offer some interesting challenges in implementation.
posted by plinth at 7:39 PM on January 13, 2008


OCaml has bindings for lots of interesting libraries, so really, any program that you might want to write in Perl or Python could also be written in OCaml. You can find lots of these bindings distributed with Ubuntu, or you can take a look at this site here for a nice listing of things.

Also, in the Windows-y universe, there is F#, which is very OCaml-like and interoperates pretty seamlessly with C# libraries and code.

Neither of these languages could fairly be called arcane, as each has hundreds of industrial users. Forgiving me for omitting a citation, but you can probably google for "industrial users of functional programming," or "commercial users of functional programming" to see what I mean. However, as an example, Jane Street Capital has been aggressively hiring OCaml programmers who develop software for their financial quantitative research.

On the other hand, it's probably best to learn how to think like a functional programmer, first. For that, a course at your school that uses a functional language, or reading SICP, or even just an OCaml tutorial are probably a good start.
posted by Zach! at 7:47 PM on January 13, 2008


Just some observations...

It takes years to learn a language decently, in the sense that, if you write in the same language for several years, your first few years of programming will look really crude to your years-later eyes. Experience counts. And there are no three-month experts.

I never had any trouble thinking about pointers, but there are lots of people who, while otherwise decent programmers, just never get the idea of pointers. It's like some people can never make sense out of algebra, or, as a high-school math teacher told me, there are students who can never figure out how to do word problems (Billy has twice as many apples as Suzy, Together they have 12 apples, etc).

People like this can be and are creative and effective computer programmers. But they will never be C or C++ programmers.

And a last observation: It is a hell of a lot easier to fix/modify a program than to design and write one from scratch. As the long-suffering writer said to the eager, annoying, suggestion-filled producer/director/critic/backer:
Where were you when the page was blank?
(I thought the quote was SJ Perelman, but it may be Fred Allen, as some references claim. If Truman Capote or (ech) Harlan Ellison ever said it, they were quoting and they knew it, even if their auditors didn't.)
posted by hexatron at 7:50 PM on January 13, 2008


The best thing about learning C++ is Stroustrup's excellent book on it, "The C++ Programming Language." It's got exercises at the end of each chapter that vary from the trivial to full-fledged applications and if you work your way through it you will know C++ inside and out.

If you try out Lisp or something and really love it consider that while there are more C# jobs, there are more C# programmers, and there is some financial incentive to make yourself a rare commodity for the few shops who do use Lisp (or whatever).

I'd recommend you get the latest edition of Stroustrup's book and learn C++ because it won't be as large a leap as you seem to fear if you're basically conversant in the other languages you listed. Do anything that sounds interesting with threads. A simple game, a http server, whatever, just make it run in parallel without blowing up. Being able to do concurrency is huge, in any language.

After that, try some basic artificial intelligence programming in Lisp to learn an almost entirely new way of thinking about computer science problems. A Lisp neural network that does optical character recognition is a thing of beauty. Or it can be, anyway.
posted by moift at 7:52 PM on January 13, 2008


If I'm not mistaken in your central question has not been answered yet. What are Smalltalk, OCaml, Lisp, Prolog, and Haskell well suited for?

First, fear not, none of these languages has anything to do specifically with math.

I wrote many programs in OCaml. It is my favorite programming language. It is powerful and fast. I wrote an indexed search program for bitex files in OCaml http://unix.freshmeat.net/projects/bibgrep/ I wrote a program that read-in C and spit out Java byte code, as I describe in this paper : http://www.cs.brown.edu/~gmarceau/papers/zhang06case.pdf I wrote a visualization program for cytometry data, as described on page 12 of this PDF : http://www.cs.brown.edu/courses/cs237/2003/proceedings2003.pdf

Each time, OCaml was a joy to work with. It is a strong language over all, and it really shines at anything involving fancy data structures.

Haskell is similar to Ocaml, but even more powerful, in part because it is a more radical departure from the usual programming languages than OCaml. That makes it stranger, if OCaml wasn't weird enough already. However it is slower -- it's hard to beat OCaml -- which makes it less universally suitable.

I wrote my editor DivaScheme as a plug-in to DrScheme in the language PLT Scheme, which is a kind of Scheme, which is in the same family as LISP. http://www.cs.brown.edu/research/plt/software/divascheme/ Because of their powerful macro, LISP-like languages shines at implementing and using domain-specific languages. This talk describes how that works out : http://www.cs.brown.edu/~sk/Publications/Talks/SwineBeforePerl/

Prolog is a logic programming language. It is extremely domain specific. You will not go writing websites with it. But you can write a kick as solution to this problem : http://www.cs.brown.edu/grad/phd/reqs/archive/comps2001.pdf Logic programming has evolved since the Prolog days. If I were you I would instead play with its modern descendant Alloy : http://hashcollision.blogspot.com/2007/11/zelda.html

I am not so familiar with Smalltalk. All I know is, dynamic typing is essential to Python, Ruby, Perl and their friends. Yet, there are a lot of deep ideas about the nature of dynamic typing that await those who are willing to learn Smalltalk.

I would add Erlang to your list. With the arrival of multicore CPUs, concurrent programming is more important than ever. Erlang is the language that offers the most on this subject.
posted by gmarceau at 9:02 PM on January 13, 2008 [3 favorites]


Looks like I'll be the contrarian voice in this question. I'm a game developer, but during school I was in to other application development. Right now the closest thing you know to a "real" language is Java, the rest are web only languages. If you're seriously interested in doing embedded, OS, or non-web application development I wouldn't waste my time with stuff like Smalltalk, OCaml, Lisp or Prologue; No-one uses those in the "real" world, and they're mostly seen as parlour trick languages. You're going to want to focus mostly on C/C++ and assembly. You should probably learn C/C++ stuff first since you're not used to the ideas of pointers and memory management yet. I think you'll find that after learning C/C++ you'll understand programming a lot better, and learning assembly will grow your understanding far beyond that.

As to how to go about this, you're just going to need to write a lot of code. The first challenging thing I had to write as a budding coder was a linked list class; it requires basic understanding of pointers and memory managment. Next move on to implementing other data structures like a tree, a managed array, a hash table, a string class, etc. Then move on to actual basic applications. For these applications you should use the classes you wrote for data structures, NOT because the classes are any good(STL does it better than you), but because they will break horribly and you'll learn a lot from doing it.

This idea that you'll need lots of math is also somewhat BS. I imagine there might be some actual "computer scientists" out there sitting in an ivory tower doing complex mathematical analysis of programs all day long with huge blackboards filled with esoteric equations. It might depend on application domain, but I tend not to use my 2+ years of calculus all that much. If I were you I'd take the classes and if something sounds like BS you'd never use, then you probably won't.
posted by hamhed at 11:18 PM on January 13, 2008


Does being a contrarian depend on inaccuracy?

Right now the closest thing you know to a "real" language is Java, the rest are web only languages.

PHP is arguably a "Web only language" (it's not, but hey) but Ruby, Python and Perl are not "Web only languages" in any sense at all, and certainly no more than Java would be considered to be.

You're going to want to focus mostly on C/C++ and assembly.

The C/C++ and assembly combo is nearly entirely limited to the high-end graphics industry (including gaming), OS development (and barely so there now), driver development or embedded systems nowadays. In your paragraph you missed out the type of development that makes up perhaps 90%+ of the industry's output: regular applications! Assembly is practically dead in terms of regular application development.

This idea that you'll need lots of math is also somewhat BS. I imagine there might be some actual "computer scientists" out there sitting in an ivory tower doing complex mathematical analysis of programs all day long with huge blackboards filled with esoteric equations. It might depend on application domain, but I tend not to use my 2+ years of calculus all that much. If I were you I'd take the classes and if something sounds like BS you'd never use, then you probably won't.

Computer science includes, just for a start, algorithm development, data structures, efficiency, and understanding big O notation. Differential and integral calculus are, admittedly, little used, but lambda calculus is reasonably important to understand as a programmer, particularly if your work involves a lot of algorithms or dynamic languages. "Computer science" is not just people sitting around building compilers or writing proofs.. it's the whole theory of computation that programmers use pretty much most days.
posted by wackybrit at 11:40 PM on January 13, 2008 [1 favorite]


PHP is arguably a "Web only language" (it's not, but hey) but Ruby, Python and Perl are not "Web only languages" in any sense at all, and certainly no more than Java would be considered to be.

I call them web only languages because they all became popular for developing web applications. And they get used mostly for that because they don't really offer anything that is really a dealbreaker over C/C++ (I'll concede some people like Java for regular application development, but see my next paragraph). Not to mention he states that he uses all these for web development...

The C/C++ and assembly combo is nearly entirely limited to the high-end graphics industry (including gaming), OS development (and barely so there now), driver development or embedded systems nowadays. In your paragraph you missed out the type of development that makes up perhaps 90%+ of the industry's output: regular applications! Assembly is practically dead in terms of regular application development.

I think you missed the part where I said "If you're seriously interested in doing embedded, OS, or non-web application development". I don't make the claim that you'll ever actually write new assembly code, only that understanding how to is invaluable, and in the aforementioned domains it is extremely valuable to be able to read debugger disassembler output. As for "regular applications", most of the everyday workhorse applications you're going to use are c/c++, : windows, linux, ms office, IE, apache, and firefox to name a few. It may be drastically different in the business world(my little experience is they all want webapps anyways), but I make no claims to knowing much about that.

Computer science includes, just for a start, algorithm development, data structures, efficiency, and understanding big O notation. Differential and integral calculus are, admittedly, little used, but lambda calculus is reasonably important to understand as a programmer, particularly if your work involves a lot of algorithms or dynamic languages. "Computer science" is not just people sitting around building compilers or writing proofs.. it's the whole theory of computation that programmers use pretty much most days.

I don't deny that most of that stuff can be useful (well, except for lambda calculus), but it irks me when people come up with these big claims that to be a software engineer you need to be a math god. But if I had choose to between someone who spent all their time learning lots of math and someone who spent all their time writing actual code I would take the coder in a heartbeat because most math problems that you're going to run in to can be solved with a little bit of google and an hour or two thinking.
posted by hamhed at 12:39 AM on January 14, 2008


Are any of your professors doing research that requires coders? I would look into helping out on a research project at your school. They'll probably be doing work in all manner of languages, depending on the strengths of your program.
posted by that girl at 5:37 AM on January 14, 2008


- Just a follow-up: I've written linked lists and binary trees with both C++ and Java, but since they were just class projects (and, for the whole time we were aware that the standard libraries were better in every respect), I can't say I retained the information. I can understand pointers in theory and practice, but I'd like some excuse to make this a working knowledge - a ray tracer or some sort of highly memory/processor-bound app might be the ticket.
posted by tmcw at 7:34 AM on January 14, 2008


Not to be a jerk, but I think, given your question, that you really don't understand a lot about computer science. You say you want to learn a real language, but then you throw an "ugh" in front of Java and say that you really don't like math.

Of the languages that you listed, Java is by far the most "real" one, whatever that means. If you can do good code in Java (things like recursion, good comprehension of algorithms and data structures, etc), then you can easily do it in C/C++ as well. And, as a few people have already said, CS is basically just a lot of math. If you don't think math is fun, then you're definitely not going to have a real great time with Assembly or really low-level C, in my opinion.

You also say that you've done things like linked lists and binary trees but didn't bother to retain it, but if you're trying to be a low-level coder, that's exactly the stuff you need to retain. Even if you plan to use the standard library's implementations, you need to understand how they work so that you know which one is the right tool for the job.

Whenever I interview people, I end up asking them to do simple things like linked lists, a recursive algorithm and then maybe have them design a simple data structure. I can't believe how many people who have advanced degrees in Computer Science can't do these simple things.

I personally think that it doesn't really matter that much what language you're working in. You can write bad code and good code in almost anything, it's the deeper understanding that makes a difference.
posted by atomly at 9:04 AM on January 14, 2008


It takes a bit of passion, but not a massive amount of math. My poor advice based on my history... you've hit the major stuff, go to FORTH, a forth image can start with a bunch of assembly code hard coded, then it goes to some more complex code built on the primitives previously defined, then next thing you know, you have an OS built on the primitive foundations. After TRS-80 Basic and Apple Basic and then some Pascal, and some Assembly programming, FORTH was the eye-opener. 20 pages printed out is like a full OS and flipping around will blow your mind, you go from punching raw numbers that 'mean something' into the CPU to an assembler, to an OS, to a full blown system... learn this. Then some Prolog, Smalltalk (aka Squeak), and seconding the Erlang as awesome... I've been hacking Erlang 'ejabberd' server for a couple of years and it's the bee's knees for distributed computing.

Anyway, maybe not marketable (but that's OK 'cause I'm in an Academic setting...), I'd say Forth, Smalltalk and Prolog pretty much define my programming. Low level, High level, Functional-ish. But I'm still JAPH.
posted by zengargoyle at 11:27 PM on January 14, 2008


@atomly: I'm okay with Java, but (like many developers, it seems), it has always seemed poorly implemented, slow, and unsuited as a learning language. Don't want to start a language war (and I know that it's a probable option if I ever get a job :).
posted by tmcw at 11:43 AM on January 16, 2008


« Older Where should I take beginning ...   |  I'm looking for a series of ha... Newer »
This thread is closed to new comments.


Post