Ruby or JavaScript?

81868090

Which Programming Language to choose to learn first?  As I said in this post, I’ve received opposing advice from more knowledgeable peers about which might be easier and why.  I need to figure out which language is easier for me, and start there.

I thought it might be helpful to break down what I know about each so far.  I can not boast feeling very knowledgeable about either, but I have done some pieces of tutorials for both.  So far, it’s not too confusing to do both at the same time.  In fact, it’s helpful!  Both tutorials contain the same vocabulary, for example Math, Strings, and Functions. Those are some of the things that you can write using JavaScript or Ruby.  Learning about those and other basic components of coding in two different languages is actually helping me feel like I can understand them more deeply.  Each tutorial explains them differently, so each new explanation provides a little more depth to my thinking.

I can’t yet say which I think will be easier to continue with, but I can simply say that I’m understanding more, making coding in general feel easier.

Here’s a snapshot of some differences, thanks to resources from Github, Codecademy, and TryRuby.org.


Math is probably the most basic thing you can do with programming, so possibly the easiest to understand for complete beginners or non-code types:

Ruby                                                                                              JavaScript

Screen Shot 2014-10-12 at 1.36.30 PM


A String is a sequence of characters. Here are the very basic ways the two tutorials explain strings:

Ruby                                                                                               JavaScript

Screen Shot 2014-10-12 at 1.44.19 PM Screen Shot 2014-10-12 at 1.47.48 PM

Now here’s a comparison of what strings look like in Ruby and JavaScript.  I don’t really understand any of this yet, but find it helpful just to look at the two side-by-side:

Ruby                                                                                                JavaScript

Screen Shot 2014-10-12 at 1.48.48 PM


A Function is a block of code designed to perform a particular task.  Here are some side-by-side examples:

Ruby                                                                                                 JavaScript

Screen Shot 2014-10-12 at 1.59.03 PM


Even though my understanding is still completely basic and virtually non-existent, I find it helpful to put this stuff side-by-side and at least begin to understand the similarities and differences.  “Compare and contrast” is a pretty basic and universal way to learn about two things.  Children do this from infancy.  Since my knowledge of coding is still in it’s infancy, it’s no wonder I’m relying on these types of strategies, and I think that’s ok.

I still can’t program anything, and I’m spending a lot of time learning about coding.  At some point, I will have to really put my money where my mouth is and figure out how to use code to DO something.  The best part about being a true constructivist teacher and learner, however, is that you learn to build a trust in the unknown.  I take comfort in that trust.

Advertisements

2 thoughts on “Ruby or JavaScript?

  1. Go for Ruby, it looks simpler.
    You must find a simple problem, which must take its input from the keyboard and Do something, and show the result.
    Classic ones are
    a) It asks for a number, then it adds up all the numbers from 1 to that number and displays the result.
    b) It asks for a specified number of numbers, and works out the biggest or the smallest, and displays the result.

    The Logo turtle graphics is more fun, and will develop your understanding very quickly. It will do arithmetic, but its main purpose is to move a “turtle” around the screen, drawing or just moving, by specified amounts. the tutorial stuff is excellent.
    No, I don’t have shares in it !

    Like

    • Thanks for the advice, I think my brain is heading in that direction. I sat with someone who programs in Ruby tonight and made them show me some simple things start to finish, and it made a lot of sense.

      I did start playing with Logo today also, and love it. It’s super fun, and I learned it so fast and remembered all the commands really easily, which has not been the case with the others. The syntax is obviously a lot simpler, but I also think it was easy because I’ve always been pretty decent at geometry, and I like drawing. The ability to be creative in an immediate, tangible way is really helpful.

      I’m definitely going to keep spending time with it and does make me realize that I need to figure out something tangible that I want to do with Ruby. I can learn all the commands and everything, but am not going to start to be able to apply what I’m learning until I have something to apply it to.

      Thanks for your interest and input, you are super helpful!

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s