Where does a wannabe hacker begin?
Reading Paul's essays along with some other stuff -- like the fact that two of the founders of Auctomatic didn't know how to hack prior to starting it -- has been pretty empowering. In one of Paul's essays he mentioned that someone who's smart could probably pick up hacking within about 6 months to a year, which was definitely much shorter than I imagined.
All of it has really piqued my curiosity. I have some free time over the summer and I thought there's probably no better time to learn something new, but I can't even figure out where to begin!
So I come to you, the hackers of YC News! If you were completely new to programming and you hoped to some day try your hand at a web start up, what route would you take? What language would you learn? How would you learn it? If there's anything else you think is noteworthy, I'd be extremely grateful if you could share it!
69 comments
[ 1425 ms ] story [ 2958 ms ] threadA hacker is someone who likes to play with the world around them. I don't even know if it's possible to become a hacker. If you've never been inclined to take apart your VCR or walkman then I'm not sure if hacking is for you.
If you just want to start something up, learn PHP and MySQL. It's easy and can run on just about any hosting account. Actually depending on what you're looking to do, a CMS like Drupal could work if your startup was just a news and review site or something.
Bonus points for using Drupal instead of Wordpress.
You might prefer to do this exercise using a webhost like Slicehost. They'll hand you a VPS for $20 a month. The advantage here is that, when you're done, you'll have a public website instead of just a local PC that nobody can visit.
Read up on basic security and set up a firewall on your web server. Read up on DNS and get that working. Get a mail provider, like gmail, and wire up your new domain's email.
This exercise is actually really easy, nowadays. But it's a start. It will teach you a bunch of fundamentals, like how to use Google to solve all your problems ;). You will learn how much you enjoy tinkering with web technologies. And, for the purposes of many, many profitable online businesses, you'll be almost done. :)
----
When it comes to actually learning programming: Try Ruby or Python. Although I still never find time to use it, I will once again plug Hackety Hack at hacketyhack.net. Consider learning Rails by using Heroku: http://heroku.com/ .
If you want to impress folks around here with your earnestness, read SICP. Just Google "SICP". You can even find free online lectures from the MIT class that SICP is for. If you read it, you'll know Lisp, and you'll be well launched on your career of bluffing your way through computer science. As an economist, you might be enough of a math guy that you'll fall in love with Lisp. It does happen.
Oh, and two key words: emacs. git. Buy and read Learning emacs; it's worth it. And learn about version control -- I do recommend git, but it's still kind of confusing to learn, despite the best efforts of the Peepcode screencast guy and Randal Schwartz. You may find better intro material for Subversion: google for "svn book".
Once it becomes part of thinking process then you would automatically go to books to figure out what you need at this point of time. So becoming a hacker is not a goal; goal is to get that attitude deeply imbibed in everything you do with problems.
disclaimer: I am just at the bottom of the pyramid actually. But whenever I get to know things about programmers; I find all I wrote above.
P.S. get "Just for Fun- Revolutionary story birth of Linux operating systems". You can read some good accounts of hacking there. It was all about tinkering around and fixing.
Some of us like learning from books (as well as by practicing). Other people like learning by practice, as well as from books. Some people actually go to school and get degrees in comp sci. I skipped that part: After far too many years studying science, I got bored with formal lectures, because they move at a pace that isn't my pace (i.e. "usually too slow, except when they're too fast"). OTOH, other people thrive on the camaraderie and the formal structure of a class.
I think your answer is wise to emphasize that building stuff, and learning via experience, is the only real path to becoming a hacker. Some book learning will help, but it's not the essence of the matter.
;)
Data Structures (bonus points if it's in a functional language), Algorithms, Systems, and Architecture are all a must.
However I've also had great professors who would allow it because they feared the students wouldn't be fully committed since they weren't obligated to do assignments and exams.
Also if you have terrific idea then u dont have to wait to learn those technical skills rather you start looking for hacker co-founder or hire a hacker or outsource it to a freelancer - this is because there might be someone who has the same idea and is planning a startup, so u better keep balance between speed, gaining knowledge and time spent on learning hacking ONLY.
I think "Agile Web Development With Rails" has been dissed by the "rails community", but my impression is good. It shows exactly the examples you'll need (like how to create a login form).
It should also be noted that building a website is also an exercise in graphic design, writing, and user interaction design. Anyone of those other facets can be equally difficult to learn and master.
You should however be familiar with the hacker's arsenal of tools like Trac, Subversion, Eclipse, etc.
The first order of business in a startup is to build something that people want (after PG). More and more that something should solve some real business problem - not just another me-too social network .
I'd think your economics background could be put to good use in today's climate. Do feel that you have to be a coder - but find someone that can. You'll have a good team.
Cheers
1. Install Ubuntu.
2. Start using emacs (maybe with "Learning Emacs", O'Reilly, as mechanical_fish suggests).
3. Learn some Python (maybe with "Learning Python", O'Reilly too).
4. Use webpy (http://webpy.org) to develop a simple web application.
5. Learn how to program SQLite (and thus basic SQL) using Python and make your web application use a database.
6. Make your application public (http://vpslink.com might be enough, $7.95/month).
The 4th and 5th are "minimalistic" (for a web framework and a DB engine), least "complication", because the goal should be (I think) completing a simple project in a few months. From this you might get a glimpse of "the forest", or "connect the dots" (of web programming).
After that, if you want more, you can now go learn all of what others have very appropriately suggested: SICP, some system administration, PostgreSQL, Ruby (+ on Rails), git (or Bazaar), Data Structures, Algorithms, Test Driven Development, PHP, etc.
if you do not like C programming,
"How to Think Like a Computer Scientist: Learning with Python" to learn python.
available for free on the net
He wants to be at the fringe of business and software and these days if that's where you want to be you can "get by" knowing only a high-level language really well and hiring/partnering with more specialized engineering talent as needed if the business-side requires it.
Mastering the high-level language is arguably as difficult as mastering C but the leverage you get from the high-level language is huge relative to C for the sort of business/software problems that will be of interest to him.
You only realise the huge productivity jump when you first program a small application in C and then do the same thing in Python / <your favourite language here>.
Hence the C recommendation.
I think one of the ways to spoil one's career is to litter one's life with artificial problems that one deems necessary for success. I feel reminded of the Japanese criticism of the MacBook Air recently.
But maybe that's just me...
I think the difference might be that I assume the OP is heavily concerned with efficiency.
Given his background and goals it is not efficient [1] for the OP to learn C when in the same amount of time he could learn a high level language and then directly accomplish his goals, and never need to learn another language for the rest of his life.
[1] achieving maximum productivity with minimum wasted effort or expense (O.A.D.)
However, I realised this only after I had spent order of magnitude more time on doing the same thing in C, and burnt myself plenty of times during the process. My point is that you find out how productive you can be in one language when you have used another language to do the same thing - then a comparison becomes somewhat meaningful. I had read a lot about how python makes you more productive, but I experienced it only when I started coding in python to achieve tasks that I used to code in C earlier.
The same goes for shell scripts that make my life easier. Shell scripting became a hellish experience when I was using a solaris machine for some time - but by writing a python script instead of a shell script, I could be pretty sure that it would run in linux / solaris / any other *nix.
So, I still believe that we are essentially in agreement regarding productivity. Efficiency is another matter though - inspite of psyco etc, python tends to be slower in some tasks and it might be well worth the time to code them in C.
I know you can reduce development time using a high level language to solve problems like this. So do you. And now so does he because we told him. No need to have him waste time proving it for himself.
And to be 100% clear when I said "efficient" I mean efficient as relative to life/goal achievement. I did not mean efficient as relative to CPU time or memory usage. One of my assumptions is that if this guy implements something successful in Python he'll be able to hire or partner with someone who has a real engineering background and can make "it" go fast using every trick in the book.
Plus, if you just have a little itch to scratch, it can be a lot less work to implement the damn thing yourself, regardless of whether it's elegant or scalable or perfect. Microsoft's original product was built on your model (Gates farmed out the compiler IIRC) but he certainly had a good idea of what qualities he was looking for in a programmer.
In between read about theories and patterns in software design (Wikipedia is a great resource).
And do not ever be shy to ask whatever you do not understand.
good luck.
0) If you feel confused at any step, use Google.
1) Make an HTML page with Hello World.
2) Add an image to the page.
3) Position the image on the page by adding a CSS style to it.
4) Add a JavaScript script to the page that creates another image element, with another src URL, adds it to the page, and positions it.
5) Learn the principle behind the URLs of tiles at OpenStreetMap (http://openstreetmap.org) by using "View Image Source" in the browser. Hint: the numbers are zoomlevel/x/y.
6) Add a script in your page that creates some new image elements with OSM tiles, sitting seamlessly next to each other.
7) Learn about event handlers in JavaScript (onmousedown/onmousemove/onmouseup), and try to make the resulting map draggable. In Firefox first, then IE.
Congratulations, you're now a passably good client-side webdev.
gentoo, sbcl, emacs, slime, weblocks, ec2, git.
YMMV.
I also recommend Emacs. I haven't worked with git just yet, but I use Mercurial all the time (and I will eventually get around to using git). Avoid CVS like the plague.
1 - Find something you want to build
2 - Learn everything you need along the way
3 - ???? <!-- Lots of hard work -->
4 - Profit
I built a pop-up blocker and privacy suite this way (as a single founder) and earned more than I was making at my day job, so I eventually quit.
I see a lot of "things you should know" in other posts, but in my experience, they won't be interesting until you need them. You'll have to go step-by-step, though. I'd probably start with HTML and work my way out if you're interested in web apps.
Find something fun to build, the smaller the project the better. Keep working on it until you can't bring yourself to work on it any more, then repeat with a more ambitious project.
To see how something works, break it and unbreak it in many different ways. Sometimes the part you think does something isn't it. You don't know code well until you know how it acts when broken. Seeing what error messages mean will help you recognize them in your own code. Hotkeys are good. Ctrl-Z (undo) and Ctrl-Y (redo) are great for breaking/unbreaking code. Version control will be useful at some point.
Change one thing at a time when fixing bugs, or you'll never know what fixed it. Afterwards, explain what happened.
Do not make changes without a reason--that's a short path to cargo-culting. Read the doc, then use the scientific method--hypothesize something, then test. Rinse, lather, repeat. Otherwise, you're just guessing and will waste infinite time, like a Shakespeare-typing monkey.
When borrowing code, understand it, or it will cost you in the long run. Stripping code to the bare minimum or adapting it is a good way to know what parts do what, even if you just use the original.
Remove lines you "think" you need in your solutions and see if they still work. If a line of code isn't necessary, but is not hurting anything, remove it anyway.
I have no idea how people coded before Google, and it scares the crap out of me. Paste in your errors with variable names removed. Invest time to become a Google search pro.
If you haven't tested it, it's best to consider it broken.
http://www.catonmat.net/blog/learning-python-programming-lan...
A lot of people here recommended emacs, but it might not be the most suitable tool for you personally, or not the most suitable tool for a given task.
For example, if you want to code in Java, the best tool for that job is IntelliJ IDEA.
If you want to code in Common Lisp, the best tool for that job is emacs - mostly because it offers the best integration with Lisp (with an add-on).
Emacs and Vim both have their followers, and they have fought many religious wars over their editors' merits.
The point is that your choice of an editor need not be between emacs and vim. They just happen to be the preferred tools for most of "the big boys" around these circles.
Since you're aiming for web-development in a business environment, in your situation, you're probably more interested in making code appear on your screen than hard-core editor wizardry.
Don't spend too much time worrying about emacs or vim.
If you do want to settle in one of those camps, choose after you've tried or investigated both, and have a good idea of why you would prefer one of them over the other.
As for a programming language, I'd say that Python should be a safe bet.
It's a relatively elegant, mature language, which should be useful for all kinds of development.
One of the most popular web-frameworks, Django, also happens to be written in (and for) Python. It looks like a sensible and practical tool, and I suggest you check it out.
As a sidenote, PHP is not very highly regarded as a language by serious programmers. Its merit is getting stuff happening quickly.
Just like others have said, you need to learn HTML, CSS, JavaScript, and SQL too.
Using something like Slicehost would probably be a good idea too, so you'd get accustomed to the maintenance side of things.
I wish you good luck! :)
I think you're misunderstanding what the OP is looking to do.
As a hobbyist, you can start smaller than that, of course. Learning HTML and a bit of Javascript is a great start -- if you can build simple client-side dynamic apps, moving into server-side scripting is a lot easier. Configuring a basic Linux server to host web applications (even if it's just a virtual machine, or a spare PC under your desk) is a big step forward, too.
As an economist who may want to do some web development, though, you might gain as much from learning a general-purpose language like Python as you will from web development. Being able to toss out a quick script to do your simulations or mine an existing data set may prove substantially more valuable to you than an in-depth understanding of PHP and Apache configuration.
http://mitpress.mit.edu/sicp/
No, seriously. If you've never programmed before, this will teach you far more than you'll need, initially, but later on you'll realize that you picked up a lot of really good habits and never needed to unlearn the bad ones.
Try it. If you like it, you won't look back. If not, perhaps a career in finance isn't such a bad idea anyways.
Anyway since most of the startups are built using Open Source software, beginning to hacking with them would take you to the edge.
Also, learn how to do mathematical proofs. I don't know what the best way to do this is. I learned from 10th-grade Euclidean geometry class. Maybe you can pick up a good book on Euclidean geometry that has a lot of exercises in it.
Finally, pick up a good book on Lisp that has a lot of exercises in it and do all the exercises in it. Winston and Horn is good. "The Little Lisper" is also good.
Lots of the other advice on here, about learning C, and SICP, and emacs and CS fundamentals is nice but not necessary. Learning it will be very hard for an absolute newbie to get anything out of. It could demoralize you.
Thats why I'd advise to actually start building whatever it is you have a startup idea for. It will give you traction. You will definately struggle, but at least you'll have something concrete to show for your efforts. And I'd use Rails. If you run into problems you can always go the rubyonrails IRC channel or even ruby-lang. You'll get the hang of it. If you are going to take this route I'd recommend the Rails book by DHH.