Entries RSS Comments RSS

Archive for November, 2009

A Dollar a Day?

Monday, November 16th, 2009

I’ve recently become involved in a local movement to get a hackerspace started in Rochester, NY. We’ll see what happens. I may start blogging here and there about the effort, but for now, on to the next thing.

I definitely get distracted easily. I found a webcast of this dude who was making a twitter clone in rails. I KNOW I just blogged about how amazing Sinatra is for using Ruby, but I also am thoroughly engaged by using tons of gems and do-it-for-you rails accessories to make a quick and dirty web app. I know I need to stop thinking and start doing. The hackerspace organization has gotten in the ‘way’ to an extent, but I’m definitely thinking as I procrastinate about what to start on next. I should be involved in the project by the end of the week. If I’m not, I’m going to seriously reprimand myself for my procrastination. Honestly, I won’t get anywhere that way.

One thing I have worked on lately is my plethora of adsense sites. They are really more like internet litter, but I try to post interesting content and resourceful information to the web. I never do it without the idea of making money from it (with the exception of this site and my facebook account). I’m being honest.

So, one idea I have thought of recently is the very unoriginal concept of “a dollar per day.” If you can make a dollar per day via adsense with any combination of sites, or preferably a single site, you can make $365/year minimum. A domain costs $8/year. If you made a simple, informative sites on a niche market, you could make $300 in an hour. Yes, it’s not immediate. But, the upkeep of many of my sites which bring in a total of about $10/week right now, is less than 3 hours/year. Now, no one can predict what’s going to happen, what the idea of the ’semantic web’ will bring, how google will change its algorithms, what the future of seo (whitehat or blackhat) may be… But when I think about how much money I’m bringing in for how much work I’m doing, I can’t help but think, there is a place for every piece of internet litter.

Ok, so if I stop and think about this, and try to play the devil’s advocate with myself, I’d have to say: if you made a dollar a day for throwing trash out the window, think how much dirtier our streets would be. BUT you could also be that much richer for every piece of trash you threw, and you could spend that money doing good things, too! I don’t think of it as throwing out trash though, and not only just so I can sleep at night. My trash has SOME purpose and SOME resource, or it would never get any traffic (with my approach).

So it’s more like I’m throwing out fortune cookies. My sites are for gullible people in need of entertainment or too inexperienced to recognize that there are better resources with which you could spend your time contemplating your end goal.

*Sigh* I feel like a bad person when I write this out. :P

Lifehacker Quote

Thursday, November 12th, 2009

“Good coders are a special breed of persistent problem-solvers who are addicted to the small victories that come along a long path of trial and error.”

-From a Lifehacker post by Gina Trapani, ‘Programmer 101: Teach yourself how to code’

Sinatra: The answer to my Ruby GUI problem

Monday, November 9th, 2009

Ruby and GUI’s have been on the forefront of my brain lately because I’ve been playing around with fun ways to program with Ruby. I am honestly bored of command line programs, and for good reason: the command line isn’t pretty enough for me. Since I’ve had problems installing Shoes and Hackety Hack on my version of Ubuntu, I asked one of my friends who uses Ruby frequently if there were other GUI options. There are options, but he referred to them as a bit of a mess to implement and pointed out that javascript and the web make for better uses of, what I would call, “fun Ruby.” Better yet, when you program for the web, everyone can use your program without worrying about what platform they are on.

So, I gave this a little thought. I started getting jealous and even a little frustrated at Python programmers and their connectedness with GUI’s and their pride in Python’s support for GUI’s. Apparently, Ruby has similar support, but it’s not nearly as widely embraced amongst Rubyists as it is in the Python community. (True? False? opinions?) Admittedly, I think I should have just learned visual basic and got my GUI fix 10 years ago. (I don’t particularly want to learn Python, and there are issues with it’s syntax that have turned me off pretty heavily.)

So, I have decided that the best course of action, given my new fixation on Sinatra, is to begin a jquery/javascript and Ruby project. Although I’ve been making websites for about 10 years, they have generally been informative, usually static, very low level applications of HTML, CSS, and bits and pieces of PHP. I have used javascript for fun little menus now and again, but honestly I’m a total copy/paster when it comes to js. I started recently on some javascript tutorials, but was then quickly reprimanded: SKIP TO JQUERY, says everyone. Unless you really wanna become a pro in javascript, it sounds like jquery is a nice shortcut to the overwhelming syntax (especially coming from Ruby!) and implementations of javascript. I can’t quite figure out a consistency of why and how something does what in javascript. But, if I can figure out what I want the code to do, I’m pretty sure I can figure out how to use jquery to get the job done. We’ll see.

I am going to begin working on a blog that is purely in javascript, using jquery, and also uses Sinatra. I’m going to use sqlite for the DB. Did I mention I have very little experience with DB’s, too? :) Okay, this project, honestly, seems a little over my head to me right now. But once complete, I think I will have experience with all of these pieces I need to make a pretty, fun, and useful application. Something every programmer craves– right?! :)

