Last active
January 25, 2018 03:24
-
-
Save DamianRivas/bc6dbda67affba4ae18fd4b84a3b53a3 to your computer and use it in GitHub Desktop.
Introduction to Ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The first thing I noticed is the lack of curly braces to define scope. We'll see how this difference to other languages plays out. | |
Printing to the console is so much easier! | |
String concatenation behaves the same as in JavaScript when using the `+` symbol. | |
It's unnecesary to use the `return` keyword if the last line inside a method returns exactly what you intended. Still, I find using | |
the `return` keyword preferable with my experience in JavaScript and C++. | |
Ruby appears to be less syntactically verbose compared to other programming languages I've used in the past. Although, the naming | |
convention of using multiple words seperated by underscores defeats this purpose compared to something like camelCase. | |
Variable creation is a beauty of the Ruby language! Simply name it and assign a value! No need to declare that you are declaring a | |
variable like in JavaScript or declare the variable's type like in C++. | |
String interpolation only seemed to work when using double quotes ("") and not when I used single quotes (''). Perhaps I'm doing | |
something wrong? | |
What I believe is the "global scope" also behaves like a method! I may be off, but it seems like the end of a Ruby program also returns | |
whatever is on the last line. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment