Tell HN: 2 weeks ago, I didnt know programming. I just wrote a web scraper.
Feeling really chuffed and had to share. Great way to end the year.
To all business MBA guys learning to code: you can do it! just get started!!
Happy New Year guys :)
P.S It was in C# in case anyone is wondering.
42 comments
[ 3.4 ms ] story [ 59.5 ms ] threadIn anycase, my thinking was just get started first. Im probably going to dabble in Python or Ruby (probably Python) just to see what its like at some point. But for the time being, just getting my head down and writing code and asking really n00b questions on stackoverflow is definitely the way to go.
So its nice to be able to look under the hood now and see whats going on!
Just learn ruby on rails as soon as possible so you aren't tainted by the horrible sample code of c#/java/php. Ay least get into codeigniter.
Part of the perfectionist in me was also trying to understand everything that happened. Like what actually happens when I enter Console.WriteLine("Hello world");? That is always going to be a losing better so I've since subscribed to the "I know how to drive but I don't know how a car operates" school of thought.
Somewhere along the way, I realised programming isnt about hardcore math but more like just grouping actions together in a logical manner.
I relate very much to your perfectionist statement. Keep in mind that each thing you learn about how the underlying machine operates will make you a more effective programmer. Learn about the craft of programming (patterns of design, abstraction, etc.), but don't lose sight of the fact that programs run on physical machines, and our bound by the properties of those machines.
Programming is a harsh mistress, but the rewards are worth it.
I feel like 10,000 miles away from that right now.
git clone git://gist.github.com/761348.git gist-761348
https://gist.github.com/761348
Fairly idiomatic code too; particularly impressed with the use of XPath.
Are you scraping glogster or are you with glogster? ;-)
In a 24 period I tried Java, Perl and Python and in the end Python won by miles and miles. I now use Python daily for all sorts of tasks. I love it.
No, all of you can't. But it's not a bad idea to try and see if you think you'd like it!
I am reminded of the half-joking book title: "Learn to Program in 21 Years".
http://norvig.com/21-days.html
The next step is to learn why web scraping is discouraged, and how to use public APIs instead.
Right, just like google uses public api's to access all those sites. Web scraping is responsible for a very large portion of all the traffic on port 80 and the number of sites that have published APIs is extremely small compared to the total.
If a resource does have a public API, some very positive things about using that instead are that not only is it less resource intensive for them, it is much easier for you to create and maintain. If you're relying on scraping to get specific info from a site, it's a huge Odin when changes to their HTML break your code.