Author Topic: Learning to Code  (Read 2963 times)

0 Members and 1 Guest are viewing this topic.

Offline The Latinist

  • Cyber Greasemonkey
  • Technical Administrator
  • Reef Tank Owner
  • *****
  • Posts: 8791
Learning to Code
« on: January 17, 2017, 06:40:35 PM »
So I've long wanted to learn the basics of computer programming, and that desire has recently reared its head again.  I'm not looking to become a professional coder, but I'd like to be able to do some front-end development on web projects that have long been floating around my head or to hack together a little program to do a particular small task. Someday I might want to develop a mobile app, but that's not a priority; I want to learn fundamentals right now.

The question becomes this: what language to start with.

If it matters, I'm pretty good with HTML and CSS, I've cobbled together some effective bash scripts, tweaked a few PHP scripts, and I have minimal experience with SQL mainly from working on this site.

So, where to start?  JavaScript, Ruby, Python, PHP, C, something else entirely? I'm open to any suggestion.

ETA: I also have in the back of my mind that I might like to prepare myself to someday teach a high-school level computer science course.  Would that lead to a different recommendation?
« Last Edit: January 17, 2017, 07:08:18 PM by The Latinist »
I would like to propose...that...it is undesirable to believe in a proposition when there is no ground whatever for supposing it true. — Bertrand Russell

Offline Pusher Robot

  • Frequent Poster
  • ******
  • Posts: 2197
  • Do you have stairs in your house?
Re: Learning to Code
« Reply #1 on: January 17, 2017, 06:41:38 PM »
From your criteria, javascript.
A novice was trying to fix a broken Lisp machine by turning the power off and on.
Knight, seeing what the student was doing, spoke sternly: “You cannot fix a machine by just power-cycling it with no understanding of what is going wrong.”
Knight turned the machine off and on.
The machine worked.

Offline The Latinist

  • Cyber Greasemonkey
  • Technical Administrator
  • Reef Tank Owner
  • *****
  • Posts: 8791
Re: Learning to Code
« Reply #2 on: January 17, 2017, 06:44:15 PM »
From your criteria, javascript.

Will JavaScript teach me good practices that can later be transferred to other languages?
I would like to propose...that...it is undesirable to believe in a proposition when there is no ground whatever for supposing it true. — Bertrand Russell

Offline Pusher Robot

  • Frequent Poster
  • ******
  • Posts: 2197
  • Do you have stairs in your house?
Re: Learning to Code
« Reply #3 on: January 17, 2017, 06:52:48 PM »
From your criteria, javascript.

Will JavaScript teach me good practices that can later be transferred to other languages?

It permits it but does not enforce it.  For a less freewheeling, more orderly version, consider Typescript.
A novice was trying to fix a broken Lisp machine by turning the power off and on.
Knight, seeing what the student was doing, spoke sternly: “You cannot fix a machine by just power-cycling it with no understanding of what is going wrong.”
Knight turned the machine off and on.
The machine worked.

Offline superdave

  • Stopped Going Outside
  • *******
  • Posts: 4640
  • My name is not dave.
Re: Learning to Code
« Reply #4 on: January 17, 2017, 07:02:31 PM »
I am about to teach a computer science course.  I'm going to be using http://greenteapress.com/wp/think-python-2e/
IT's a very clear and concisely written book.

But if you are more about learning general concepts, there are a number of very interesting online tutorials that use a drag and drop interface.  the idea is that they take care of the syntax and typing so you can focus on the programming concepts.  They might be worth looking into

Some of those include MIT scratch or codester.  For mobile apps, there is MIT app inventor, which lets you very easily code android apps with a drag and drop interface.


Offline The Latinist

  • Cyber Greasemonkey
  • Technical Administrator
  • Reef Tank Owner
  • *****
  • Posts: 8791
Re: Learning to Code
« Reply #5 on: January 17, 2017, 07:10:25 PM »
I am about to teach a computer science course.  I'm going to be using http://greenteapress.com/wp/think-python-2e/
IT's a very clear and concisely written book.

Hmm.  That brings up something that's been at the back of my mind for a while, now, that I hadn't mentioned in the OP.  I'd had the thought in the back of my mind that I might someday want to teach a computer science course.  A bit of job security for the dead language teacher, you know?

Would that change people's recommendations on where to start?
I would like to propose...that...it is undesirable to believe in a proposition when there is no ground whatever for supposing it true. — Bertrand Russell

Offline superdave

  • Stopped Going Outside
  • *******
  • Posts: 4640
  • My name is not dave.
Re: Learning to Code
« Reply #6 on: January 17, 2017, 07:14:43 PM »
I am about to teach a computer science course.  I'm going to be using http://greenteapress.com/wp/think-python-2e/
IT's a very clear and concisely written book.

