Before get started with Ruby on Rails, I am just learning ruby programming language and I found the following facts about ruby. I am writing basics of ruby programming which I learned today.
- Ruby variables are dynamic typing and duck typing
- Can be define simply assigning value to the variable
count = 10 awesome_count = 20 // correct convention awesomeCount = 20 // Wrong convention
- Yay ! we do not need any semicolon here
- Common convention for the varible define is snake case not camel case
- 2 Space is common practice instead of 4 space in code
- Writing comment in ruby is quite simple and straight forward
- For e.g.
# This is ruby comment
- Function can be define using 'def' like this
def double(value); value * 2; end double(2) // results 4
- We do not need return statement to return value too
- In above example single line function and statement are seperated by semi-colon please do not confused on it
- For the multiple line we can write like this
def double(value) value * 2 end double(2) // results 4
Throughout the last year, I have worked part-time as a working student and also studied at the university. I was not the first and not the last one who has combined that during their studies, but the problem for me was, that at the end of the day I have felt absolutely exhausted mentally and physically. That caused problems with my health and motivation to continue working on my goals or anything. (yeah, “goals,” I wish I had something more specific at that time).