1
PetriJ
7y

Ruby and its "simplicity" hurts me... Tried to make a if-statement checking if user is signed in... Well logic would say it's "if (user != signed_in)" right? Well logic don't apply in Ruby, in this realm you do "if (user_signed_in?)". As a logic programmer this bugs me...

Anyone relating?

Comments
  • 0
    Well, it's more readable, I personally like it.
  • 0
    @dotdeb Yeah I would like to learn ruby cuz it look really beautiful and because of its simplicity it's so readable
  • 0
    Java, C++, etc. : user.signed_in()
    Ruby: user.signed_in?

    Not too big of a difference there, and Ruby is definitely readable, but sometimes syntactic sugar (like statement modifiers) can get in the way of good general practices.
  • 0
    def logged_in?
    !current_user.nil?
    end

    From Michael Hartl's tutorial
Add Comment