Live data from Hacker News

Ask HN: Web Fundamentals for a Newb

news.ycombinator.com

1–10 of 30 posts

Ask HN: Web Fundamentals for a Newb

#1
I know it is common for non-hackers interested in web development to ask how to get started, but I think my question is a variation and has not been covered in depth. I apologize if I missed a previous discussion addressing this issue.

I am attempting to teach myself Rails and have also made a concerted effort to understand Ruby. I have heard on many occasions that it is advisable to understand what problems Rails solves in order to use the framework to its full benefit and my little bit of experience supports this claim. While my study of Ruby has definitely helped me to understand some of the magic of Rails, there are holes in my understanding that Ruby knowledge alone will not solve.

My weakness is in understanding web fundamentals, and I would like to take a step back from Rails to do kind of a survey of those fundamentals. In particular, I know I need to read up on webservers and CGI. Any particular recommendations on either subject? I also wonder what other subjects I should be reading up on? Are there any books out there that do a survey of web stuff but are relatively technology agnostic? Any particular terms I should be googling for? (I do have a basic knowledge of html and css as well as a very rudimentary knowledge of mysql syntax).

Another area I would like to focus on is how to design the architecture of the web app itself, particularly in a MVC framework. The books I am using are tutorial-based but they never really address how to figure out what your models should be, etc. They just tell you how to make models in Rails. Any suggestions on this front?

I think that I should probably also learn some basics of database design even though ActiveRecord makes it tempting and easy to ignore. Is this a correct assessment?

To make a long post short, I am looking for advice on non-Ruby and non-Rails skills that I need to develop web apps. I know this is a great group of people to ask and appreciate any and all direction.

Re: Ask HN: Web Fundamentals for a Newb

#2
Great question... I am somewhat in the same boat you are, but about a year further. One really good website that I found has filled in some gaps for me is http://www.buildingwebapps.com (although I haven't seen the specific issues you've mentioned).

EDIT: Now that I think about it, I probably need more fundamental knowledge of algorithms, and computer science in general than the things you mentioned.

Re: Ask HN: Web Fundamentals for a Newb

#3
It's certainly useful to know how things got to where they are, but it's not always necessary. Even in history circles people debate how important history is if the lessons can be handed down via knowledge of good-practices.

If you want to know how good you've got it now, I'd start with building a site that uses entirely static content. After you've got a few pages, make a change that affects all of these pages. You'll see how static pages lead to redundancy and a lesson will be learned.

Then setup a cgi based commenting system in either c or perl, which would arguably represent the start of interactive web sites. From here, you'll see that there are things you'd like to store, like a username, and you'll understand how frameworks make following a user easy.

Once you've done these two things, add some database support for the comments and a way to search the comments.

I'd say, after these three things, you'll have a pretty good understanding of how slick things like rails are and you can go back to being as productive as possible with respect for the problems it's solving. There's definitely more to learn on this topic, but it might border on distraction at this point.

Re: Ask HN: Web Fundamentals for a Newb

#4
In general, you always have to take into account the Law of Leaky Abstractions ( http://www.joelonsoftware.com/articles/LeakyAbstractions.htm... ).

No matter how convenient a new abstraction might make things, it will some day "leak". If you don't know anything about the layer underneath, at that point, you're pretty shafted.

Some abstractions are more leaky than others. ActiveRecord is a very leaky abstraction. Make sure you have a solid grounding in database usage, db model design, normalisation, etc

As for the web in general, your stack of abstractions reads something like: ActionController > MVC for web apps > CGI-BIN/Servlets > HTTP > TCP > IP > ...

You can probably stop around HTTP or TCP and be ok.

I don't think you'll find a single book that covers all that, but maybe someone will have some suggestions.

Please note you don't need to become an expert at all this stuff - but you need to have a pretty good idea how it all fits together.

Re: Ask HN: Web Fundamentals for a Newb

#7
You might want to learn PHP first, especially if you're new to programming. Not only is PHP easy to learn, but it is also useful for quickly testing out simpler webpages.

By learning PHP, you'll also learn how web programming is traditionally done and the basics of how the web works. Once finished, you'll clearly see how Rails makes certain aspects of web programming easier, even for things like form validation.

I recommend a book like "PHP 6 and MySQL 5" which is very easy to read, and definitely type in the examples! http://www.amazon.com/PHP-MySQL-Dynamic-Web-Sites/dp/0321525....

Re: Ask HN: Web Fundamentals for a Newb

#8
post #7

You might want to learn PHP first, especially if you're new to programming. Not only is PHP easy to learn, but it is also useful for quickly testing out simpler webpages. By learning PHP, you'll also learn how web programming is traditionally done and the basics of how the web works. Once finished, you'll clearly see how Rails makes certain aspects of web programming easier, even for things like form validation. I re…

PHP can allow you to be very sloppy, I'm not sure I would recommend it. Although you do need some way of learning in-depth MySQL, rails makes it too easy, and you probably won't be using Rails forever...

Re: Ask HN: Web Fundamentals for a Newb

#9
post #4

In general, you always have to take into account the Law of Leaky Abstractions ( http://www.joelonsoftware.com/articles/LeakyAbstractions.htm... ). No matter how convenient a new abstraction might make things, it will some day "leak". If you don't know anything about the layer underneath, at that point, you're pretty shafted. Some abstractions are more leaky than others. ActiveRecord is a very leaky abstraction. Make…

Add DNS to the list of necessary bits. I'm always stunned by how little most web developers know about DNS, and how often it bites them in the ass. It comes into play on all sorts of performance, redundancy, reliability, scalability, and server migration questions. It's not a particularly hard or deep subject (at least, to grasp as much of the topic as a web developer needs to know), but if you don't know the basics, you will run into problems at the worst possible time.

Our products touch all aspects of a web developers stack, and so I suspect our forums are pretty representative...and DNS problems are the second most common type of problem we hear about (trailing well-behind email, but well before PHP, Ruby, Python, Perl, performance, security, and pretty much everything else). I pretty much expect to recommend O'Reilly's DNS and BIND daily, and keep the BIND page of our wiki open at all times for referencing in my responses.

Re: Ask HN: Web Fundamentals for a Newb

#10
post #3

It's certainly useful to know how things got to where they are, but it's not always necessary. Even in history circles people debate how important history is if the lessons can be handed down via knowledge of good-practices. If you want to know how good you've got it now, I'd start with building a site that uses entirely static content. After you've got a few pages, make a change that affects all of these pages. You'…

And cookies! If you want to know what pain is, you should try managing cookies by hand.
Post reply on HN