Hmm.  That brings up something that's been at the back of my mind for a while, now, that I hadn't mentioned in the OP.  I'd had the thought in the back of my mind that I might someday want to teach a computer science course.  A bit of job security for the dead language teacher, you know?

Would that change people's recommendations on where to start?

The AP computer science course is taught using java.  personally I think they are all pretty similar.

Offline Johnny Slick

  • "Goddammit, Slick."
  • Poster of Extraordinary Magnitude
  • **********
  • Posts: 11716
  • Fake Ass Skeptic
Re: Learning to Code
« Reply #7 on: January 17, 2017, 07:34:44 PM »
I would *not* start out with JavaScript. Yes, it's close to what you're already doing - you already probably have a decent understanding of the DOM, for example, and many elements of jQuery use the same syntax that CSS uses. That being said, it's a kind of a half-assed language that hasn't had really major changes in 15 years (can't really, since people go sideways when even older browsers aren't compatible with some piece of JS) and as a result few people actually code in "just" JS. I, for example, am using Angular and Breeze a lot at my current gig as well as a bunch of smaller bits of help like Moment.js.

I would instead recommend either Python or C#. The advantage of Python is that it's considered to be easier to pick up than other languages and I've read Python enthusiasts say that they can flat-out churn out more lines of Python code in X amount of time than they can any other language. The fact that it uses whitespace in lieu of punctuation (brackets, etc.) also makes it easier to read for the most part. The main advantage of learning C# is that it's a. very similar to Java, and the vast majority of people who write server side code nowadays write in one of those two languages (which, even if you're not looking to do this professionally that means that when you inevitably get stuck on something there will be a *far* greater chance that someone else has gotten stuck on a similar thing), and b. you get to use Visual Studio with it, which is the best IDE out there, period. There's a free version called VS Community that comes with essentially all of the bells and whistles you will need. Or if you want to learn how to program games, Unity is out there and uses C# and JavaScript both (I would still recommend C# for reasons I could get into if you're interested).

I will say that object-oriented and procedural languages are often not all that different. C# and Java both owe a lot to C, as does JavaScript. Python is not dissimilar to either except that it's easier to read and learn. The point is, once you learn one of them, there's no reason why you can't transition to another down the line or for that matter use them concurrently. Right now for instance I'm writing about 99% of my code in JS but I did have a project a couple months ago that required me to do something on the server, which meant going back to my old friend C#. If you write, say, a game, you might find yourself coding the graphics in C, writing a lot of the stuff that isn't quite graphical but needs to run pretty quickly in C#, and writing, say, AI scripts in Ruby or Python. Wearing lots of hats is the name of the game when it comes to programming.
Speak what you think now in hard words, and to-morrow speak what to-morrow thinks in hard words again, though it contradict every thing you said to-day.

- Ralph Waldo Emerson

Offline Pusher Robot

  • Frequent Poster
  • ******
  • Posts: 2197
  • Do you have stairs in your house?
Re: Learning to Code
« Reply #8 on: January 17, 2017, 11:43:47 PM »
Agreed, C# is great and my first choice in most cases, but unless you're doing server-side web development - in ASP.NET - it's not likely to be super relevant in web programming.

I'd say that TypeScript is a great compromise - a lot of the goodness of C# (from the same father no less) but the underlying flexibility and web utility of javascript, and as you noted the tooling (either Visual Studio Community or the multiplatform VS Code) is blissful.
A novice was trying to fix a broken Lisp machine by turning the power off and on.
Knight, seeing what the student was doing, spoke sternly: “You cannot fix a machine by just power-cycling it with no understanding of what is going wrong.”
Knight turned the machine off and on.
The machine worked.

Offline Soldier of FORTRAN

  • Stopped Going Outside
  • *******
  • Posts: 5164
  • Cache rules everything around me.
Re: Learning to Code
« Reply #9 on: January 18, 2017, 01:05:11 AM »
Any recommendations for puzzle/challenge sites?

Project Euler's a hoot.  It's a large number of math problems which require scripting to solve
Every soup ladled to the hungry, every blanket draped over the cold signifies, in the final sense, a theft from my gigantic paycheck.

Offline The Latinist

  • Cyber Greasemonkey
  • Technical Administrator
  • Reef Tank Owner
  • *****
  • Posts: 8791
