Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Programming Technology

How To Get Into Programming? 195

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?"
This discussion has been archived. No new comments can be posted.

How To Get Into Programming?

Comments Filter:
  • by jtev ( 133871 ) on Monday October 24, 2005 @01:49PM (#13865241) Journal
    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".
  • 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)

  • basics (not basic) (Score:3, Insightful)

    by yagu ( 721525 ) * <{yayagu} {at} {gmail.com}> on Monday October 24, 2005 @01:59PM (#13865346) Journal
    • learn and have great command of an editor (vim?)
    • play with something interpretive (not basic)... forego the hassle of having to learn compilation and compile debugging to start. (I suggest perl, if you can master some simple concepts in perl quickly, you're likely to have some programming aptitude or be completely looney.)
    • step up to some 3GL... I prefer C or C++, but you'll have to learn about compiling, executables, etc.
    • invest all time necessary to be fluent in the debugging facilities of ANY language you choose, and by that I don't mean learning "print" statements, they're totally useless, take too much time, and perturb code you think you're debugging. (NOTE: this investment will be dear, but the Return on Investment is a windfall).
    • avoid "IDE's" like Visual Studio if you can, they start you out with a crutch you may never throw away and keep the underpinnings of languages opaque. If you AREN'T interested in learning how languages work, skip this bullet.

    A couple of points: I can't stress enough achieving fluency in your editor of choice. Create a sample file, write down a list of changes, navigations, etc. and DO THEM ad nauseum... until it's second nature. The last thing you want in programming is the noise that is editing.

    Also, learning debugging techniques is off-the-scale important. I was the pariah on a team I worked with because I fell a few days behing on some "assignments". The team was incredibly hostile. I was new to the environment and was spending up-front time learning the debugger of the environment. The team demanded I use print statements and I refused. Within a week (when I had caught up), team members asked how I was doing things looking over my shoulder. I soon had the rest of the team using the debugger and establishing that as the standard (I know, I know, what kind of team was that in the first place???, no comment).

  • by rgbe ( 310525 ) on Monday October 24, 2005 @02:01PM (#13865364)
    If you really want to learn a 70's language, you can start with Fortran77, it came hot off the press just a year before you got your first computer. However, I recomend learning in C if you are already computer literate. It's not the most modern programing language but there are lots of resources available and until recently it has probably been the most popular programming languages. With C you will learn all the nasty things like "pointers" and "memory allocation" that the modern langauges tend to hide. You also get to learn a very well structured language.

    A good place to start with C is: http://www.cs.cf.ac.uk/Dave/C/CE.html [cf.ac.uk] It is a good intro.

    Then you will also need a good IDE (integrated development environment) and development platform, for Linux there is Anjuta, Eclipse, Emacs (for those who are not affraid), and many more.

    And the thing I most recomend, is just search the web for interesting bits of code, compile and run them, then discect them.

    But most of all, Enjoy :)
  • Doing it backwards (Score:5, Insightful)

    by Otter ( 3800 ) on Monday October 24, 2005 @02:10PM (#13865439) Journal
    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.

  • Languages to Learn (Score:4, Insightful)

    by DavidNWelton ( 142216 ) on Monday October 24, 2005 @02:13PM (#13865465) Homepage
    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.
  • by Bootle ( 816136 ) on Monday October 24, 2005 @02:21PM (#13865518)
    What I have always found is that I need a goal in my mind. I can't just say, "I want to learn PHP." It needs to be, "I need to write a webpage for automating google searchs.

    Of course, learning to program is all about the concepts, the rest is just syntax. If you know C/C++, it's nothing to learn PHP, javascript, python, etc. So once you get started and get some real knowledge under your belt, it will get easier and easier.

    Ask yourself what you want to accomplish, then learn what you need to meet that goal

  • by drakaan ( 688386 ) on Monday October 24, 2005 @02:35PM (#13865605) Homepage Journal
    Building on that thought, I'd say you might want to get your feet wet with Perl. There are many ways to structure Perl code, and it'll make it reasonably easy to move to C or C++ later on. Dink around with it until you find something you want to do, but can't, and then delve into C to find out if you *really* want to know how to do it. You can make useful programs, get help from plenty of people, and learn a bit at the same time. Just remember "#!perl -w" and "use strict;"
  • by adamy ( 78406 ) on Monday October 24, 2005 @02:39PM (#13865646) Homepage Journal
    The post about Turbo Pascal made me realize one of the key tools for learning programming, a good IDE. While I agree that learning a program from the ground up using vi/emacs and the command line compiler is a valuable experience, there is nothing like a good intergrated debugger and statement completion to aid you on your way to understanding.

    My advice, download eclipse and get yourself a copy of Bruce Eckel's "Thinking in Java."

    I originally learned on a C-64, moved to Pascal in highschool using a line editor and UCSD Pascal on an Apple IIe. In College, I got Turbo Pascal and the added advantage was extreme. There is nothing like stepping through your code in a debugger to really understand how it works. There were still a lot of things I didn't understand, the big one being memory management.

    Once you learn thingsd in a high level language like Java, you can move down into the nuts and bolts of memory mangement, pointer math, and all those things you need to know to poke at the operating system.

    At the same time, you might want to learn a scripting language. I tent to use Bash a lot, and it is not a bad place to start.

    One of the most useful courses I took in college was comparative programming languages, where we learned how to learn a new language. But to get there, you need somewhere to start, and I would advise Java. It is designed for inexperienced programmers, and yet for accomplishing serious programming tasks. Once you know a language that has training wheels, you can take them off and attack things in C and assembly.

    Good Luck, and may the source be with you.
  • A couple ideas (Score:4, Insightful)

    by ctr2sprt ( 574731 ) on Monday October 24, 2005 @02:41PM (#13865652)
    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.

  • Re:Take a class (Score:3, Insightful)

    by dr_leviathan ( 653441 ) on Monday October 24, 2005 @02:41PM (#13865653)
    I would agree with this. If you haven't been able to learn programming over the years of messing with computers you will need some impetus in the form of a homework assignment.

    Also, you should take a class in using the CLI if you haven't already picked up much proficiency yet. Using the CLI on *NIX as a serious tool will provide more opportunities to learn programming. I just recently decided to learn a little BASH programming to manage all of the CLI aliases I was putting into my ~/.aliases file -- so I relearned how to write functions in BASH -- it was a fun little sidetrack from my normal day.
  • A couple of books. (Score:3, Insightful)

    by jsantos ( 113796 ) on Monday October 24, 2005 @02:50PM (#13865710) Homepage
    If you have good math foundations you can try: Structure and Interpretation of Computer Programs - 2nd Edition [amazon.com]. Which will teach you a lot of sound principles. Otherwise you can try: How to Design Programs: An Introduction to Programming and Computing [amazon.com]. 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.
  • python (Score:4, Insightful)

    by bluGill ( 862 ) on Monday October 24, 2005 @02:50PM (#13865713)

    I recommend you start with python, for two reasons: there is a good book How to Think Like a Computer Scientist [ibiblio.org], 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.

  • by stanmann ( 602645 ) on Monday October 24, 2005 @02:54PM (#13865742) Journal
    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.
  • by poopdeville ( 841677 ) on Monday October 24, 2005 @03:04PM (#13865808)
    I like your suggestions very much. However, in my experience, there's a lot of C voodoo that might make it unsuitable as a first language unless one has personal instruction. I'm referring to the comiler chain, libraries, and other technologies that mighting appear to be unduly important to the novice. Indeed, when I first tried to learn C, I ended up trying to read through the gcc documentation because K&R suggested that I should get to know my compiler. Obviously, at that stage, it was a tremendous waste of time.

    My suggestion is that an autodidact should learn the basics of a scripting language first. I abandoned my initial efforts to learn C and picked up a copy of "Learning Perl." There's a minimum of "black magic" -- just a line at the start of your program telling your operating system where to find perl. It takes about a week to get through Learning Perl at a relaxed pace. Granted, it does not cover the entire language. But it does cover Perl's procedural fragment in depth. From here it is straightforward to move on to more advanced Perl, or laterally to C and other procedural languages. I would image Python and other scripting languages would be similar.

  • by Proc6 ( 518858 ) on Monday October 24, 2005 @03:13PM (#13865884)
    Any "real" programmer can pick up a new dialect in a few days.

    It takes 5 minutes to learn how to drive a clutch, a hell of a lot longer to learn how to drive it well.

    Theories from one language indeed can apply to another, but the nuances and awareness of an entire framework and what works "well" versus what "works" are what seperates the wheat from the chaff.

  • by Arandir ( 19206 ) on Monday October 24, 2005 @03:41PM (#13866079) Homepage Journal
    It's like learning a spoken language. You can study all you want about nouns and verbs and tenses, but until you actually learn some vocabulary, it's all meaningless. Your first step in programming is to learn a language, because the principles are pointless without a language.

    p.s. I also second the Qt recommendation. To learn C++, I would recommend Practical C++ Programming [oreilly.com]. This is one of the very few C++ books suitable for a programming newbie.
  • by cypherz ( 155664 ) * on Monday October 24, 2005 @03:45PM (#13866107)
    It seems that the prefered beginners languages here on /. are (in no particular order) are Python, BASIC, and ANSI C. All are IMNSHO, good choices for a beginner. A few have mentioned Ruby, which is a very approachable language. But the best advice I've seen here so far is "Find an itch you want scratched". That is, find yourself an interesting project, and code it. Decide which platform its gonna run on, pick one of the above mentioned languages and do it! The only way to learn to code is to code! Oh yeah, it helps to read code. Reading source is a huge help to see how others solved problems.

    One problem with this discussion is that you never said what platform you use or want to write for. This lack of information about what you want to do is really common. Almost _every_ one of these "Ask /." articles leave out information that respondents need to adequately answer the darned question! At any rate, if you're a M$ kinda user, I think you should get ahold of VB 6 or VB.net and start with that. Lots of books etc available to make getting started easy. If you're a Linux/UNIX sorta person, then the ANSI C recommendations really start to make more sense.

    I think the bottom line is this: If you just want to learn some more about programming "in general", then you probably won't learn much. If you have some sort of persistent interest in solving some problem or other, or you want to make your life easier by automating something, then just code it! /* this post is really disorganized. i'm in the middle of debugging a headless batch process on HP-UX, so this post is only getting spare clock cycles */

  • by pyite ( 140350 ) on Monday October 24, 2005 @04:23PM (#13866388)
    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.

  • Re:ANSI C (Score:3, Insightful)

    by AuMatar ( 183847 ) on Monday October 24, 2005 @04:29PM (#13866424)
    I'll put in another vote for C, and list my reasons:

    1)The syntax is simple, and is the basis for every major language today.
    2)It has most of the major features of other languages except inheretance and generics, both of which ought to be skipped until you understand procedural anyway.
    3)It doesn't force you into OO, allowing you to examine other paradigms. Whatever some people will say, OO is not the best way to do everything.
    4)It has good, freely available tools.
    5)It forces you to deal with resource allocation (memory management). This is a major concept in programming, and if you do not learn and understanad it early, you will never understand it at all.
  • by Peter La Casse ( 3992 ) on Monday October 24, 2005 @09:04PM (#13868250)
    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.

  • by Zebra_X ( 13249 ) on Tuesday October 25, 2005 @12:12AM (#13869159)
    Hell no.

    JS is enough to make someone stop programming and never look back. You need a compiled language first so the student can begin to understand syntax. After syntax you need to understand data types and flow. Then you can begin to create a program.

    Browser Javascript provides little/no guidance in any of these persuits. Nor is there a truly coherent reference on just how each of the JS engines are implemented.

    Compiled, well documented languages are a good place to start. Pascal or C are good bets.
  • by belmolis ( 702863 ) <billposer.alum@mit@edu> on Tuesday October 25, 2005 @01:07AM (#13869420) Homepage

    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 [wiki.tcl.tk].

Happiness is twin floppies.

Working...