Mobile App & Web Developer

Category Archives: Ruby on Rails

Starter League Web Dev – Week Six and Seven

 

What is back-end development?

 

We have been learning lots of awesome things in class over the past two weeks like: database structures, table associations, validations, tests, user accounts, user sessions, cookies, passwords, account security, and Github.

 

Github is a code management network that simplifies Git, which is a free source code management system. (Git was invented by Linus Torvalds aka: the guy who invented the Linux kernel). Git and Github are absolutely awesome. Seriously though, it makes me happy to be alive. Github allows developers can easily upload their files and projects to store, share, and collaborate with other developers. If you are interested in Git and Github, I highly recommend Git Immersion, an awesome intro tutorial to get you started.

 

Database structures and table associations are the fundamentals of linking a database together to create functional web applications. Validations ensure that the information you enter is valid for a given data entry. You know those notices that tell you your username or password need one uppercase letter and/or one number? Those are validations at work.

 

Tests are written in applications to test the code to make sure it doesn’t break later on and result in a devastating error that scares all your users away. That being said, any popular app most definitely has lots and lots of tests to make sure it runs properly. There are actually tests called koans that allow programmers to learn specific programming languages. For anyone that is learning Ruby, I would definitely suggest Rubykoans.

 

User accounts and user sessions are all made possible because of cookies. HTTP cookies are small pieces of data sent from websites to be stored in the user’s browser. Authentication cookies notify websites of the their users’ previous activity, such as if a user is logged in to a specific account or not . Not all digital cookies are equal though. Tracking cookies and third-party tracking cookies can collect records of your browsing history, so we should still clear our browsers’ cookies from time to time. Why are they called cookies? The name cookie was coined by developers to think of a trail of cookie crumbs. The name stuck. But seriously, who doesn’t like cookies.

 

It’s crazy that week seven is already over. I’ve learned so much during this experience at the Starter League and at 1871! It’s crazy how the more you learn, the more you realize how much you don’t know. Time to go get some rest. There are apps to be built in the morning.

Starter League Web Dev – Week Four and Five


Is perception reality?


This blog post is about the web dev content in weeks four and five, yet it is being posted at the end of week six. So is the post new or old?

Whether it’s old or new, it exists right now. I guess that is what really matters.


