Skip to main content

Programming vs Web Development

No doubt others have commented on this before, but it seems that web development and programming aren't the same thing.

The last two days I built a few simple Rails applications. The second one is relatively impressive ( a blogger site with authentication, image uploading, tagging and commenting). While I learned a great deal about MVC, Rails and even some new features of Git, I learned little programming. 

Most of the problems I encountered had to do with gem version incompatibilities. I had to update this, rollback that, edit the Gemfile, precompile for Heroku deployment, reset the database, reset Heroku, etc. Most of the problems were solved through brute force trial and error and googling. The final product was impressive, but Rails did most of the programming for me.

Previous exercises involving Project Euler, writing sort algorithms or programs to solve mechanics problems in Physics, required deep thought and abstraction. 

No doubt problem solving (in the sense of creating a program vs troubleshooting) will be a part of my web development studies, but at the moment I sense my programming abilities getting flabby.

To prevent flab, I have set myself daily workouts in at least 2 languages (the choices being Java, Javascript and Ruby). This morning I wrote a nice little program to input, manipulate and extract data from an array in Java (for the Initiation a la programmation course on Coursera). 

It was fun.

Comments

Popular posts from this blog

Ruby, RSpec, Linux and Relational Algebra (or "What I'm doing this Christmas")

Last week was challenging- I'm beginning to appreciate the need for a programming buddy.  So far, I haven't found a Ruby IDE that helps with missing brackets or illegal syntax. This means hours spent looking for errors which more experience (or an IDE) would have solved in an instant. I've spent a lot of time on Stack Exchange looking for solutions to problems that many have already had- so far I haven't had to post a single new question (though it's evident that many people post duplicate questions, not having looked for a solution first). I spent longer on the Ruby project than anticipated, BUT I really enjoyed learning about Behaviour Driven Development. Thinking of tests in RSpec and then watching my Ruby script pass (eventually) was like passing an exam (though  one I had written myself). This week I'll be starting Rails-after I complete the CodeSchool Rails courses I'll go on to their RSpec course. Partly for the geek cred, partly out of curiosit...

Algorithm Analysis - 1

Currently, I'm learning to perform algorithm analysis using Big-O notation. In one resource I found the following problem: You just dropped a box of glass toys and  n  toys in the box broke in half. You'd like to match the halves of the toys so that you could glue them together, but the only way to tell whether two halves belonged to one toy is to physically pick up the two pieces and try to fit them together. Express how long this matching process will take in terms of  n . The answer given is n^2 (n squared) with the following explanation:  You have to compare every piece with every other piece. If you have 1 toy and it breaks in half, you have 1 comparison to make. If you have 2 toys and they both break in half there are 4 pieces and you have to do 6 comparisons. If you have 3 toys, there are 6 pieces and you have to do 15 comparisons. If you have  N/2  toys, you have  N  pieces and you have to do N-1 + N-2 + N-3 + ... + 1 =(N)(N-1)/2...

Rails Project-Blogger Problem

Ran into my first challenge with the blogger today. I was creating a new model for a Comment feature and I typed: $ bin/rails generate model Comment author_name:string body:text article s :references That single red letter cost me an hour of struggle (I mean 'learning'). The extra s created a database schema containing something called 'articles_id'.  Since id  is a property of a single article, the comment controller  couldn't find an id  for articles,  as it didn't exist.  I looked at the Comment model file and saw the extra s  almost immediately after trying to enter a comment. But then I couldn't reverse the error. Rolling back the migration ( rake db:rollback), had no effect on the schema.  Destroying the model ( rails destroy model Comment)  had no effect on the schema. In the end I replaced the my local files with the Github repo contents (luckily I had just done a push). git fetch --all git reset --hard or...