Slashdot Mirror


How To Get Into Programming?

writermike asks: "Like many on Slashdot, I practically grew up with computers. I've had one or more since 1978. However, unlike a lot of people here, I simply never learned how to program. Twenty-seven years later, I still know nothing about 'programming.' I'm a fairly successful technology troubleshooter, having been in that role for 15 years, and I find as I delve deeper into why programs fail, my interest in programming rises, and I feel that not knowing the principles is a hole in my knowledge that hampers me a bit. There are so many books and courses out there that seem to focus less on principles and more on specific languages and/or the 'career-track'. I don't really want to code the next great web service. I want to learn principles, then begin to learn a language. Where can I begin the adventure I should have started back in 1978?"

17 of 195 comments (clear)

  1. To steal a line from the sneaker company by jtev · · Score: 5, Insightful

    Just do it. The first step to learning to program is to just start programing. I know that sounds a little trite, but honestly, unless you just start programing the theory of programing isn't going to mean much. Then once you've learned a little about how to program you can start thinking about the "One true methodology".

    --
    That which is done from love exists beyond good and evil
    1. Re:To steal a line from the sneaker company by fm6 · · Score: 5, Interesting
      ...just start programing.
      I'm reminded of the joke: "How can I make money in the stock market?" "Easy: buy stock at a low price, sell it at a high price." Strictly true, but not very useful. Exactly how do you "just start"?

      The answer to that depends on what you hope to learn. Programming is a big topic and there are a lot of ways to approach it.

      Probably most Slashdotters will answer this question with something practical and job-oriented. "Get a copy of Kernighan and Ritchie, C is a language everybody should know." "Download Perl." "Download the Java SDK." "Use the VBA engine in Word to write macros." Etc. All worth doing if you're looking for a career as a programmer. But I sense that this guy is motivated more by intellectual curiousity than by career development. (As he should be — the developer job market is a tad oversupplied.) He's used computers most of his life, but has an unsatisified curiousity about how the suckers work.

      One good way to satisfy that curiousity would be with the very basics: machine language and assembly language. These are not useful skills for most programmers, who only need to know the high-level abstractions of the systems they work with. (Some people would disagree with me on that.) But for satisfying your curiousity about just what computers do, it's a nice exercise.

      Or instead of going very low level, you can go very high level, and learn some basic computer science while you're at it. That the route if you read the classic Structure and Interpretation of Computer Programs and work its Scheme programming exercises.

      Then again, learning programming on your own is not for everybody. If somebody has managed to be around computers for a long time, but has never go around to learning programming, he probably is the sort of person who needs some initial handholding. Community colleges often have good classes.

    2. Re:To steal a line from the sneaker company by stanmann · · Score: 5, Insightful

      Buy some books from the 90s with source code, documentation and specs. Doesn't matter what language or environment particularly. Basic is OK, C is OK, Pascal is OK. type in the code, or scan and OCR it. Kick the tires, see how it works. Change it. Break it. Fix it. Make it do something different. Make it do the same thing differently.

      --
      Food not Bombs is a nice platitude but it breaks down when you notice that the Bombees are usually well fed
    3. Re:To steal a line from the sneaker company by pyite · · Score: 4, Insightful

      Don't forget The Art of Computer Programming

      Wow. Umm, throwing TAOCP at someone who's never programmed but wants to is a bit like throwing an aerodynamics book at someone who wants to fly. Sure, it will tell you how to fly, but it won't get you much anywhere unless you have a solid mathematical background and really good machinist skills. Seriously. I postulate that someone who has a decent math background has also seen some sort of programming in their life. That said, the amount of Sigmas, Pis, and Integral symbols in TAOCP is enough to scare someone way away from programming if they haven't seen such notation before. Don't get me wrong; I love the stuff, and I own and read all three volumes, but it's not something you want unless you have programming experience and/or strong interest in mathematics and preferably both.

      --

      "Nature doesn't care how smart you are. You can still be wrong." - Richard Feynman

  2. Take a class by araven · · Score: 4, Informative

    Most community colleges have beginning programming classes. It's a way to get started before branching out on your own.
    ~

    --
    "A foolish consistency is the hobgoblin of little minds." -Emerson
  3. Low cost of entry/decent return on investment... by COBOL/MVS · · Score: 5, Insightful

    For a really low (and I mean low) cost of entry into the programming world, why don't you start with your web browser, a text editor and a good book on Javascript.

    Javascript is not the world's best language to get started with (not sure what is really), but it's good for instant graphical gratification. Make a .js file and an html file and simply load the html file into your browser. Any changes you make to your code would be viewable by simply refreshing the page.

    Another good language to start off with assuming you have a Windows setup is VBScript. This would be a better option teaching you control flow and how to structure a program. In spite of its reputation, it's a good "starter language". (Please, no replies about viruses or other results given from VBScript over the years--I'm being serious. As a teaching tool, it's a good start)

    --
    GOBACK.
  4. Perfect timing by MarkGriz · · Score: 5, Funny

    I've been wondering how to get out of programming.
    Do you want my job?

    --
    Beauty is in the eye of the beerholder.
  5. Doing it backwards by Otter · · Score: 4, Insightful
    I want to learn principles, then begin to learn a language.

    Some advice from a casual, self-trained, hobbyist programmer:

    1) You need an itch that has to be scratched. Find something you need, and code it. Outside of a classroom, you need to be extraordinarily self-motivated to learn in the absence of a defined project. Pick something, and *complete* it, despite the unexpeceted directions it will go.

    2) Don't worry about principles now. Learn to hack a bit, get some feel for writing working code, and maybe then start working through real CS books. Honestly, half the "programmers" graduating with CS degrees are inert to the underlying principles. You can have plenty of fun without them.

    3) For me, Qt/KDE was the tool that made it intuitive to jump from reading about objects and GUI programming to doing it. YMMV, obviously, but I'd recommend that as a place to start. Qt also has *the* best documentation in the open-source world.

  6. Languages to Learn by DavidNWelton · · Score: 3, Insightful

    It's hard to say exactly what language is the right one without a better idea of this guy's goals, but here's a shot at it:

    C: like the parent says, it will give you a good insight into how computers store things at a low level, and of course it's useful if you want to do low level things yourself. If you really get into programming, you'll need to learn it sooner or later, but it might not be the best if you just want to learn a bit and get something done.

    Tcl/Python/Ruby: Pick a scripting language and learn it as a good way to get things done quickly. Each has its advantages.

    Smalltalk, Forth, Scheme: less useful, but mind-benders that will open your eyes to different ways of doing and thinking.

  7. A couple ideas by ctr2sprt · · Score: 3, Insightful
    First, start with a full-featured interpreted language like Python, Perl, Ruby, or Scheme. Interpreted languages give you instant gratification that you won't get with Java or C. And because the languages I named all have big libraries, you can start writing some nontrivial programs with them too. As for which of these to choose, I would say Python, because I like it, but it's up to you. The Scheme syntax is cake to learn, but "the Scheme way" (actually the Lisp way) is unlike most popular languages so transitioning to something else would be harder. It's too easy to develop bad habits in Perl, especially if you don't know enough to have any idea what habits are good and what aren't. I've never used Ruby, so I have no idea how good it is. All four of these languages are full-featured, well-supported, and popular. None of them are toys: they are all used for serious work. So don't worry that you might be "wasting time" by learning one or more of them.

    Next, once you get past the simple tutorials, try to think of a simple program you'd like to write. My personal favorite target for learning exercises is reimplementing well-known Unix programs, or parts of them at least. So I might design a version of "cut" that does some things I want it to, like treat contiguous whitespace as a single delimiter. But maybe you already have something in mind, like a simple web app. If so, you should tailor your choice of language to what you want to do. Like if you want to make a simple web app first, you probably want to use PHP. (Which I didn't recommend earlier because it's a little harder to debug.)

    At this point you can hopefully write nontrivial programs - programs 100 lines or so long that mostly do what you want on the first few tries. Now you should learn Java. The main reason for this is that you will need to learn C, or at least a C-like language, at some point, but you don't want to get into the complex parts of C yet. Java will handle most of them for you. It's also a compiled language, so it adds an extra step to the process (code-compile-test instead of just code-test). This is probably where you ought to learn most of the intermediate programming concepts, like basic data structures and algorithms. What you may find helpful is going back and forth between Java and the language you started with. Sort of sketch out the app's framework and decide how you want to do something in e.g. Python, then rewrite it in Java. This will not only let you use the language you're most familiar with, it will give you a valuable understanding of how programming languages work.

    Finally, move to C. C++ would be an easier transition since it's much more like Java than C is. But what you want to learn is memory management and all the other hard shit, and there's no way to escape it in C (there are lots of ways to escape it in C++). Plus, once you have a solid grasp of C and Java, you will almost by default know C++. Then you can learn the advanced features of C++ without having to worry about anything else.

    Once you're at this point, you will be able to pick up the basics of any new language in a week or two. If you still want to learn and didn't start with Scheme, you should learn it now. It's a very different way of programming than you'll be used to, and it'll teach you even more about how languages work and how to be a good programmer.

    I'm assuming you want to do as much of this as possible on your own. The first two steps - learning your first language and writing some simple programs in it - can be done with books and online tutorials. Past that, however, I would advise taking classes. You will know enough by then to have questions which might not be answered in a book, but which an instructor could answer easily - maybe before you even know to ask. Instructors will also be giving you assignments which are neither too easy nor too hard (hopefully), which is really hard to do on your own. You'll quickly find that you can read a book and understand every word in it, but not be able to write a program that says "Hello, world!" on your own. You need to be practicing this stuff constantly as you learn it or all the books in the world will be useless.

  8. A couple of books. by jsantos · · Score: 3, Insightful

    If you have good math foundations you can try: Structure and Interpretation of Computer Programs - 2nd Edition. Which will teach you a lot of sound principles. Otherwise you can try: How to Design Programs: An Introduction to Programming and Computing. Which is also a good book for learning principles of programming but it's intended for a more general audience. Or you can try both. They are both worth owning.

    --
    This signature intentionally left blank
  9. python by bluGill · · Score: 3, Insightful

    I recommend you start with python, for two reasons: there is a good book How to Think Like a Computer Scientist , and because the enforced whitespace will start getting you into good habits as far as code formating from the start.

    Note that I said start. Python is a great language, I use it a lot for my real world stuff. It is not the be all, end all of programing. Programmers I trust strongly recommend Ruby. (I have not got around to learning it yet) You will need to learn both LISP (Scheme is great) and assembly (any assembly, doesn't matter which, x86 is about the worst choice you could choose to learn though) at some point if you want to become a good programmer. Do not get stuck in the rut of thinking that your first language is perfect for everything.

    While you can learn perl, php, C, Java, C++, C#, basic, etc, I recommend you avoid them until you need them (though I have different reasons to not recommend each). Unfortunately all are fairly popular, so odds are you will be called upon to use one. They are however ugly, so you should avoid them until latter.

    It has been said that it is impossible to become a good programmer if you start with basic. While this isn't strictly true, there is a lot of truth behind it.

    Real programmers do not think about language. Real programmers know that all languages are Turing complete, and thus if you can do it in one language you can do it in another. (though sometimes the language will try to get in your way) Real programmers are concerned about data structures, algorithms, and other such things that have nothing to do with the syntax of the language. While you are learning the language keep in the back of your mind that the language itself isn't what is important.

    I'm torn about the recommendation that you take a class. While classes can be good, there are a lot of teachers out there who know nothing about programing, but think they do. If you get a good teacher, take the class. However a bad teacher can teach bad habits. (Comments are good, but run from any teacher who makes you comment every line) Sadly as a beginner you will be unable to tell the difference between a good teacher, and a bad teacher.

  10. Re:Don't. But if you must, try this method by egomaniac · · Score: 3, Interesting

    Don't. Or at least, not as resume fodder or in an attempt to make a living. Coders are a dime a dozen these days.

    Sure. My team is trying to hire a couple of Java programmers right now. We're talking about a very well-known company (hint: there's a Slashdot category for us), a Silicon Valley office, and a six-figure income.

    And we're desperate. We finally (after much searching) managed to find a really great candidate for one of the positions, but the other one remains unfilled. I'd rather leave the position empty than lower my standards enough to pick some of the people we've talked to.

    So, I suppose I agree that coders are a dime a dozen if you're looking for an idiot that doesn't even understand the difference between "a == b" and "a.equals(b)", but if you're looking for competent programmers, they're tough to find at any price.

    --
    ZFS: because love is never having to say fsck
  11. Mod parent DOWN! by evilpenguin · · Score: 4, Informative

    Oh my God!

    I won't say this is completely wrong, because perl is a language where you can do an awful lot of useful things with a very small investment of time and effort, but the idea that one can learn "principles" of programming from our favorite hydra of a language is not a good one.

    IMHO (which is not H, BTW), I would start with a language that has a more coherent design.

    The big question is "objects" or "not objects." Secondarily, native compiler or scripted/VM language (which has more to do with getting used to the toolchain).

    I'm going to assume that you would like all the software to be free of charge.

    If you are going for objects, I would recommend starting with Java or Python. I would NOT recommend C++ because it is a complex hybrid of C and objects, doesn't have a single inheritance model, and gets enormously complex in its effort to cover all possible bases. Not that C++ can't be a great language, I just think it is not a best first stop.

    If you are going for non-objects, believe it or not, I would recommend C.

    Yes, C is full of pitfalls, but it is a simple language in design, easy to learn , but difficult to master. It can express powerful data constructs with simplistic data types and the experience of it translates well both "down" to assembly and "up" to other "safer" but more complex procedural languages. C is also a "classic native compiled" toolchain, which will stand you in good stead for all such similar toolchains.

    Java I recommend from experience, Python from reputation (people I know, respect, and trust like Python -- I haven't yet had occasion to go much beyond the "Hello, world" stage with it).

    As for how to start, for both of my "basic" choices, C and Java, I recommend beginning with a simple text editor and the command-line tools. Master using these for a few multi-file projects. In C, get used to writing and maintaining a Make file. Once you are comfortable with these basics, feel free to move to IDEs for simplifying/streamlining. But learn those low level skills so you don't become what I lovingly term a "tool junkie:" a person who can only be productive with a certain set of tools from a certain vendor.

    Back to perl for a moment: Please folks, don't think I'm trying to get religious about perl. I love perl. I use perl every day. But a programmer learning programming from perl is like a chemisty student learning the definition of "exothermic" with dynamite. Perl is, by Larry Wall's own admission (nay, boast) "pathologically eclectic." Perl's whole philosophy is "there's more than one way to do it." For learning, I like a language where there is one right way to do it. That way you don't develop bad or confusing habits. Once you have discipline and style, you move to the more expressive languages and you make good code with them. Bad perl code is just plain terrifying. In my 20 years of programming, once I got beyond BASIC, which is very much a toy, I went to Pascal. Pascal is a great (IMHO) learning language. But I don't see a lot of Pascal development these days (outside of variants like Delphi, which, I'm afraid, take you down the "tool junkie" path).

    Anyone got a great compiled procedural language suggestions besides C?

    1. Re:Mod parent DOWN! by Peter+La+Casse · · Score: 3, Insightful
      I agree that C is the compiled procedural language most suitable for a beginner. As others have pointed out, it's simple to start and exposes you to a lot of pitfalls that will increase your understanding of how things work "under the hood" (and you'll really appreciate things like garbage collection that you're exposed to in other languages.) There are tons of C resources out there, and a knowledge of C will let you understand many open source projects.

      That being said, I'd almost be inclined to start off with something like Python. It's a quick and easy way to be productive, it has good docs and it's more fun than C.

      For the record, my language learning sequence went something like this: Fortran, C/C++ (beginner C++ is mostly C), MIPS assembly, Lisp, Perl, Java, C (for real this time), misc UNIX shell scripting, Python, Prolog. I'm planning to work through a Haskell tutorial this weekend.

    2. Re:Mod parent DOWN! by belmolis · · Score: 4, Insightful

      These are good suggestions, including the one to avoid PERL. I think that where to start depends on the person's interests. If he wants to be able to write non-trivially useful code soon, one of the scripting languages would be best. On the other hand, if he wants to understand things at a fairly low level and is interested in hardware or operating systems, C is probably the best choice.

      Of the scripting languages, I suggest that Tcl deserves serious consideration. One reason is that I don't think that object-orientation is best for a beginner. OO languages are very useful for some things, but they aren't ideal for everything, and object-orientation adds complexity and additional concepts that it's best for the beginner not to have to worry about. So I recommend against languages like Python and Ruby that are obligatorily object oriented.

      Tcl also has a very simple syntax which makes it easy to learn. (Ironically, I think that Tcl is harder to learn for experienced programmers, who tend to make mistakes because they falsely assume that Tcl syntax is like that of Algol-class languages.) Tcl's other big virtue is the closely associated Tk toolkit, which makes it really easy to get started writing programs with GUIs.

      Finally, Tcl has a very helpful newsgroup comp.lang.tcl on which beginners' questions are welcome as well as a helpful wiki.

  12. 0, REDUNDANT by FireFlie · · Score: 3, Interesting
    "Oh, a couple more things. First, I'm not really suggesting that the grandparent post be modded down! I'm just disagreeing with it! It's a good post in and of itself. And totally intended to be helpful to the questioner, so please don't mod down the poster who first suggested perl!"
    Looks like it's a little too late for that, buddy. Thanks anyway, though.

    To one of your main points, however, yes perl doesn't exactly force you to use good programming habbits, but certainly C does not abide by your "there's one way to do it" philosophy. Plus, I try not to suggest new programmers to use C right out of the box because of it's uncanny ability to allow you to shoot yourself in the foot. I am not saying that C is bad, I have done a lot of C programming and as a language I absolutely love it, but dispite it's power, speed, and ease of use it may not be a great choice for a beginner who is not in a classroom setting (I would suggest it to either someone who has a little experience or someone who has a teacher to show them when they are doing something that is incredibly stupid). It is not always easy for someone to learn to program by themself, even someone that is experienced as a user.

    Perl may not be the best choice, but as I said, it sounds like it would probably be a great choice for someone in his specific shoes. He didn't sound like he wanted to change careers to become a programmer for a living, so many other languages may be quite unnecessary for him. Yes, perl doesn't exactly force you to program by the book, but it is something that he could get his feet wet with and possibly create something that could be of use to himself relatively quickly. Sorry, don't mean to rant, it just pisses me off sometimes that there are so many mods that don't understand the moderation system. I also would have modded my original post redundant if it would have read "ME TOO!!!!! PERL IS UBER L33T!!! LOLOLOL!!!", or something to that effect. I may not have added much info to the post before it, but I don't think modding it down was unnecessary.