During week four our class perfected our CRUD skills by creating a tumblr-like GIF blog over and over until we memorized the process and the syntax. The CRUD app model is necessary for 99% of all websites as it contains the necessary functions to Create. Read. Update. and Destroy. The CRUD app model is also known as a RESTful resource because it utilizes four of the core methods/requests in HTTP. These four core requests are: [GET, POST, PUT, DELETE]. GET receives data, POST posts data, PUT updates data, and DELETE deletes data. While a CRUD app has the four functions C.R.U.D., there are seven actions behind the scenes that carry out these four functions. Because these actions are so great we call them the “The Golden Seven”. These “Golden Seven” actions are: [New. Create. Show. Index. Update. Edit. Destroy]. Each one of the golden seven actions correspond to a HTTP request: [New => GET, Create => POST, Show => GET, Index => GET, Update => PUT, Edit => GET, Destroy => Delete. I don’t want to scare away non-programmers so I’ll chill out a little bit now… Back to the story:


With our newly equip RoR knowledge in mind, our Web Dev class valiantly fought off hundreds and hundreds of errors messages. We battled swarms of the error messages through the Database(s), Model(s), Route(s), Controller(s), Action(s), View(s) multiple times to weld all the concepts and syntax into our muscle memory. It was one hell of a week. It had to be done. Or so we thought!


We came in the following Monday with stories of success and victory. We focused our attention on the new content, which was a few rails commands like: rails generate controller, rails generate model, rails generate resource, and rails generate scaffold.. As we entered these commands into the terminal and watched rails generate the entire structure of an app, we realized that these commands, these shortcuts, could have build our entire tumblr-like GIF apps in seconds rather than hours…


It was an amazing feeling to utilize these new “rails generate” commands after typing out the RCAV process one step at a time. Discovering the rails generate commands made me feel like I had discovered an epic invention such as the telephone, the bicycle, or penicillin for the first time. Hand programming the CRUD app instilled the Seven Golden methods in our static memory, but it also allowed us to witness the power of Rails when the “generate methods” were introduced. At this point I’m not completely sure if it’s better to use the “rails generate commands” or hand right the seven golden methods… There are advantages and disadvantages to each. It’s a matter of perspective.

Starter League Wev Dev – Week Three

 

Why do we make things more complex than they really are?

 

Eckhart Tolle would say it’s because we create expectations in the future based on the past and thus detract energy and joy from the present moment. I’ve noticed that I tend to create mental visions or expectations of activities I have or want to do. And these expectations usually result in taking away enjoyment or energy from the planned activity or postponement of the whole activity itself. It’s amazing how much better things are when we don’t have expectations, when we just act in spontaneity and enjoy what we are doing in the moment. I’ve realized that I created the expectation that programming was very difficult. But you know, expectations suck.

 

C.R.U.D. (Create. Read. Update. Delete) is the basis of nearly 99% of all web applications. This week we created a Ruby on Rails app that allows visitors to upload pictures and GIFs to an index page (home page). Create an image and caption on the page by adding the url and desired caption, Read the image on the index page or on the picture id page (single picture page), Update the image or caption in the edit page, and Delete the image. Almost every application uses the actions: create, read, update, delete; so it’s, great to get practice and post absurd GIFs at the same time! We all created our own version of this.

 

I thought it was tough memorizing all of the Ruby syntax, but Rails is a whole new beast! As our instructor Raghu says to us everyday, “You Gotta Toast It,” or as Mike Land would say, “Tear down, rebuild, tear down, and rebuild again.” You may have kept the amazing notes with every command, method, and concept known to RoR, but the only way to really “ingrain the code in your muscle memory” is to open up a blank rails app, start going through the RCAV (Route. Controller. Action. View.), and let the errors guide your next step. Error-driven development is essentially where the computer tells you what is broken in your program. As a programmer, you have to tell the computer exactly what to do. If there is a problem in your code, the computer will run the program until it encounters the error, and then it will report the error on the browser page. It’s funny to recall my experience with computer errors before I was a programmer: usually when an error came up in Windows or an application, I would become enraged and curse at the monitor without even trying to read the error message.

 

On week two we accessed the facebook API and pulled out data from our news feeds. It’s amazing how a little amount of code can pull data from giant databases so easily. I’m really starting to visualize how creating web apps is possible! It’s a great feeling. We also created a “flashcard app” that pulls data from the Starter League Portal and lists/posts the names, pictures, twitter handles, and section of all the students in the AM web development class. On day one of the Starter League, Raghu told us we would be creating a flashcard app to help us memorize all of the names of our class mates. At the time, I had absolutely no idea how we would do this. And here we are at the end of week two with the complete flashcard app. Now all we need is a little CSS (cascading style sheets) to make it look nice. :)

 

I’m learning that programming and web application development is challenging. It’s not a walk in the park and it takes focus and hard work, but it’s definitely something that everyone can learn. My friend used to tell me every time we would study, “Learn by Doing.” I’m just now starting to realize what he was trying to communicate. Until next week.

 

Full-speed ahead and enjoy the moment

Starter League Web Dev – Week One

 

What is the best way to learn a language?

 

We’ve all heard of Rosetta Stone. Personally I think Rosetta Stone gets pretty boring after talking to your computer monitor for ten hours. Traditional high school and college courses are heavy on reading and writing but soft on speaking and listening. Pimsleur audiobooks are extremely convenient and teach you valuable phrases. But we all know the best way to learn Chinese is to live in China, and the best way to learn Portuguese is to live in Brazil, just like the best way to learn Afrikaans is to live in South Africa (well either that, or learn Dutch or German). Anyway, you know what I’m saying.

 

The point is that, if you want learn a language, you need to facilitate the necessity. You need to live the language. If you were dropped into any unknown country or city you would slowly but surely pick up the language. Why? Because you need to communicate! Knowing how to say “I want one of this!” in any language could be the magic key to getting a meal in your stomach for the night. Total immersion allows you to learn 24/7, conscious or subconscious.

 

While our country is more like 1871 and we are communicating with computers instead of people, I would say that the Starter League is pretty similar to parachuting into a foreign country. The environment and content is new, the experience is a bit overwhelming, but it is always rewarding and there is always someone who is willing to help you.

 

In the first week of the Web Dev class we installed Ruby on Rails and have started learning HTML, CSS, Ruby, and Unix. We are using pair programming to articulate the mental process of programming and build community through total participation. The instructors are fantastic and my peers are awesome. No grades, no final, no diploma. There is only potential to be realized.

 

It’s Friday night and I’m sitting here at my computer thinking about how I need to finish this blog post, design my website, practice more methods and loops in Ruby, and fix this glitch problem with Spotify in Linux. It’s a long el-ride home, so I’m gonna take a break for now. Until next week!