Re: Learning to Code
« Reply #10 on: January 18, 2017, 11:20:31 AM »
So ultimately it comes down to that I'm going to need to learn javascript and at least one other language for backend and application development.  I feel like maybe I should start with one which enforces better behaviors and then move to Javascript after I've got a handle on concepts.  So now the question is what language to choose for learning my basic programming concepts and developing good habits without getting too frustrated early on.  I'm thinking a higher level language like Python might be good because I don't want to have to deal with memory management.
I would like to propose...that...it is undesirable to believe in a proposition when there is no ground whatever for supposing it true. — Bertrand Russell

Offline Andrew Clunn

  • Poster of Extraordinary Magnitude
  • **********
  • Posts: 14789
  • Aspiring Super Villain
Re: Learning to Code
« Reply #11 on: January 18, 2017, 11:32:08 AM »
If you're after the concepts and skills that will then translate into other language, may I recommend a very simplified instruction set meant specifically for learning coding?

https://cs.mtsu.edu/~untch/karel/

EDIT -

Actually the best version of that is likely the Python one, but it's the same principle, just much easier to get set up with:

http://wiki.laptop.org/go/Guido_van_Robot

EDIT EDIT -
If you decide to go this route, here are the links to all the things you need to download (in the order they should be installed):

https://www.python.org/downloads/
https://sourceforge.net/projects/gvr/files/GvR%20GTK/4.4/GvRng-4.4_win32.exe/download
https://sourceforge.net/projects/gvr/files/GvR%20Lessons/0.5/gvr-lessons-0.5.zip/download
« Last Edit: January 18, 2017, 11:46:16 AM by Andrew Clunn »
You want data?  My pie charts are made with a secret family recipe, my relationship charts stay committed even through tough times, and my line charts will get get high as fuck!

Offline Johnny Slick

  • "Goddammit, Slick."
  • Poster of Extraordinary Magnitude
  • **********
  • Posts: 11716
  • Fake Ass Skeptic
Re: Learning to Code
« Reply #12 on: January 18, 2017, 12:06:03 PM »
So ultimately it comes down to that I'm going to need to learn javascript and at least one other language for backend and application development.  I feel like maybe I should start with one which enforces better behaviors and then move to Javascript after I've got a handle on concepts.  So now the question is what language to choose for learning my basic programming concepts and developing good habits without getting too frustrated early on.  I'm thinking a higher level language like Python might be good because I don't want to have to deal with memory management.
FWIW you don't really have to deal with memory management or garbage collection in Java or C# either. But yeah, I think your basic ideas are solid. JavaScript can seem "easier" because variables are dynamic and you can do a lot of things that other languages just won't let you do. I think that those languages generally have really good reasons for not letting you do that stuff, though, and in the long run you're probably better off learning a language that's more restrictive and then understanding why it is that you should still keep to those principles when you use something "looser" like JS (and for that matter, it'll help you to see why so many people are using stuff like TypeScript now).
Speak what you think now in hard words, and to-morrow speak what to-morrow thinks in hard words again, though it contradict every thing you said to-day.

- Ralph Waldo Emerson

Online PANTS!

  • One leg at a time.
  • Reef Tank Owner
  • *********
  • Posts: 8598
  • What seals? I auditioned for this job.
Re: Learning to Code
« Reply #13 on: January 18, 2017, 01:25:40 PM »
You need to go python.  Especially given your level of understanding of statistics.  I strongly recommend you integrate it with the Visual Studio IDE (Interactive Development Environment) - which is available for free.

https://www.visualstudio.com/

It is widely used in professional environments because it is well suited to enterprise development - especially if you use TFS (but don't go there just yet).  And the debug tools are leaps and bounds better than what python gives you out of the box.  Finally you can integrate other languages for development in this IDE.  So you want to learn C# - go ahead.  Then compile it and call it from your python code if you like - or vice versa.  All within the by now very familiar environment.

Then get the python plug ins here.

https://www.visualstudio.com/vs/python/

« Last Edit: January 18, 2017, 01:33:24 PM by PANTS! »
Now where I come from
We don't let society tell us how it's supposed to be
-Uptown, Prince 👉

We cross our bridges when we come to them and burn them behind us, with nothing to show for our progress except a memory of the smell of smoke, and a presumption that once our eyes watered.

Offline The Latinist

  • Cyber Greasemonkey
  • Technical Administrator
  • Reef Tank Owner
  • *****
  • Posts: 8791
Re: Learning to Code
« Reply #14 on: January 18, 2017, 01:43:51 PM »
I'm definitely leaning toward Python, though I'm still open to more recommendations so please keep them coming.  Then question becomes: Python 2.7 or Python 3.5?  Python 2.7 still seems to have the best library support and it's built into OS X, which is an advantage for me.  But there seems to be a lot to like in 3.5...
I would like to propose...that...it is undesirable to believe in a proposition when there is no ground whatever for supposing it true. — Bertrand Russell

 

personate-rain
personate-rain