Slashdot Mirror


Ask Slashdot: How To Get Started With Programming? [2017 Edition]

Reader joshtops writes: I know this is a question that must have been asked -- and answered -- on Slashdot several times, but I am hoping to listen from the community again (fresh perspective, if you will). I'm in my 20s, and have a day job that doesn't require any programming skills. But I want to learn it nonetheless. I have done some research but people have varied opinions. Essentially my question is: What is perhaps the best way to learn programming for my use case? I am looking for best possible resources -- perhaps tutorials on the internet, the right books and the order in which I should read/watch them. Some people have advised me to start with C language, but I was wondering if I could kickstart things with other languages such as perhaps Apple's Swift as well?

22 of 312 comments (clear)

  1. Coffee by Oswald+McWeany · · Score: 5, Funny

    How to get started in programing. Well, I get started each morning by starting the kettle. Whilst the kettle boils, I wash out the French Press and my mug. I drink my coffee whilst reading Slashdot to see if there is anything I should be kept up-to-date on. By the time I finish it is time for another cup of coffee, so the process begins again, by that time, I have to reply to some troll who thinks climate change is a myth and that man never went to the moon.

    I usually have three or four cups of coffee- and then it is time for lunch.

    After lunch, I find myself able to start programming.

    --
    "That's the way to do it" - Punch
    1. Re:Coffee by Oswald+McWeany · · Score: 4, Funny

      Same for me, except that I reply to trolls, that believe that Climate change is caused by humanity, instead of by cosmic causes; and that Trump didn't win the election. ;)

      You've done it now... I'm brewing another cup of coffee... Just you wait.

      --
      "That's the way to do it" - Punch
    2. Re:Coffee by Oswald+McWeany · · Score: 3, Interesting

      Same Here in Rio de Janeiro!

      Are we programmers all procrastinators?

      I can't remember where I read it, but I read that the same qualities that make many people procrastinate are the same qualities that make people better programmers. People that don't rush into things and pause and mull over "what is the best way to do this" end up being better programmers.

      Despite my morning ritual, and constantly getting side-tracked, I've always been one of the more productive people everywhere I've worked.

      --
      "That's the way to do it" - Punch
    3. Re:Coffee by unrtst · · Score: 4, Informative

      I suspect you're referring to Larry Wall's three great virtues of a programmer: Laziness, Impatience and Hubris
      http://threevirtues.com/

  2. How to do anything in 2017 by Anonymous Coward · · Score: 3, Informative

    Get a PC computer. Install Ubuntu. Connect to Internet. Google free tutorial. Start programming.

    1. Re:How to do anything in 2017 by lgw · · Score: 5, Informative

      Get a PC computer. Install Ubuntu. Connect to Internet. Google free tutorial. Start programming.

      AC is not wrong.

      First, learn simple scripting. Use Python - it teaches better habits than a lot of alternatives. When you're comfortable with the basics of ordering your thoughts in a formal language, there are 3 real challenges, and I'd take them in this order.
      1. Pointers
      2. Recursion
      3. Threading

      C is great after you're comfortable with the basics. Pickup the K&R C book and have some fun with it. Implement all the basic data structures using C. Learn to use a nice GUI debugger, and step through your code, then step through the object. Learn what's really happening under the covers. Keep going until there's no mystery about pointers and the stack, registers, and so on.

      For recursion, learn Scheme. Yeah, you could use Python too, and maybe there are some good intro texts now (what does MIT use these days instead of SICP?), but Scheme forces you to do everything with recursion. Keep going until it's totally natural. Write a Scheme interpreter in Scheme (it's easier that you think, and a lot of fun).

      There's no easy path to learning threading, I fear, but if you made it past the above two, you'll manage this.

      Once all that is done, then learn Java. Java sucks, but it's where most the jobs are. Everything in Java should seem quite easy once you have the fundamentals.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    2. Re:How to do anything in 2017 by Anonymous Coward · · Score: 4, Informative

      I've seen that stated the other way around.

      If you're trying to make your learning investment pay off quickly I'd go: (1) JavaScript, (2) Java, (3) C/C++
      These can break you into web development, mobile development, infrastructure development, legacy and high-performance code.

      If you're looking more at ease of learning I'd go: (1) C# on Visual Studio, (2) Java on Eclipse, (3) C/C++ on Visual Studio
      These can get a cool app running quickly without much stress and also sets you up for Unity game development if you have C#. You'll generally have more fun this way around.

      The problem with C/C++ is memory allocation, pointers, types and type aliasing - they're a bit tricky to pin down without knowing about memory and memory layouts and v-tables and such.

      C# and Swift are excellent languages to try ideas without committing to any painful pointer arithmetic and memory management. Sure, what you write won't run quite as fast as you can get in C/C++ but it's more than adequate for anything barring the highest of the high-performance scientific computing. I'd recommend C# on Microsoft Visual Studio Community Edition 2015 which also gives you exposure to a world-class development environment and tools, and that's something that can go straight on a resume if you get used to using it. Visual Studio also allows you to get around in a debugger and see what's actually happening when you start coding something bigger than a few thousand lines. You're going to get some rolling-eyes and people suggesting "real men use Vim" on Linux but that's something you should save until later or if you already have well developed Linux hacking skills. Most people code on Vim or Emacs because they secretly hate themselves.

      Java is also fairly easy to work with and doesn't have the memory management junk to deal with, but it has a longer legacy and it's more verbose in places. It's just as capable as C# and Swift but with the advantage of being deployed just about everywhere (e.g. browsers, Android, even some embedded systems). Learning Java is excellent bang-for-buck if you want to develop marketable skills quickly and it gets used just about everywhere. My main complaint with it is just that it's so damn big - it's got a massive surface area and there's a lot to learn. You can try using Eclipse to develop for Java but I personally find it a bit encumbered and bloated. It's powerful though and also a good thing to put on a resume.

      I'd learn C/C++ once you have a decent grasp of how to get code up and running in one of the above. It's the most marketable skill if you want to work in the guts of things and there isn't a program in existence that doesn't contain at least some C code. From here you can also study high-performance code for scientific work and HPC. C/C++ is also the gateway to GPU compute and a whole manner of weird and wonderful tricks that can pay back big time if applied correctly. Be prepared to sink a lot of time into this - it won't pay back $$$s as quickly as Java would but you'll get a much deeper understanding of what's going on inside your CPU.

      Python is also a superb language to have under your belt. It rarely gets used in production code but it's heavily used in tools and testing and it's a great language to build something quick-and-dirty as you need it. It's also interpreted so you can try REPL style coding and just type lines to see what they do without going through agonizing compile-test processes.

      Don't bother at all with machine code or assembly language until you're feeling confident with C++ and you have some time to kill. It's fun to look at if you really, REALLY want to know what the CPU is doing and you can get a good grasp for the compilers and execution model by studying disassembly. This is a huge time-sink though and rarely ever relevant unless you're looking at incredibly tricky compiler bugs or the highest performance hand-tuned code.

      More importantly, pick something that's fun to implement and will give you some satisfaction as you go. Writing some

  3. Several answers by Anonymous Coward · · Score: 3, Interesting

    First I must wonder what your existing background is with respect to computing. Depending on this I would have different answers. If you have never programmed so much as an Excel spreadsheet or "Hello, world!" in BASIC, I would then ask what is your objective? The language you want to learn will be dictated by this more than anything, as there exist "total beginner" tutorials for any language imaginable and they're all pretty easy (and don't apply to any real problem solving beyond that).

    If you are interested in programming for its own sake, I would recommend something like The Structure and Interpretation of Computer Programs by Abelson and Sussman (https://mitpress.mit.edu/sicp/full-text/book/book.html). For something that covers a lot of bases top-to-bottom very quickly, the book Thinking In Java by Eckel can be very informative (even if you never make it more than 1/3 of the way through it). If you like the logical and linguistic side of things, you may be interested in ANSI Common Lisp by Graham.

    I would only recommend starting in C if you have a significant breadth of computer knowledge but want to understand more of how things work "under the hood". Be warned, this journey is not trivial.

  4. Find a way to make it relevant by chispito · · Score: 4, Insightful

    Find something routine or complicated that you do and automate it. Maybe your job involves TPS reports. Well, automate adding the coversheet. Maybe you like gaming. Look into modding.

    Or you could go to school where you have deadlines and lab classes. Whatever the case, avoid trying to learn a bunch of theory in a vacuum.

    --
    The Daddy casts sleep on the Baby. The Baby resists!
  5. Find a problem to solve. by Anonymous Coward · · Score: 4, Insightful

    ...then solve it using a program.

    If your day-job is doing stuff with Excel, then perhaps automate something. Write a script to extract stuff out of a .csv file, etc. If your job is non-tech, then perhaps use your tech skills to build on hobbies.... e.g. if you're into video games, build a tiny game in JavaScript... if you're into sci-fi books, write a program that finds stuff in text of sci-fi books, if you're into finance, write a program to find correlations between closing prices of various companies, or extract anything useful out of earning reports---automation is the key. Find something you're interested in, then automate it (or a part-of-it), etc.

    Note that language/platform doesn't matter much. Yes, you can do complicated ``programming'' in Excel. It's just not something most people do, but that's what you're into, then go for it.

    Started languages I'd suggest: JavaScript (mostly because you can get started quickly, show off your work quickly, and go from nothing to something fun quickly). As second language, learn SQL... yes, you can do wonderful analysis in SQL. Then I'd suggest PHP... and/or Perl (yah, lots of folks would object, but if you learn Perl, you'll never have to learn another "useful" language ever again), then learn C/C++, since you don't start appreciating the ease-of-use nor overhead of other languages until you learn C/C++.

  6. Re:Tradition by Oswald+McWeany · · Score: 3, Insightful

    Although I started with BASIC myself, I wouldn't consider it an ideal starting place for people today.

    For one, no one uses it. Even most die-hard Visual Basic programmers use C# instead nowadays. BASIC is too dissimilar from most other languages to be a good starting one anyway.

    I'd start with Java or C#. Both easy to use, both use fairly common skills that will translate to other languages easily. Both are employable languages. If you don't mind being Microsoft's biatch C# has the nicer IDE to get developing against- but you're pretty much guaranteed to be doing purely windows based stuff. Java gives you the opportunity to work on anything.

    --
    "That's the way to do it" - Punch
  7. Re:Tradition by TWX · · Score: 4, Interesting

    At this point I would skip on BASIC simply because there are so many fewer real-world applications for it. I would start with a conventional shell scripting language. On a Windows box that would be batch files, on a Linux box, probably bash. Both have direct applications in addition to being functional for rudimentary understanding of programming.

    In my own case I grew up with a computer with MS-DOS 3.3 and GW Basic 3.22, and I spent a lot more time in MS-DOS batch files than I ever spent in Basic. Granted, my application for them in setting variables and then launching programs doesn't apply a whole lot these days, but some file processing can be handled with it.

    I am not going to express an opinion about Power Shell from Microsoft because I have no experience with it other than coworkers raving how great some new feature to them is, when we've had that feature in bash for almost 30 years, so my judgement is admittedly tainted for the negative.

    --
    Do not look into laser with remaining eye.
  8. poignant.guide or machine code by jtara · · Score: 3, Insightful

    Why's Poignant Guide to Ruby

    ... even though it was written for a now-obsolete version of Ruby.

    Why? Because it is entertaining enough to get you through many important basic concepts without falling asleep.

    Otherwise, I recommend the approach that was common at one time and fallen out of favor. Start with machine language. Not even assembly code. Machine language. Best thing ever: punching IBM 1620 (decimal, thank goodness!) instructions one at a time on punch cards! That was high school. In college, we started with MIX. I prefer a real machine code to a made-up assembly code, though.

    Still, some in high school thought "the compiler" was some bit of hardware in the computer, once we moved-on to Fortran. At least the instructor tried!

    If you don't begin at the beginning, many will be forever-befuddled at what really goes on.

  9. Python by kaur · · Score: 4, Interesting

    My language of choice would be Python.
    Dead easy, powerful, interactive, fun.

    1) Get some kids' coding books (on paper) and read through them to get the basics.
    2) Get python - the plain IDLE from python.org will do, no need for pycharm or other fancy environments.
    3) Code some simple stuff to get the basics. Try out graphics (tkinter if in python) - you will get immediate rewards by nice visuals. Bounce balls around the screen, draw gradients or simple animations.
    4) Connect coding with your hobby or work and figure out a more serious project to go deeper into the language with a real goal.

  10. It's personal by hmblcodr · · Score: 3, Insightful

    I wrote a couple of blog posts just over a year ago that I think are still relevant:

    * Getting started with programming
    * Getting better at programming

    But it's a really personal thing. Some people hate reading through books, others couldn't do without them. Try as much as you can until you find something that really peaks your interest, that you can't put down, and follow it to see where it goes. Good luck!

  11. If you have an iPad, go through Playgrounds App by SuperKendall · · Score: 4, Insightful

    All iPads with iOS10 either come with, or can have installed for free the Playgrounds app into which you can install playgrounds that teach programming.

    It sounds silly and at first it may seem like it as you play through a programming a kind of game figure. But the lessons get more and more advanced, and along the way you are learning Swift.

    As you can far enough along you can decide if you like programming enough to really get serious, then perhaps investigate stuff like the Stanford programming course videos (free), including a course just on iOS development... but you don't have to go that way, the concepts you learn learning Swift apply to most languages pretty well.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
  12. maybe try Exercism? by tnordloh · · Score: 3, Informative

    exercism.io is a good starting point. The site has a lot of languages to choose from, and it presents you with a bunch of exercises you can complete for each language. Once you complete an exercise and submit it, you can visit the site, and see your code there. You can also see how others solved the same problem, and comment on their solutions, as well as read comments from other people.

    --
    Always remember the chickens that have gone before
  13. OK, here's what you need to know by squiggleslash · · Score: 3, Funny

    Last year, I'd have told you avoid languages like Ruby, Python, etc, and work on the latest greatest: node.js, Swift, and, of course, Java. However, it's a year later, so don't learn any of that rubbish, you need to learn iLng, Visiwo, G, and, of course, Java.

    As long as you have a good grounding in those languages, many of which are so new they literally don't exist yet, you should be fine for the next three to four months.

    --
    You are not alone. This is not normal. None of this is normal.
  14. C is the right place to start. by lq_x_pl · · Score: 3, Interesting

    Start with C. Learn how to compile / link without the help of an IDE. Two birds with one stone here, you'll learn important concepts about how resources are used, and you'll avoid being vendorlocked into a single IDE.

    --
    An internal system operation returned the error "The operation completed successfully.".
  15. 1st learn propper soldering technique by Crashmarik · · Score: 4, Funny

    Then get a good copy of the 7400 line data sheets.

  16. Like everything else start with the basics by evolutionary · · Score: 3, Insightful

    I feel your confusion. This may be "old school" but I feel it's solid (or has been for me). Start with learning the basic rules.

    A lot of people like Python but because most languages use certain characters to enclose blocks of code (and python only uses indents) I would suggest starting with Java or C/C++. Many here will say Python is easier (ruby is probably easiest for many), but your goal will be to have room to grow. You'll find more languages conform to the C/C++ or Java syntax style rules than Python or Ruby. I find it easier to ready than Python myself.

    Do yourself a favor and skip VB.net. If you want pure Microsoft (and I would advise against that, would have saved me much grief early in my career) you can do C# and you'll be better prepared for languages with more platforms.

    Java, for example you can use in many enterprise system and embedded systems, including Android. C/C++ you can use for robotic controllers, IPhones (objective-c), real-time critical applications (and gaming!!).

    Some may suggest starting with scripting languages like PHP, Python or Ruby. there is faster "joy", but I'd sooner suggest starting with MIT's Scratch https://scratch.mit.edu/ (GUI language for teaching children basic of programming). It's a great teaching tool for anyone I think. Hey, it's still valid basics which converts the GUI instructs into 'C'. the reason

    I'm so "hung up" on starting with C/C++ or Java is most newer languages take a lot of their cues from the concepts widely used in C/C++/Java. once you learn one of these (especially C++/Java) you can step into any other language out there with relative ease. Some good sites to start would include:

    http://lifehacker.com/five-bes...
    Note: These are all free or have free options

    http://www.learn-c.org/
    http://landofcode.com/programm...
    https://ocw.mit.edu/courses/el...
    https://ocw.mit.edu/courses/el...
    https://www.codecademy.com/lea...
    http://www.coursera.org/ (real university level courses, a little intimidating at first, but worth it)
    http://www.cplusplus.com/doc/t...

    For python:
    https://www.python.org/

    For Ruby:
    https://www.ruby-lang.org/en/

    the courses as udemy are a little light so I'd only go there for review.

    I've given many options here although I've stated my preference. The other advantage to using C/C++ or Java is they make using these invaluable books easier to read:

    Writing Solid Code: Microsoft Techniques for Developing Bug-free C. Programs (Microsoft Programming Series) by Maguire, Steve
    Code Complete by Steve McConnell


    Yes, these books are from MS and old, but I found them invaluable (and I wish MS had actually practice what came from their own publishing companies when writing the code for W2K and XP). Was required reading at one workplace. You'll want to learn about Object-Oriented approaches as well as syntax. It's a lot to take in and this is just the beginning, but it's fun journey. Oh, I would agree, don't bother with Basic. You are better off with Python or Ruby. :D Again, to reduce your learning curve later on, I'd start with C/C++/Java. You'll be glad you did.

    --
    "Imagination is more important than knowledge" - Einstein
  17. It's like asking how to learn a toolbox by Kjella · · Score: 3, Insightful

    I'm in my 20s, and have a day job that doesn't require any programming skills. But I want to learn it nonetheless. I have done some research but people have varied opinions.

    "Learning programming" is a bit like looking at box full of tools, is a hammer or a saw or a screwdriver best for the job? Well the question doesn't really make any sense until you've defined what you want to accomplish. Unless you just want to learn general concepts, in which case it doesn't really matter. Assign values, calculate values, create functions, acquire resources (like open a file), release resources (like closing a file), control flows like if/case statements, for/while loops, events, state etc. exists in pretty much all languages for a reason, the syntactic sugar may be a little different but the concepts are pretty generic.

    --
    Live today, because you never know what tomorrow brings