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?

11 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 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. 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!
  3. 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++.

  4. 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.
  5. 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.

  6. 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
  7. 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.
  8. 1st learn propper soldering technique by Crashmarik · · Score: 4, Funny

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

  9. 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