Saturday, April 11, 2009

Workshop 4 - learning more about RoR syntax


1. Ok. I just went to http://www.fincher.org/tips/Languages/Ruby/ and had reviewed the samples.



Working with TEXT file reminds me of the VI editor, then i follow to download VIM.org's vi editor for windows XP. I think i will enjoy using it again.

Why do i need vi if i can just copy and paste from the tutorial into the notepad and save as .RB file and run it..

So i did exactly that for some of the rest of the tutorials.





I haven't completed all 46 tutorials. I did read it all though.
2.
What are the syntax differences in the way that Ruby and Javascript use the if statement?


There are some significant difference in the if statement in RUBY and in Javascript


- Ruby uses "elsif" and Javascript use "else if"

- Ruby does not place the comparision in parenthesis and Javascript do place the comparision in parenthesis

- Ruby does not use "then" and Javascript uses "then" option

- Ruby requires the "end" to finish the condition testing and Javascript uses the last set of {} parenthesis instead

3. While Ruby and Python are quite similar, can you find some similarities between Ruby and Javascript?


Ruby is a server-side scripting and interpreting language and Javascript is purely a client-side play and similarities are that they can both handle similar input and outputs. The difference is the efficiency.



No comments:

Post a Comment