Try - Catch - Throw error handling

Error handling is a common practice among almost all programming languages. They handle errors. Typically - anticipation, detection, and resolution of programming, application, and communications errors. It produces something the user or developer wants more than an ungraceful error.

Read More

Learning Friday: JS Scope - Global, Function, and Block

Hey there! Here are some notes I took after reading Kyle Simpson’s YDKJS and watching his “Advanced Front-end Masters” on Scope. Let me know if theres anything I can improve with this article via the links below. There’s always room to improve!

Read More

ActiveRecord ORM and SQL querying

ActiveRecord is an ORM

Active record is a ORM(Object Relational Mapping) library. This means that even though you’re interacting with a database in your Rails app by writing User.create or User.find_by you’re not really writing SQL but writing with a DSL(Domain Specific Language) called ActiveRecord to compile SQL code to interact with the SQL database. So in console I type

 User.find_by(id:1)

which uses the ActiveRecord Library to execute this hidden SQL code into the database:

 SELECT * FROM users WHERE id = 1 LIMIT 1;

This outputs an ActiveRecord hash containing a user found by the query in the database.

#<User id: 1, nickname: "Pookie", name: "Renan", user_profile: "http://steamcommunity.com/id/the_real_renan/", user_image: "https://steamcdn-a.akamaihd.net/steamcommunity/pub...", user_location: "Miami, FL, US", uid: "76561198287309916", provider: "steam">
Read More