Ok so the other night, I spent a few hours on the Ruby section of Code Academy. Even thought I’ve already been through lots of ruby tutorials, doing another can’t hurt! The best part of teaching yourself to code are the resources…everyone out there who is really good at coding seems to build their own “learn coding!” website, meaning that there are SO MANY websites that go over all of the different languages. Endless practice!
Right now I’m watching a video on Lynda.com about rails and how it creates pages dynamically. That was actually one of the biggest conceptual hurdles I had to overcome when learning Django (a python equivalent to rails). I had always written all my websites as static sites, and I didn’t know there was an alternative way. This means I would write the files (index.html, aboutme.html, anotherpage.html, etc) and upload all the images (bio.jpg, ottersholdinghands.jpg) and just upload them all to my godaddy file manager and tada! Website!
What I’ve since learned is that there’s an entirely different way to make a site: dynamically. This means that when someone goes to your site, the page is created by your framework right then and there. I thought that when I learned Django, it would mean that I would write a little poll app (using their wonderful documentation) and I would somehow install it on my regular, static site. This is NOT how this works, and it took me a good solid week of frustration to figure that out. I would be constantly asking my friend Joe “Wait so where do I put this web app?! I want to put it on my site!” and he was pretty confused. Fair enough! The web app IS the website.
If you’re going to be using a framework (django, rails, etc) to make a site, that means that everything about the entire site is going to be written using the framework. You’re not going to write your normal index.html file and then upload it anywhere. You’re going to write your index.html file and have it as a template for a view. This is why the MVC (model view controller) pattern is so important to learn early on.
Ok back to rails!
I remember when I first used Perl to generate the HTML sent to the browser. Code that wrote code: it totally blew my mind!
And it doesn’t stop there. There’s code that writes code that writes code; and there’s code that writes code so that it looks like other code, to other code. It’s a regular madhouse! But it’s also incredibly cool, because where we say ‘code’, we could also say ‘ideas’ or ‘information’.
They’re ideas that shape other ideas, information that is shaped to help convey an idea, ideas that are shaped to make the core information transmittable and sharable around the world, irrespective of language.
On the face of it, it’s just Perl or Ruby or Python generating HTML. But it’s really the minds of all the people who created those things coordinating their thoughts and ideas over time and space. It’s a song that inspires the creation of more songs, and anyone who likes can contribute.
That’s beautiful! I can’t wait to learn more about meta programming. yay!