DEV Community


Posted on

Blog post 12 Compound & Complex Conditions

In today's blog, I decided with the help of my mentor Gino, I needed to go back to understanding Ruby a bit more because I was having a very difficult time with Ruby on Rails. Sometimes you have to take a step back...

The learning goals for this specific lesson I was working on were as follows,

  1. Explore the Truth Table & the Precedence
  2. Practice expressing & evaluating complex conditions
  3. Practice making parse trees

The truth table was easy to understand in the ADA curriculum because of an example they gave. I flipped that using my own experience in Djing. If I need to dj at an event I would need my turntables and mixer. This is an && (and) example. Understanding the truth table and precedence is like understanding what goes in order as far as executing a math equation, well that is how I try to comprehend.

I have learned that operations that have a higher precedence in the operations are evaluated before the operations with the lower precedence. This list from highest to lowest in precedence form helped in understanding how this operates.

```true && true # => true and true is true
true && false # => true and false is false
false && true # => false and true is false
false && false # => false and false is false

true || true # => true or true is true
true || false # => true or false is true
false || true # => false or true is true
false || false # => false or false is false```

Top comments (1)

rickystylz01 profile image
Ricardo Maya

This is great man. The blockages suck but it's good to see that you realize this and took that step back. Good work man keep it up!