Updates to follow. Thanks to Julio for helping me come up with the idea on how to practice messing with all of the components I’m craving: Ruby, Sinatra, Javascript/Jquery, Sqlite, ERB, CSS… wee! This brings up another point about how multilingual and implementation exposure at the early stages of learning a programming language can be so incredibly integral to understanding how to best utilize a programming language like Ruby… but that’s for another post! Cheers!

Ruby on Rails or Sinatra?

Saturday, November 7th, 2009

My updates have been a little scarce, but I’ve been programming– I promise. :P

I recently have been working on a site, discountcampusbooks.com (psst, buy your books there!) with my husband, alan.dipert.org. The book search is written in Ruby and uses the incredibly cute Ruby framework, Sinatra. I absolutely LOVE Sinatra, and I think for me it is a viable alternative to Rails. I’ve had pretty mixed feelings on ROR lately. I know I am a bit too opinionated for my skill level, but I really have something to say about the differences and advantages of both Rails and Sinatra.

I should say this first, because I feel like it:

For someone like me, who is just learning their first programming language, new to object orientation, and incredibly naive about the power or lack thereof of a given language, I feel blessed to have picked Ruby as my first language to learn. As I have learned Ruby, I’ve also learned the shortcomings of other languages. I am lucky enough to have a multilingual husband who keeps books like toilet paper in our bathroom, so at any given point I can pick up a little reading material and learn a little Clojure (yeah!!) or C (not so much). I’ve explored Python and Haskell pretty thoroughly as well as a few other common programming languages. I can’t argue against any of these languages too much. Why would I? Mostly, as I learn more about other languages, I just feel luckier to have picked Ruby as my devirginizing language. :P I also know it is important to explore the value of other languages. In fact, I know I sometimes need other languages to make the best use of Ruby. There is so much to say about all of this. End interjection (for now.)

The biggest issue for me, as I mentioned earlier, is the fact that ROR is the largest use/implementation of Ruby and the easiest for which you can find tutorials, screencasts, support groups, chatrooms, etc etc. Overwhelmed by ROR, I started using a “joke” (literally) framework my friend wrote to get my Ruby programs off the command line and on the web. After dealing with the shortcomings of his babyframework (again, it was written as a “joke” and was actually put together as a way to use Ruby as if it were PHP), I started branching out on my own. It became clear to me that, though you can use Ruby in a similar way to PHP using ERB, it’s not necessarily the best way. I had been working on a dungeon text adventure in Ruby and I was trying to figure out how to make it work via the web using ERB. I was, for the most part, successful. My tech support was limited, but I started to see the parallels of his framework and Sinatra after checking out Sinatra earlier in the week. Enter Sinatra. Things like Rack ran on both the joke framework and Sinatra. I could even use shotgun to run a webserver on my computer. WHOA. All of these things were exposed to me in small doses, and then adding Sinatra to the mix just blew my mind further. Ruby is fuckin’ cool. Noted. And I continued to compute.

When my husband asked me to help with the book search, I was pretty excited. I was so excited to see an actual implementation of a Sinatra-based web app. There was so much Ruby involved!! :) During my first experience with rails, I was hardly able to figure out where I should even put my Ruby. :) Weeks earlier, I had spent time creating a ’sample blog’ in rails, and figuring out the MVC framework. In rails, so much of the work is done for you. A large part of the process is accepting MVC framework, also seen in zend and django in PHP and python, respectively. You don’t need to be a Ruby expert to do Rails. (But you can be, and you will be better for your knowledge, that’s for sure. I have never doubted that.) Likewise, I truly believe you could suck at Rails and excel at Ruby. In fact, you’d probably prefer and have already used Sinatra if this is the case. They are not mutually inclusive. One of my favorite things about Ruby is the power and extensiveness of the language. Frameworks as light as Sinatra give creative freedom and your exposure to Ruby and the web can be vast or minimal– you can most likely get something to work for you. If you want something big, you’ll have to build it yourself. On the other hand, larger frameworks provide you an out of the box, large-scale solution that subsequently requires more knowledge and familiarity of the framework before you can customize it creatively.

Sinatra allows you a very simple, lightweight framework that requires you build off your own knowledge rather than, as my friend Julio would put it, David’s skills. Honestly, if you know the scope of your site will be huge, you know your DB infrastructure, and you’ve been through all of this before, Rails is probably your answer. From what I hear, you’ll love it, and it’s worth learning the MVC framework aspects that may be, at first, completely fuckin’ confusing (for me, it’s slowly coming along after using Sinatra more). However, if you’re like me, and you wanna start from small potatoes and build it yourself (yeah!!), use Sinatra. I feel like I may be making my way towards Rails, but I may also never get there. I enjoy the freedom of Sinatra, and I’m not building any gigantic web applications for the time being. Sinatra just rules if you love Ruby, but Rails seems to big and Ruby command line programs aren’t GUI enough. The web is an excellent agnostic platform for development. So embrace it. I have noticed many programmers are reluctant to do so for various reasons, but Sinatra has opened my eyes to the fact that you can write painless, creative Ruby apps with a little hassle and a lot of fun.

Cheers :)