Slashdot Mirror


Slashdot Asks: How Did You Learn How To Code?

Last week Apple's CEO argued that computer programming should be a 'second language', and that it should be a required subject for all students starting in 4th grade. But a large number of professional programmers didn't learn how to code in a formal school program, either because they're self-taught or because they learned on the job. There's a lot of abstract discussions about the best ways to teach coding, but if there's any group that's uniquely qualified to answer that question, it's the Slashdot community.

So leave your answers in the comments. How did you learn how to code?

37 of 515 comments (clear)

  1. Picked up a book. by PhrostyMcByte · · Score: 4, Interesting

    Thank my Uncle for introducing me to DOOM when I was ~10 years old. -- immediate "I want to make that". And so I picked up some books from the library.

  2. by playing the games ... by mlheur · · Score: 2
  3. The usual way by russotto · · Score: 5, Insightful

    That is, the usual way for 1980s computer geeks. Self-taught BASIC on an Apple II using a few books on Applesoft and Integer BASIC. Later Pascal also on the Apple II with a few books including Jensen and Wirth's PASCAL User Manual and Report. Learned C (K&R, mind you, none of that prototype crap) on a Mac XL with the old Megamax compiler. Picked up 6502 assembler out of necessity in there, also 68000 and 6809.

    1. Re:The usual way by Moblaster · · Score: 4, Insightful

      Because back in the 1980s computers booted to the BASIC command line interpreter/REPL. Nowadays, there is, more or less, no such thing. Closest similar thing most non-geeks will get to is a browser console, and while that is reasonable debugging tool for pros, it's not a similarly friendly programming tool for beginners.

      In fact, you practically need to be an experienced developer even to get a modern IDE up and running. Eclipse? Xcode? Not for the faint-hearted.

      Not sure about hard statistics, but I'd say it's a safe bet most new developers these days need to be shown how to get going. Beyond that, they'll naturally self-teach and bootstrap themselves, or fail out early. Because at the end of the day, no matter how you learn, your practical knowledge (meaning libraries and frameworks and tools, if not entire languages) will be functionally obsolete within two years, formal CS concepts and emacs/vim godliness notwithstanding.

    2. Re:The usual way by Solandri · · Score: 2

      Because back in the 1980s computers booted to the BASIC command line interpreter/REPL. Nowadays, there is, more or less, no such thing. Closest similar thing most non-geeks will get to is a browser console, and while that is reasonable debugging tool for pros, it's not a similarly friendly programming tool for beginners.

      Every copy of Windows has a command prompt which will let you write and execute batch files. Not that I'd recommend that as a way to learn programming, but most of the functionality is still there. Just not in a popular "language".

      I think the bigger impediment is that users expect everything to be in an easy-to-use GUI nowadays, and aren't all that interested in writing code which will only run in a command prompt. (That and the switch from procedural to event driven programming drove everything up an abstraction level.)

    3. Re:The usual way by Anonymous Coward · · Score: 2, Insightful

      Because at the end of the day, no matter how you learn, your practical knowledge (meaning libraries and frameworks and tools, if not entire languages) will be functionally obsolete within two years

      Sounds like you're investing in the wrong platforms. Java has been around for 20+ years. The Microsoft .NET platform has been around for 15+ years. Very large parts of both class libraries have been stable for over a decade now. A platform, library or programming language that's so poorly conceived that it's obsolete in two years doesn't sound like it's worth learning. Frankly, that sucks and I don't program on platforms that suck. Java or .NET might not be sexy Silicon Valley flavor of the month hot language or platform, but they pay the bills and keep getting used to get real work done year after year. Meanwhile Silicon Valley is basically still in the advertising business, with few exceptions. Save the world? Hardly. I don't either of course, but neither do I claim too. My advice to any new programmers coming along, especially young Americans, is to find an un-sexy niche platform that's integrated heavily into the economy and that nobody else wants to learn, like embedded industrial control systems or something like that. There's probably a Java interface to it too. Playing catch up with whatever flash in the pan technology that the hip startup of the month is using is a sucker's game.

  4. 2 week FORTRAN short course at JC. Lied about age. by HornWumpus · · Score: 4, Interesting

    I was off and running. Self taught basic, 6502 and Z-80 assembler. Worked two summers to buy my first microcomputer.

    Learned a bunch translating various basic dialects. Typing games in from Creative Computing etc.

    Backfilled informal programming education with EE and CompE degrees.

    I can spot the potential future programmer among 10 year olds playing. The future programmer is working puzzles requiring thought.

    --
    John McAfee 'It was like that time I hired that Bangkok prostitute; to do my taxes, while I fucked my accountant'
  5. Star Trek by dwywit · · Score: 3, Informative

    I first saw code on an Apple II - the Star Trek game.

    I read an introduction to programming, and proceeded to modify the Star Trek game to not decrement the photon torpedo count whenever I fired one - ditto energy levels for shields and phasers. After a while I wrote a bouncing ball game, similar to pong.

    Some time after I left school I found myself as the sysop for an IBM System/36, and I would play around with the application software source code to see how it worked - not the actual source code, of course - I made a copy to play with. The IBM programmer's and reference manuals are quite comprehensive and from there I was able to take on the source code maintenance and development roles. It was mostly RPGII, with a little bit of BASIC. Then we moved to an AS400, RPGIII, RPG400, and SQL.

    --
    They sentenced me to twenty years of boredom
  6. Coding, or programming? by Todd+Knarr · · Score: 5, Insightful

    I learned to code first in classes in high school (BASIC, FORTRAN, COBOL, Pascal) and then by reading the relevant books or documentation (C, C++, Lisp, Icon, Java, C#, Perl, Python, Ruby, PHP, Javascript et. al.).

    The more interesting question is where developers first learned to program (a completely different skill from coding). IMO we don't need to teach children to code, we need to teach them to program. Which means first teaching them to approach problems logically and analytically, which is going to cause the loss of about 75% (my guesstimate) of the educational establishment when they can't deal with students who know how to analyze material, do independent research and call teachers on incorrect classroom material.

  7. hungry by ebonum · · Score: 3, Informative

    In the 1990's if you were a fresh grad with 80K in student and credit card debt, USD200 to your name and not a soul on earth to help you, coding for 30K a year was a way to put food into your stomach. The offer looked even better with no gas money to get to the next interview. Doesn't matter if you've never written any code. Any fool with a solid IQ and a fire under his ass should be able to get good at coding pretty quick ( finding out about Scott Meyers, Erich Gamma, Fowler, Aho, et. al. early on helped. Need to buy all those guys a beer one day. They saved my ass. )

  8. How I learn't to code: by TechyImmigrant · · Score: 3, Informative

    Books!

    First: The Apple ][ Basic Manual.
    Second: Rodney Zaks, Programming the 6502
    Third: Jeffrey Stanton, Apple Graphics and Arcade Game Design

    38 years later my bookshelves are heaving.

    --
    I should use this sig to advertise my book ISBN-13 : 978-1501515132.
  9. Apple IIe + VIC 20 by PmanAce · · Score: 2

    Like another poster, self-taught BASIC on an Apple IIe and BASIC on a VIC20 saving on tape.

    --
    Tired of my customary (Score:1)
  10. Curiosity by pontoffel · · Score: 2

    One day when I was 10 or 11, I was super bored and aimlessly looking through all of the folders on my computer when suddenly, I wondered how the files on it were made. After some research, I went down to the book store with my dad and ended up getting a copy of C++ for Dummies, which I worked halfway through before just doing whatever I wanted.

  11. On an ALWAC IIIE by FredK · · Score: 5, Interesting

    Computer class in school, spring of 1959. Coded in Hex, 512 bytes of memory (recirculating drum), 32K mass storage that was so big one didn't know what to do with it. Solved differential equations, linear systems with rational coefficients, and computed root locus diagrams. When somebody came along to add an assembler I didn't see the point, as it wouldn't even let you use instructions as data, and made it more difficult to plan jumps to account for the rotation of the drum. If you used floating point you lost 128 bytes of the memory. It was a very different world.

    1. Re:On an ALWAC IIIE by Guy+Harris · · Score: 4, Informative

      For those curious about the machine, here's the manual.

  12. Learned mostly on the job. by jcr · · Score: 2

    Got started in sixth grade by typing in BASIC games from David Ahl's book, taught myself Pascal, Fortran, and FORTH from books, taught myself 6502 assembly from Adam Osborne's books, got a job writing in TAL (Tandem's proprietary language, very similar to Pascal), then got a different job working in C, where I had the good fortune to be in an office between two expert C programmers (one of whom later sat on the ANSI committee that standardized the language). Got better at it by working with the smartest people I could find.

    -jcr

    --
    The only title of honor that a tyrant can grant is "Enemy of the State."
  13. Programming, not coding by GreatDrok · · Score: 5, Interesting

    i learnt to program at school from a Ph.D computer scientist. We never even had computers in the class. We learnt to break the problem down into sections using flowcharts or pseudo-code and then we would translate that program into whatever coding language we were using. I still do this usually in my notebook where I figure out all the things I need to do and then write the skeleton of the code using a series of comments for what each section of my program and then I fill in the code for each section. It is a combination of top down and bottom up programming, writing routines that can be independently tested and validated.

    --
    "I have the attention span of a strobe lit goldfish, please get to the point quickly!"
  14. By Example by jfmiller · · Score: 3, Interesting

    The TRS-80 booted to a basic prompt if there was no cartridge inserted. My dad got a book with a few hundred programs printed out, and one of use entered them in by hand and ran them. Then I would make changes to the code to make it do other things as well. I learn mostly by trial and error. When we got an Apple ][ clone I got a copy of "1001 things to do with your Apple II" and I was off to the races.

    I finally took some formal classes in college, but spent most of my time lamenting the need to listen to things I had already learned.

    The thing is, I had this opportunity because my parents had the resources to get the computers, and I was encouraged by teachers and friend to continue to learn. It is pretty clear that the best programmers all started by forth grade, not high school or college. If only rich white kids can start that early and boy are more likely then girls to take up computers as a hobby the current demographic deficiencies in the industry are likely to continue.

    --
    Strive to make your client happy, not necessarly give them what they ask for
  15. Commodore VIC-20 by JBMcB · · Score: 3, Interesting

    I was interested in computers since I was around 7. My first computer was a V-Tech "Learning Computer" which barely did anything, but I played with it all the time. My dad bought a used VIC-20 from a friend, and I sat with this book and tape until I could program Basic:

    https://archive.org/details/VI...

    --
    My Other Computer Is A Data General Nova III.
  16. Learned Python by doing by oakgrove · · Score: 2

    I started on page one of the O'Reilly book Learning Python and, get this, wrote a flash card program that quizzed me on Python. The further along I got in the book, the better the program got. Had to start over three or four times to clean up the spaghetti but by the time it was all over I had a pretty good handle on what I was doing.

    --
    The soylentnews experiment has been a dismal failure.
  17. Programming by TheRecklessWanderer · · Score: 2

    I started when I was 15 years old (that would be 1992) on a Commodore 64. I wanted to write a program that would generate character sheets for me in Dungeons and Dragons and print it out. Then my Dad asked me to write a program for currency exchange. I think he even used it once or twice. LOL. I guess today I would be working on Java or Raspberry Pi projects. Learning was much harder then because there was no internet but the programming (BASIC) was much less complicated,

    --
    Mean what you say...say what you mean.
  18. College Sorta Kinda by Zobeid · · Score: 2

    In college they didn't teach any courses in the hip new language that I wanted to learn, so I took a course in Pascal and taught myself "C" in parallel with that.

    I liked C a lot better.

    I *also* learned an immense amount during the same time period by picking apart an open source game, modifying it, expanding it, learning everything about how it worked. I'd say the majority of what I ended up actually learning was self-taught.

    However. . . Looking back, I'd already been dabbling with trying to learn BASIC and other such stuff for a few years by that time, and my progress had been VERY SLOW. I'm sure my self-teaching/dabbling progress would have been way faster if I'd had access to the amazing online resources that now exist.

  19. pretty standard by Gravis+Zero · · Score: 5, Funny

    I was on a school field trip, wandered away from the group and was bitten by a radioactive programmer. Pretty standard stuff.

    --
    Anons need not reply. Questions end with a question mark.
  20. 1st programming. self taught basic in 1976 by chromaexcursion · · Score: 3, Interesting

    Using a teletype on the school district mainframe, with an acoustic modem. There was no such thing as a personal computer at that time.
    I taught myself basic.
    Pascal was the language taught in college.
    Since then I've taught myself C, C++, Java, Python, Javascript, ...

  21. Re:Really? by Giant+Electronic+Bra · · Score: 3, Interesting

    Myself and most of my friends pretty much taught ourselves to code.

    Actually I can't even say that I learned at any one specific point in time. When I was a kid (this was back LONG before anything like a PC, or even DEC mini-computers) I'd go work with my father on the weekends. Before that he taught me electronics, but then at work he'd have me enter his FORTRAN programs on punch cards for him. I must have been 6, so that was the start. Then I remember playing with a PDP-11C a few years later, typing BASIC statements on the TTY and watching it print out answers to simple statements. Years later, around 1980 my uncle gave us a PACE based computer typesetter, and we played with that, read the assembly language book, burned some instructions into ROMS, etc (I think the thing basically ran CP/M, but it had no command interpreter at all). It was right after that when Commodore started pumping out affordable machines, VIC-20 I recall particularly as the first machine I really wrote serious software on (I recall coding a version of Moonlander for that).

    I did eventually take some programming classes in college, FORTRAN, Pascal, Assembly language, etc.

    Frankly I think this whole "teaching kids to code" thing is overblown. Its fine to expose kids to something like this, and maybe see if a few of them take to it. Imagining that it will do much for the rest or burning a lot of resources on it seems foolish though. Teach them to think and solve problems, they'll figure out the tools.

    --
    "Malo periculosam, libertatem quam quietam servitutem." -- Jefferson
  22. paper tape by BenBoy · · Score: 2

    In the mid 74, in first year algebra, we had a week-long unit in programming using BASIC. The computer was ... somewhere. Our access to it was via a paper terminal with a tape reader, phone coupled modem, you know the drill. I fell in love. Spent any lunches and free periods I could get my hands on writing my very first program (a grand units conversion program) with a basic manual at my side. Can't say I learned in any systematic way; and I'm sure I learned some awful habits that took some time to unlearn, but oh it was magic. Punched cards just weren't the same in '78 :-)

  23. My Brother Taught Me TI 99/4A BASIC by lefticus · · Score: 2

    In ~2nd grade my brother exposed me to programming with doing simple character animations in TI 99/4A BASIC.

    I actually just two weeks ago recreated that experience for the first time in 21 years and posted it to YouTube: https://www.youtube.com/watch?...

  24. Way back by Dunbal · · Score: 2

    When the world was young and the dead sea was only sick, it was easy to Ctrl-C or Ctrl-Break your way out of games that were written in BASIC/BASICA and just do a LIST of the game's code since games usually shipped in code not in binaries. It was a heck of a learning experience - all those mysterious peeks and pokes made you want to learn more.

    After that it's just a case of getting your hands on a copy of MASM, Turbo C or Turbo Pascal and away you go...

    --
    Seven puppies were harmed during the making of this post.
  25. Re:What qualifies as coding? by Dunbal · · Score: 2, Insightful

    Gee do Word and Excel Macros count? How about doing Maya animation?

    Coding usually refers to programming a computer, not just using an app to get a computer to do stuff but writing the app.

    --
    Seven puppies were harmed during the making of this post.
  26. I don't code by myowntrueself · · Score: 3, Informative

    I hate programming/coding. Trying to think how to write a program makes me feel disoriented and nauseous.

    In the various 'autism' tests I've done I've come out as massively 'heteronormative', this may be connected.

    And I certainly wouldn't want to force my kid to learn to code, especially not as young as 4th grade. I'd find that almost as disturbing as forcing him to do religious studies or gender studies.

    Don't make coding compulsory, it suits a particular kind of mind. First let the mind develop, find what it likes to think about, then get the kid to learn into those areas.

    --
    In the free world the media isn't government run; the government is media run.
    1. Re:I don't code by EnsilZah · · Score: 2

      So how is programming different from any other subject a child learns at school?
      Or do you believe that a child should have had prior experience with writing or math or sports before they choose to have it taught to them at school?

  27. Re:All of the shitty code out there. by NicknameUnavailable · · Score: 2

    Clearly either "troll" or "idiot." There is no form of argument lower than insulting the level of formal training. People work together to do things they are incapable of doing alone, anyone that is self-taught is inherently going to be better than anyone that was formally-educated in a 1-on-1 basis. If you believe modern universities exist for a reason beyond socialization and building up connections to leech off society like a parasite you are an "idiot" and deserve what is likely crushing student loan debt to go with your haughtiness and arrogance. If you just made the comment to get a response though I'll chalk you down as a rather successful "troll."

  28. Re:Really? by grcumb · · Score: 2

    But a large number of professional programmers didn't learn how to code in a formal school program, either because they're self-taught or because they learned on the job. Citation please.

    In the early days, many people didn't have anyone to learn from. If you weren't enrolled in a University computer science programme, you probably had close to zero access to formal instruction.

    For my part, a colleague of mine came by my desk, saw me struggling to handle a conditional with a macro, and showed me how to create a control structure in Visual Basic. Spent a few months playing and reading MS' Knowledge Base in text mode through a 9600 baud connection. Then I found Kernihan and Ritchie little book, and suddenly it all made sense.

    Fast forward 6 years to the late '90s, and I was writing systems software for NOC services. The dot com boom happened, and Bob, as they say, was my uncle.

    --
    Crumb's Corollary: Never bring a knife to a bun fight.
  29. Re: All of the shitty code out there. by Darinbob · · Score: 2

    Ha, creative mispelling. I ran into this once. I was working with code that was using a "saclingFactor" all over the place. This was in many files, across many directories. I didn't know what this was so I tried to leave this alone as much as I could, I assumed it was some sort of medical term given that this was a medical machine. Turns out it was just a typo, and should have been "scalingFactor"! But it got copied because either the programmer was too lazy to fix it, or there was some autocompletion in the programmer's editor that kept copying it. Once I figured it out then things made more sense, and instead of mysterious code with a strange set of calculations that didn't make sense it turned out to be somewhat normal code with a bug.

  30. I learned how to code inside a Chinatown kitchen by Taco+Cowboy · · Score: 2

    ... But a large number of professional programmers didn't learn how to code in a formal school program, either because they're self-taught or because they learned on the job ...

    ... Citation please ...

    I can only represent myself, for I ain't 'a large number of professional programmers'

    But anyway ... after I've landed on the American soil as a refugee back in the 1970's the first thing I did was to get a job inside a chinatown restaurant because I didn't have any money

    The work in the kitchen was from morning to late night, no shift, but at times we got couple of 'low tide' hours where we get to take some quick nap

    As I was not familiar with English (I had spent some time in Hongkong before coming to the States, and had picked up really basic English comprehension there) I couldn't understand most of the publications available at that time (except for the trashy Mandarin newspapers/magazines that they were selling in Chinatown) but I wanted to learn more

    On off days I went downtown to some gadget joints, those selling electronic parts, resistors and such, often on 'looksee tour' to get a glimpse of what were there, and over there I picked up some old magazines for cheap

    I couldn't understand 90% of the articles on those magazines but I do understand math --- and it were the math / code tease articles that grabbed my attention and I had to carry out all the 'coding' inside my head (CP/M had just been released but I ain't got the money to buy the mainframe to run that thing)

    Thanks to that computer-less period I honed my ability to 'code in between the ears' and even today before I typed in the first character I already have a 'program' in between my ears wanting to come out

    --
    Muchas Gracias, Señor Edward Snowden !
  31. ZX Spectrum, C=64 and lots of books by Flu · · Score: 2

    Before I got myself a computer, I spent a lot of time with my friends', typing in programs from computer magazines. I read a lot of books on computers and programming, and tried to understand their example programs.

    Learned assembler on the ZX Spectrum, got fluent in Basic on the C=, learned Modula 2 on Amiga and finally C on Amiga and some Sun workstations. I did take some classes on Pascal programming in high-school, and in the Uni, we were taught Java and C++, but I consider myself self-taught.

  32. Re: All of the shitty code out there. by gmack · · Score: 3, Insightful

    I can tell your code quality by your arrogant post that just assumes people who don't understand your code aren't trained enough.

    Everyone knows that debugging is twice as hard as writing a program in the first place.

    So if you're as clever as you can be when you write it, how will you ever debug it?

    --- Brian Kernigan, "The Elements of Programming Style", 2nd edition, chapter 2

    I had this quote framed and put on the wall at the last place I worked were btw, some new guy wanted to tear up perfectly working C and replace it with SCALA so it would be more "modern" and tried to go over my head to do it.. At the job before that, I had to sit there for a week as a possible client went through my code and then decided it looked easy enough that they could re implement it themselves (turns out, no they couldn't)

    "Messy" is not about not writing complicated code messy is about being complicated when you don't have to be and not properly abstracting the complicated parts and not commenting the worst parts. Messy is about over depending on order of operations instead of using brackets to make things more clear (to top this off, many compilers screw up order of operations so the code may not be doing what you think). Messy is about doing the same complicated thing 5 times instead of making a function (or even a macro) to do the work. Messy is about not knowing when to split a function into a separate one rather than adding new parameters to the existing function to make it handle more cases.

    Don't even get me started on programmers who think cleaning up compile warnings is a waste of time or who split databases for speed reasons (hint: if you are always joining the same 3 tables in every query it's not faster any more)