Bloc has a cool feature within it’s platform that let’s you know if you are on pace. A few weeks back I spoke to a Blocstar that was telling me about a man going through the Bootcamp whose pace was always 100%. In true Coding Over 40 perfectionist form, I decided I was going to be that person. Here is the lesson-I am not that person, I don’t need to be that person and I am 93% on pace. I am happy that I am grasping concepts that don’t particularly come naturally to me because I didn’t study Computer Science in college, I actually studied the science of DNA and molecular biology in college, so that doesn’t help. LOLOLOLOLOLOLOL.
Moving forward, here is what I learnt this week in Computer Science aka Bloc.
Before I started this particular project called Bloccit (a reddit-like product), I knew more about being a user to a web application than I did about how it works behind the scenes. What I learned this week is that, I really didn’t know much about very important features a user does that are included in all apps, mobile apps, e-commerce sites et al, and that is user authentication. User Authentication is where “we must authenticate and retain user information so that we know who the user is until they sign out.”
Adding Code In One Controller Might Make Code In Another Obsolete
FULL disclosure here. This concept is pretty much the only time I get super frustrated. I’ll explain. Let’s say I define a method called create_new which simply creates a new user. Then let’s say after the user is created I want to redirect them to the landing page (welcome#index) of my app-GREAT! Now, let’s say I want to “associate” comments to a post this new user creates. Guess what? I will need to make sure that everywhere that user_id is related to a post is also associated with comments. Sounds simple right? It isn’t. If you forget to refactor or scope the associations in any file, things won’t work and you might spend all day figuring out why. I don’t think this is a beginner issue, I think this is an attention to detail issue and boy am I paying attention! Yes, error messages in your app are super helpful but often don’t point you to the actual error, it only points you to when rails decided it could process your code anymore. So having the knowledge to know where things might have stopped working is a super-power often unrecognised. Which leads me to:
RoR Is Freaking Fantastic With It’s Helpers But…
I was asked the other day by a fellow programmer who is just beginning his journey if RoR is a good place to start. My short answer to him was no, I do not recommend it as a starting programming tool. The long answer is more interesting.
Tell me what you think about RoR helper theory in the comments. Have a great weekend!