Sunday, March 29, 2015

Client Side Validations Gems vs JQuery Libray in a Rails project

Client side validations gem has the following issues:

1. Browser compatibility is not known.
2. Radio buttons issue.
3. Document is not up to date for Rails 3.2.
4. Depends on persistence mechanism. Supports Mongoid, MongoMapper.
5. Custom validations still require writing javascripts.

Advantages of pure jQuery library approach:

1. Clean separation of UI logic from Mid-tier and Persistence tier.
2. Front-end developers can develop and test without any server-side coding. Faster.
3. Wide browser compatibility.
4. Upgrades are easier and not affected by Rails and Client Side Validation gem versions.
5. Simplicity. Rule based and less code to write, integrate, test and maintain.

dyld: Library not loaded error

Upgrading rvm using : rvm get head
seems to create problems with the error:

dyld: Library not loaded: /usr/local/lib/libruby.1.9.1.dylib
  Referenced from: /usr/local/bin/ruby
  Reason: image not found
Trace/BPT trap: 5

I had to do: rvm get stable
and use Ruby version 2.1.5
to get past that error.

The Scientific Method is Crap : Teman Cooke at TED

Great presentation explaining why it is Crap. He is right. How do you explain discoveries that were made by accident? Instead of the Scientific Method, we can adopt:

Cycle of Scientific Thinking

Observations
Questions
Model (Hypothesis)
Prediction
Testing / Checking
Answers