• 0 Posts
  • 18 Comments
Joined 2 years ago
cake
Cake day: December 2nd, 2022

help-circle






  • Ruby and Python are applicable in most of the same areas. I’m currently working on a realy simple Ruby project and using a web framework called Sinatra (kinda like a lightweight Ruby on Rails if you’ve heard of that) that makes it super easy to build web apps and APIs. My ruby app basically queries an API, sorts some data and presents it to my companies management as they need it.

    Python is great too and more popular, thought I’m not really a fan as I don’t like when languages enforce white space. Python also tends to have an “attitude” like there is only one way to do a task, whereas Ruby is more flexible in this respect. Also, Ruby is fundamentally “object oriented” , Python has some object orientation but it was added on as an afterthought so Python can be a bit mixed depending on which libraries you choose to use.

    If you don’t know what object orientation is, it means “everything is an object”. In functional languages you’d count the letters, in Ruby you ask the object for it’s length property.

    This is Ruby, using the IRB command line interpreter (shell)

    irb(main):001:0> word = ‘bicycle’ => “bicycle” irb(main):002:0> puts word.length 7 => nil irb(main):003:0>