10 ms·
How I Learned Enough Ruby On Rails In 12 Weeks To Launch Freelancify
- tmh88j 15y agoGreat write up. I experienced a similar adventure in learning PHP over the past couple months and I completely agree that the first few weeks are by far the hardest. Late last summer a friend and I came up with a great idea but we lacked the programming skills to create it ourselves. I knew a bit of HTML, a touch of c++ , and PLC ladder logic programming(huge help, right?). It wasn't until around October that I realized we were getting nowhere. I decided enough was enough and I was going to learn how to program. I spent an entire weekend reading and trying out zend's PHP 101 for beginners. Three months later and I had created a user authentication system with messaging, friends lists, administrative rights, and all sorts of other goodies. I was working a full time job so I did this with my spare time. Your site looks great by the way. Keep up the good work.
- james-fend 15y agothank you! how many hours total do you think you spent during the 3 months?
- tmh88j 15y agoDuring the initial learning phase I wasn't as enthralled because who cares what $this->someFunction($variable) means? I'd say I put in around an hour per day for the first month and then once I got the hang of it, probably 2-4 hours per day after that. I made sure to take off programming at least one day per week so I wouldn't get burned out considering I was working full time too. So, I'd estimate around 150-160 hours. I should've kept track. I plan on learning ruby later on this year and I'll be sure to keep a record of that.
- james-fend 15y agoThat's pretty fast. Yeah.. once getting past that initial learning curve; it becomes a lot funner.
- tmh88j 15y agoJames, this is in response to what you said to my last comment. The reply button wasn't showing. Anyway, that 150-160 hours was to the point where I was comfortable enough to sit down and code away. I'm still working on the system and I'm still learning a lot. I'd also like to become a lot better with css/jquery. I know the basics and not much more. A guy on my team is a front end whiz so I don't have to worry about cramming that into my head right now.
- civild 15y agoI just had a look at Freelancify and registered, and I'm amazed that you did it all in 12 weeks learning Ruby from scratch. Kudos! Based on your experience, how do you think learning materials/tutorials could be improved for people learning from scratch?
- james-fend 15y agoThank you! Without getting too much into technics in the beginning, and getting the person to get something up to feel accomplished, gain confidence. I think that's what gets most people. That initial learning curve takes a lot reassurance that they can do it; but if they hit a wall and it takes more than 7-8 hours to get around it, a lot just quit all together. By far, the most thorough and best written resource I used was the Rails Tutorial from Michael Hartl.
- ams6110 15y agoI had a look at it too, and from a design standpoint it looks very nice. I am not sure about your choices for project budget. For example, this description was posted for bids: Need Drupal developer to: - do PSD/HTML to Drupal theme for one new section on the existing site. - Do additional module programming. - fix issues/error on the site - Make the entire site work With a stated budget of $100--$300. I mean come on, that's ridiculously naive on the part of the person who posted. If you could give bid-seekers some guidelines on what to reasonably expect, e.g. some examples of what a budget of $100-$300 might buy, it would help people get qualified bids.
- saltcod 15y agoFantastic post. Thanks so much for it. I decided to really dig into Ruby on Rails after Christmas this year, after thinking/talking about it for years. I was thrilled to hear that you really had no programming background—I think a lot of us are in this boat. I watched the Lynda.com videos on Ruby, and the one on Ruby on Rails (both from Kevin Skoglund). I just watched enough of both to get fairly overwhelmed and confused, then moved on to Michael Hartl's site. Things started to click much better there—that's the best Rails resource I've seen to date. Still though, After really digging in over the evenings and two weekends, that nagging feeling started to set in—am I actually going to 'get' this? Am I wasting my time? Is this going to take years? Will I ever get past layouts/partials? Should I just go learn PHP / Javascript / iOS / something else? Did you feel like giving up? Or question the purpose/wisdom of learning Ruby and Rails?
- james-fend 15y agoYes, it was the hardest/easiest thing to learn I've ever experienced. Sometimes I was jumping out of my chair and then other times throwing things against the wall. Plenty of times I wanted to just give up.. during those points; I'd step back and go take a break, go for a walk, do something.. other than think. Programming is hard because it's full-time blitz mode thinking. I felt the front part of my brain (is that where all the programming juice is held?) hurt often in the beginning. Do you have an actual product you want to work on?
- joshcrews 15y ago> Do you have an actual product you want to work on? Having a real product to build, even if its just to help yourself and not the world is key. It gets you out of the tutorials (which you need to do) and into finding out the main problems you have to solve to get something live. And once you've got something live, you've built your mental framework that you can "hang" everything else you learn on.
- mnoire 15y agoCouldn't agree more. The urge and desire to start learning was constantly squashed by the daunting task at hand. Once my ideas began to coalesce into something coherent, the passion and interest superseded the difficulty or fear I'd never "get it".
- GnomeChomsky 15y agoAny advice for getting started for someone without a Mac? I remember once trying to learn and immediately stalling out during setup (lame, I know). I have WinXP & Ubuntu, and would like to take a stab at this again no matter how stupid I feel about not even being to able to install the damn stuff to start with.
- saltcod 15y agoThe Ubuntu and Mac setups should be pretty similar. It will be easier for you to get help developing through Ubuntu than XP. Stackoverflow/IRC are your friends when you run into trouble.
- lbotos 15y agoI don't want to sound blunt, but I found the installation process of ruby/python/git on windows to be more painful than necessary. (Last time I tried) It might make sense to try it on Ubuntu as it should be very similar to a mac environment. Good Luck!
- jamesgeck0 15y agoPython? Really? There's nothing you need to do after running the installer. It sets up the path and everything. Most of the popular python libraries that require a binary component have windows installers as well. Ruby is a bit more understandable, if you don't get DevKit (or if DevKit can't compile something) working with gems can be frustrating. And setting up Git on Windows with an SSH key has been awful in the past. RailsInstaller takes a lot of the pain out of setup, though.
- eli 15y agoMy advice is to do your development using a Virtual Machine--ideally running the same OS as what your production web server will eventually be running. This gives you the freedom to screw around with your app and server configuration, knowing you can easily roll back to an older version. And it also gives you more confidence that your app will deploy cleanly to your production server and not get hung up on some subtle difference between e.g. Ubuntu and Red Hat. And, finally, then it doesn't matter whether your host OS is windows or ubuntu; use which you feel most comfortable with.
- darushimo 15y agothanks james and commenters saltcod and tmh88j for saying that the first few weeks are the hardest. I'm banging away at the google python exercises and nearly crying. knowing that other people are going through this headache too gives me a bit of confidence to truck through.
- tmh88j 15y agoOnce you get through the basics, think of a couple small programs to write to test out your new skills and you'll be sure to encounter new problem. Some of the first programs I wrote in PHP included sorting and ordering a list of numbers and letters that were entered, a pig latin converter, and then to get the hang of MySQL, I created some simple database entries. For the first month I was constantly referencing other code online to figure out how to create my programs. After a while I found myself looking less and less at existing code and I was able to simply type away.
- james-fend 15y agoNo prob! exactly why I wrote it.. during times of learning code; motivation is like gold
- saltcod 15y agoThe other thing I want to add is how much 'else' I learned while running through Michael Hartl's tutorial. Despite many years making websites, I really had no clue about basic http methods — get, put, post, etc — and in fact, I didn't even realize what they were. The other huge, huge thing for me was finally figuring out what REST is all about. Basically, the web runs on those few basic http methods, and using the REST approach spells that out for you and cements it in your head. I had an awesome jump-up-and-down moment when it finally clicked.
- james-fend 15y agoJump-up-and-down moments, ah... those are great!
- danneu 15y agoAnd 'else' things like Git, actually working with Github and Heroku, and learning how to test in the same tutorial that's teaching you Rails.
- fragileandys 15y agois this a joke? if so its funny... when i click the link i get: "Error establishing a database connection", haha
- jemka 15y agoIt's likely a result of a cheap host server not being able to handle the traffic. Not a reflection of OP's programming abilities.
- james-fend 15y agoYep. That's exactly it, it's on a cheap server and too much traffic. Anybody experience this before and/or know some quick solutions?
- kabuks 15y agoYou mentioned Heroku in your post. Why did you decide not to host there?
- BummerCloud 15y agoIt is hosted on Heroku: ➜ ~ dig -x 75.101.163.44 +short proxy.heroku.com.
- james-fend 15y agoGood question. The wordpress blog (webstartup.me) is on a cheap server. Freelancify is hosted on Heroku.
- loucal 15y agojekyll on S3 is a pretty killer combo for a cheap blog that scales infinitely and automatically. You'll probably like it, especially since you're a ruby guy.
- 15y ago
- mellifluousmind 15y agoAs someone with programming background, I actually wish there are more stories on the opposite direction (programmer who gets kickass awesome in UI design (HTML + CSS)). I think that the complexity of CSS compatibility (what browser supports what not... even there are minor quirks between Firefox & Chrome, not just IE.. don't get me started on IE7 & 8 either), it is very easy to raise a white flag and say "that is it..I am going back to deal with backend only tasks, nothing that consumer will see on the surface). Perhaps, OP already has a knack for UI design (as he/she mentioned in the post that he/she is a UI designer by trade before Ruby), so kudos for getting a nice grip on Rails. As for me, I wish I can master the UI design etc.
- james-fend 15y agoDo you think it's a left brain, right brain sort of thing? I mean what controls someone's ability to draw better than others? I've noticed usually the better someone can draw on paper, their web design reflects the same.
- mellifluousmind 15y agoI think it has a lot more to do with memorization of all the little quirks on what works on what browser and what doesn't. With languages like C#/Ruby/PHP/JavaScript, I find that I can soak up that knowledge better than HTML/CSS, because I find it consistent and organized (...not too sure about PHP's quirky API naming conventions). For CSS, it just seems like there is a myriad of tricks you gain through out the years, and I guess it just takes more effort to get good at it.
- danneu 15y agoExactly. Programming is logical. Styling isn't. Knowing that `margin: 0 auto;` centers elements in CSS isn't a left-brain, right-brain thing. It's just something unintuitive that you accept until you stumble upon the New Way of doing it.
- randomdata 15y agoI sort of built my skills in unison (had an interest in both programming and design since I was a kid), but my career has tended towards the development side, so I guess you could say that I am a programmer by trade that picked up design on the side. Whether or not I am "kickass" is subjective, but people seem generally happy with my work. The biggest challenge I find is that people do not take designer programmers seriously. Those who do just enough programming to support their interfaces seem to be respected, but as soon as I dive in writing some low level component in C, as an example, my design skills are immediately discounted, it seems. Programming is design, in my opinion. The way you structure your code, getting the indents and spacings just right to be pleasing to the eye, are the exact same skills you need when you're shifting pixels in photoshop. Thinking about how the next programmer will interpret the meaning of your code is the same skill you need when thinking about how a user will use your interface. I feel the only thing limiting a programmer from becoming a good designer is practice.
- alphadogg 15y agoI don't know whether to applaud or be scared without looking at the code. The true test comes if and when you have to scale in 12 months.
- spiredigital 15y agoAwesome work, James! Your site looks really nice, and now you've got the ability to do design AND program, which is a combo that isn't too common. Best of luck with your site....
- eurohacker 15y agois it so that as you are getting older - its getting harder to learn programming, say over 30 yeards old ..
- moreorless 15y agoFantastic and inspirational writeup. Definitely will be forwarding the story to my nephew who is starting to show interest in programming.
- tptacek 15y agoCongrats on the launch. I think I speak for everyone on HN when I say, you're going about this the right way: learn enough to build applications for yourself, whether or not you're going to be a code committer over the long term. Can I give you some quick advice? Don't take this the wrong way: Rails makes it easy to learn enough to be dangerous in 12 weeks. Some quick hits on obvious things you should look over in your application to ensure it isn't overtly insecure: * Every model class should have an "attr_accessible" statement, and the attributes you expose through it should be minimal. A very common misconception: "the things in attr_accessible are the only attributes users can set". Not so! The things in attr_accessible are the only attributes users can set automatically, through mass assignment. You can expose things that aren't in attr_accessible by manually settings them with assignment statements. Assume anything that's in an "attr_accessible" list, and every attribute of a model without attr_accessible, can and will be set to the most hostile possible value, like "role=admin". * Rails programming intros have a bad habit of introducing ActiveRecord finders in the context of the model class object --- in other words, "Post.find(params[:id])". This is exactly the wrong way to do it; it's so bad that you can literally generate a list of vulnerabilities on Rails projects by grepping app/controllers for "[A-Z][a-z]+]\.find". Instead, make sure all your finders work via associations, like "@current_user.posts.find(params[:id])". * Use a popular plugin for file uploads. Rails doesn't do much of anything to defend against file upload/download vulnerabilities. If I was building a public-facing Rails application, I'd do whatever I could to keep the filesystem namespace out of my requests --- storing all files on Amazon S3 without explicitly storing them in temp files is a good way to do this. * Don't enable the old-style wildcard route ("/:controller/:action/:id) or any of its variants ("/posts/:action/:id :controller => :posts); whether you declare methods "public" or "private" in a controller should have nothing to do with whether they're exposed to attackers. * Have a "PreauthController" that inherits from "ApplicationController" and disables the is-logged-in check; in other words, every controller, particularly every controller generated by "rails generate", should be post-authentication by default. Set up the before_filter that checks for a valid user session right there in ApplicationController, then "turn it off" for the LoginController by having it inherit from PreauthController. Similarly: if you can get away with not having an AdminController at all --- run a totally separate Rails app for admin that requires a VPN to get to --- do that; otherwise, have an abstract AdminOnlyController class with no methods in it that does nothing but set up a before_filter to check for admin privileges, and have every admin-only controller inherit from it. * Pretend the backtic operator (the one that executes Unix commands) doesn't exist. You may do all of these things already (in which case, good for you! you learned more in 12 weeks than a lot of Rails developers do in years). I just called them out because (a) not doing them will be tremendously painful down the road (individual XSS slipups are annoying but unlikely to kill you, but vulnerabilities that allow people to dump your whole database are something else) and (b) they are so easy to fix. Good luck!
- instakill 15y agoDid you go about this project doing TDD/BDD?
- SkyMarshal 15y agoNo, sounds like he used PM [1]. 1. http://programming-motherfucker.com/ http://programming-motherfucker.com/
- SkyMarshal 15y agoIf I could edit that, I'd add a smiley or something to make it clear I didn't intend to be an ass. Meant that to be funny.
- danneu 15y agoI started working on my first non-trivial application and having no test suite started hurting me within a few days. Inconsistencies between my local and Heroku environments just feel like whack-a-mole with no easy insights into where along the commit line they broke. `git push heroku` feels blind as I cross my fingers. Now I'm in the process of applying tests retroactively which is even more painful. I'm doing this "retro-TDD" process of breaking my app and writing tests until they go green when I fix my app. I suppose this is a necessary journey to actually practicing TDD.
- james-fend 15y agohey danneu, Unfortunately no. The logic for the cucumber tests are written out, so if another coder took a look at the .features, they'd be able to figure out what the app needs to do. But as far as the tests working if I cmd 'cucumber'; they would all fail as they aren't defined yet. The main reason for this was, me and Josh were actually going to only do Freelancify for a week or two without testing, then scrap it and re-do it again BDD test driven. I ended up putting so much work into it in the weeks, that starting over from scratch would be a huge time-killer. One of the next things on the to-do is to go back and make these cucumber tests work. Josh and I are probably also going to start on another small app so I can do BDD first, then code.
- freehunter 15y agoI get really annoyed when there is an element that follows me down the page as I scroll. It's really distracting. I get even more annoyed when I have to set up an adblock rule to make it go away. Please, designers, stop doing this (and stop doing menu bars with the same behavior). There's not much on your site that is important enough that I need it to follow me everywhere.
- jwong42 15y agoHey James, very inspiring read. I've been following your story and progress on the fastlane forum and glad to see that you had a successful launch! I've also been learning to program myself but my language of choice was python and django for framework. You are right that it takes some time to get through that initial learning curve but once you reach that first stage and figure out how to get past everytime you get stuck, it gets pretty exciting and fun. Congrats and best of luck to you!!
- evanlong 15y agoXSRF: https://github.com/evanlong/security/blob/master/web/csrf/freelancify.html https://github.com/evanlong/security/blob/master/web/csrf/fr...
- verroq 15y agoDoesn't the rails csrf token prevent that?
- theDaveB 15y agoI can't get the tryruby.org site to work properly. If I do anything wrong it just locks up and I have to refresh the browser window. For instance at the "type 2 + 6" question, if I type 2+6 it freezes. If type 2 + 6 it's fine. Running OSX Lion and Google Chrome. Dave
- daylonsoh 15y agoJames, I'm kinda in a similar situation like your old-self and now you have a gun.