Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Best books to learn web development?
68 points by flopriore on Aug 30, 2023 | hide | past | favorite | 49 comments
Hi, I'm currently learning HTML, CSS and JS but I'd like to get more in depth. I love learning stuff from books, even if it's a bit old-fashioned, because I can always take a brief look at what I need rather than having to search for basic information online, among several crappy SEO websites.

Can you suggest some books? I'd prefer advanced ones, as I'm not a newbie.

PS: I know you learn things only by doing, the book would be a support. You can suggest also books related to networking, that's the next step :)




I learned HTML and CSS mainly from MDN, so that's where I suggest you look. As for stuff I use in css most often I can only recommend a few articles and such. Learn how to use Flexbox and CSS Grid though for sure (as those are the two most modern ways to layout an HTML page) as well as CSS Positioning [0] (which is some of the older ways to lay things out).

[0]: https://alistapart.com/article/css-positioning-101/

For JS there are some online books that are gold mines the problem is finding them. One is Eloquent JavaScript which is available to read online for free here [1].

[1]: https://eloquentjavascript.net/

Though I've never actually finished the whole thing it does a pretty great job explaining JS to the uninitiated.

My other favorite books in JS are actually all from the same person Axel Rauschmayer. All of his books are available online for free here [2]. He has a really good way of explaining in my opinion and his books kind of take out all the fluff.

[2]: https://exploringjs.com/


I'll add The Modern JavaScript Tutorial as an additional reference I like:

https://javascript.info/


Thanks a lot


A textbook which gives a good introduction to Web Development is:

1) Fundamentals of Web Development (Randy Connolly and Ricardo Hoar).

I have the 2nd Ed but the 3rd Ed is out and is more contemporary.

Specific books for HTML and CSS are:

1) HTML and CSS - The Comprehensive Guide (decent contemporary introduction)

2) CSS in Depth

3) CSS The Definite Guide - 5th Ed - Reference

Specific books for JavaScript.

1) Javascript - The Comprehensive Guide (decent contemporary introduction)

2) Eloquent JavaScript - 3rd Ed

3) Javascipt - The Definite Guide - 7th Ed


I'd probably followup with one of Souder's books, "High Performand Websites" and "Even Faster Websites" both will cover issues of some common issues you may experience and the importance of metrics and measuring for actual performance issues.

Although today, a dependency graph is more invaluable for modern web apps... Odds are your project is bringing in some massive/slow dependencies.


Thanks a lot, that's definitely what I was looking for


If you're starting from scratch and interested in python, walk through Miguel grinberg's mega tutorial from start to finish, implementing everything yourself along the way. It's very good and you'll have a thorough understanding of the basics at that point. I started working professionally building simple web apps immediately after working through that.

When youre ready to go galaxy brained, "Designing Data-Intensive Applications" is the standard


Thanks, I already know Python for basic scripts. This tutorial looks awesome to build simple web apps, thanks for sharing. I'm looking forward to studying "Designing Data-Intensive Applications", it truly looks like a gem


The head first series are great. https://www.oreilly.com/library/view/head-first-html/9781449...

It's not super advanced but gives you a great foundation and you learn by doing.

After that it's best to pick out a challenging project you want to build for yourself and tackle that.

Once you have a good foundation in css I'd recommend checking out Tailwind CSS and Tailwind UI.


I remember "JavaScript: The Good Parts" by Douglas Crockford touched some parts in depth.

Also "You Don't Know JS Yet" has some depth in it https://github.com/getify/You-Dont-Know-JS


Crockford's book is very short, but dense in information. I would not recommend it to somebody just learning the language, even though I think Crockford writes and expresses himself very clearly.

You don't know JS series didn't sit well with me. It tries to lead the reader through some a-ha moments, except those are pretty individual. But it might work for someone else.


Nice, I will take a look at both of them for sure


https://www.amazon.com/DOM-Scripting-Design-JavaScript-Docum...

1. If you want to be good at this start with a solid foundation. The compile target of the browser is the DOM (Document Object Model).

2. Read about accessibility: https://www.w3.org/WAI/standards-guidelines/wcag/ Understanding accessibility will influence why things are done in certain ways and will make clear the difference between presentation and developers who may not understand this platform as well as they claim.

3. Learn about events and asynchronous execution.

4. Finally, learn to program JavaScript, but understand OOP is optional and considerably more work.

If you can build even the most minor of confidence in those 4 areas you will become a stellar developer compared to your peers working on this platform.


Not sure I agree with this advice. Most of webdev today is about actively avoiding the DOM. That's not to say you should not know what is below, but the rabbit hole can get deep. Accessibility is something that unfortunately is not high on the list of most people's priorities. You might say that's bad, but knowing it will not help someone learning the ropes to get an app done so they can learn more.


That is true, but only for attaining/retaining employment. Otherwise, the DOM remains the compile target of the browser. Your giant framework is a shallow abstraction over this with a massively opaque API. Developers like to put their heads in the sand and wish the world works differently, and that's fine for a while as it greatly increases career mobility. But, pretending and hoping aren't things that elevate your career to more senior positions. This is why we have things like imposter syndrome and expert beginners.


Late reply, but I don't disagree with that entirely. I don't think people should be totally ignorant about it, but you can be if you want to learn how to get something basic done (which is what this thread is about). I do however disagree in part because everyone tries to avoid it for a reason. It's a shitty "compile target". I can imagine a world where the canvas becomes a compile target and then all the accumulated DOM quirks become useless knowledge.


> It's a shitty "compile target".

The "I don't like it" excuse seems to be the last refuge once developers completely exhaust all valid technical considerations. It always comes down to developers being irrationally afraid of tree models (yes, that is entirely what it is and its stupendously bizarre).

If really it was just "I don't like it" then propose something better.


Aren’t 1 and 4 a bit of a contradiction? The DOM is the document object model for a reason - modern JavaScript is fundamentally object-oriented. What alternative do you propose to OOP JS - functional programming? You can fake it, but why? Why not just go with the flow?


Objects in JavaScript are hashmaps, or structs in Rust, or various other names for the same things in whatever language. More specifically the DOM is a tree model no differently than a file system. It is arranged as an object because that is the data structure chosen by the original implementers, but it could be just about any combination of data structures. Back then the only opinions in JavaScript for data structures were objects and arrays.

That is not what OOP is. OOP is about expressing poly-instantiation and therefore allowing inheritance.

The internals of JavaScript are fundamentally OOP, such as the type system and distribution of DOM methods each expressed as prototypes. Most of that stuff you shouldn't be touching anyways. As far as your own code OOP is completely optional and requires far greater effort. Functions are first class citizens that can go absolutely anywhere with any kind of nesting in ways OOP structures cannot.


OOP isn't a problem at all since I already know Java well. Thx for DOM


One of my favorite free online books is https://internetingishard.netlify.app/

It does a great job at explaining intermediate/advanced caveats and gotchas along the way.


Excellent. Thank you for sharing.


Caveat to most of the answers so far - you can read Javascript books until you're blue in the face, you need to build stuff as much as possible.


I think that both are important... building stuff helps you understand how pieces fit together. Reading on the language can help you understand how to use features of the language (instead of using a library for something largely in the box).


> you need to build stuff as much as possible You're absolutely right, that's how you truly learn. I asked for some books to get a more "theoretical" perspective apart from building projects.


You don't need to search SEO spam for that stuff; ChatGPT knows it. I think Vite and React would be a good place to branch out to.


TBH I'm not a huge fan of results given by ChatGPT. I often found several mistakes, not only in programming. When you ask ChatGPT, then to check its answers you must google it anyway, I feel like you waste more time. In addition, I prefer fixing problems by myself. That's why I try not to use 3rd-party libraries so much when I'm learning a new language or framework. When I get familiar with it, I start using them obviously.


You asked for JS (JavaScript) and you got a lot of suggestions for books or other resources about that language. But I suggest to not spend too much time with JS and learn TypeScript instead. It will make your life easier, because the compiler helps a lot - especially if your projects grow. The official documentation is very good and should be sufficient for almost everything that you would ever do with TypeScript. https://www.typescriptlang.org/docs/


Do you really think it’s wise to start with typescript? That requires a compile tool chain, terminal commands, it adds a lot of strictness and some completely unfamiliar demands on a beginning coder that JavaScript avoids entirely.

You can just sit down and write JavaScript. It just works in your browser. You can’t do that with typescript.


I loved Eloquent Javascript, I even bought a printed copy. Mozilla also has amazing documentation in all aspects of web dev.


I know you asked specifically about books, but I can’t help but recommend the two online courses that Josh Comeau makes available. I have found both the “CSS for JavaScript Developers” and the “Joy of React” courses to be absolutely phenomenal!

Josh’s teaching style is exceptional, and the courses’ exercises challenge you to work just at the edge of your abilities. I cannot recommend these courses enough!!

https://www.joshwcomeau.com/courses/


While I haven't taken either of his courses, his posts on his site are fantastic. I had forgotten about him. May end up grabbing one of his courses.


Yes! Josh's blog posts are indeed excellent! And I definitely think that his courses have the same degree of thoughtfulness and insight.


I learned HTML and CSS from W3 schools and Javascript from eloquent javascript by Marijn Haverbeke https://eloquentjavascript.net/


This might not be considered hip and modern any more, but I think there's still a lot of good fundamentals described, and well-written:

http://philip.greenspun.com/seia/


This seems like an interesting resource for people who already work in the industry and know what the modern practices are. Having a historical perspective is interesting, and also know what best practices have stayed through the years. However, it's also important to know what simply isn't used anymore.

I'm not sure that this is a good resource for a beginner, because it would teach them practices that aren't just out of fashion, but altogether unused, and would hurt them in the job market IMHO.

Much of this text is now obsolete -- not obsolete like "oh, a new JS lib du jour came out yesterday and we should all adopt it", but obsolete like "if you use this, many browsers won't support it and nobody else in your generation will be able to maintain your code".

Specifically:

- DNS and HTTPS are way more complicated now than when this was written

- Mobile usability isn't done this way any more; WAP and XHTML are not in use

- VoiceXML is not used

- XML in general has largely given way to JSON. SOAP is rarely used except maybe outside of academia and other niches.

- RSS is pretty much dead

- The DOM structure is not as semantic as in the past (unfortunately)

- It presupposes that most data must live in a RMDBS as opposed to other storage paradigms

- It completely ignores (well, predates) the prevalence of abstracted cloud services that most web work uses these days, vs reinventing search etc. from scratch

- Analytics is likewise way more complex today, but in the post-Google Analytics era and in the post-privacy era

- Some of the HTML syntax it uses is deprecated

- It presupposes a simpler full-stack model where a small web team will do the entire full stack work from the UI to the DB admin, vs today where that's usually specialized and/or outsourced to various third parties and APIs

I hope this doesn't come across as snobby... just trying to give the OP some context about where this fits in relative to modern work. Some of the fundamentals are indeed worthwhile reading, but the text itself doesn't make clear what is or is not still relevant. Without prior knowledge to be able to differentiate that, this book could teach a bunch of deprecated practices.


While I mostly agree... there's something to be said for a simpler, server-driven stack. HTMX is particularly interesting as a point for server driven integration(s). Many (most) apps are for internalized use at a given company... there's a lot of corporate development and most of these applications can scale perfectly fine with a relatively simple stack backed by a traditional RDBMS.

It's usually somewhere between 10k users and 1m users where the rules change entirely and you need to start looking to more modern/advanced approaches. 10k is kind of arbitrary, because you can do some really stupid things with a traditional rdbms with sql.


Sure, nothing wrong with a simple server-side stack. But even then, you probably wouldn't write it (today) by spinning up Microsoft SQL Server on a bare-metal machine so that your sysadmin can maintain its records with MS Access, then writing a bespoke CMS by creating your own prepared SQL statements from scratch, all while making sure your designer knows Frontpage and that you have a WAP version ready to roll out soon.

It's not that the principles are invalid these days, but that the specific examples and techniques mentioned in that text are now often done with different tooling. Significantly, a lot the low-level stuff has also been replaced with higher-level, industry-standard abstractions (which embody many standard best practices that might otherwise take an individual years to learn and polish), building upon the lessons and mistakes learned over the decades. This text doesn't really clarify what is a long-lasting architectural principle and what was just a fashion trend of the day and now obsolete.

Realistically, I think new devs coming into the field these days are likely to first encounter those abstractions (whether it's HTMX or Next) before understanding the history of why they exist (and what their tradeoffs are). Those architectural tradeoffs are important to learn at some point, but usually those decisions are not left to the newcomers (in a sane company) and also should be taught in the context of modern tooling and decisions, not software that was common two decades ago.

Like important questions these days might be (as you said) what do we do on the server vs client JS (or rehydration), what do we outsource to a cloud (which clouds?), what do we containerize or not, how do we deal with HTTPS and mobile and cross-platform (web/iOS/Android), etc. Not "what is the best log parser for Apache" or "should we use MS SQL because it works better with Access". In some companies, it might also be "which off-the-shelf CMS best fits our use case" vs "Is C# or Java or more appropriate for our backend?"

If someone wants to take the time to highlight the specific, still-relevant sections of that text, I think it could be worthwhile. But otherwise, without that differentiation, it's just kinda a minefield for newcomers.


That's fair... I hadn't really taken in the referenced article(s), only wanted to note, that there's still a place for a simpler vertical stack. As to MS-SQL, I don't think I'd recommend it for any purpose where it isn't already entrenched. Same for any commercial SQL based RDBMS (Oracle, DB2, etc) in favor of PostgreSQL or a largely compatible implementation.

Aside: Right now, exploring HTMLX + server-side yew for rendering in rocket (rust), which could be very interesting. Usually do https termination at the platform, or reverse-proxy via Caddy. And I'm a proponent of containerizing all the things (Docker).


Maybe I will read it later, for now I stay with the ones suggested by other users. You can't understand which practices you should and shouldn't follow unless you are an expert


Yeah, that makes sense. I think the value of this particular text is that it teaches some of the underlying architectural principles, but truthfully, you probably won't be making those sorts of decisions until later in your career (unless you end up working at a really small shop).

For now, just focusing on the basics of HTML/CSS and especially JS will get you going well enough, and those will all be applicable in web work no matter what specialization you choose.

Those are what we normally consider frontend technologies (though JS can also be used on the backend). If you also want to learn the backend side, having some frontend knowledge still never hurts, if only so you can work with the frontend people better.

This text might be worth circling back to later in your career, once you start considering architectural patterns. But for now you have a lot of other great suggestions :)


css-tricks has good stuff:

https://css-tricks.com/

And I like this Principles of Object-Oriented Javascript book by Nicholas Zakas even though it's a little dated (example: its claim that there are no classes in JavaScript)

https://nostarch.com/oojs

And I love everything by Kevin Powell:

https://www.youtube.com/@KevinPowell

edit* I want to add the The Odin Project has a ton of good material:

https://www.theodinproject.com


Kevin is very wholesome and enjoyable. He's personally helped me with some stuff too when I was first learning and asking questions in the channel's discord server. Nice guy.


Gary Bernhardt's execute program is a phenomenal resource for learning JS/TS and SQL: https://www.executeprogram.com/


I recently started doing this as well. I searched HN and landed on https://learn.shayhowe.com/ . Very useful link


A long time ago I read secrets of the JavaScript ninja. I feel like perhaps that is outdated though. I would probably recommend eloquent JavaScript at this point or googling for online materials


Do a side project that makes some use of WebLLM and upload it to github. While figuring it out, you'll learn web dev and also learn a marketable skill.


Not a book, but the mdn docs have tons of stuff.


Yeah I've read some parts of those docs, that's one of my main online sources.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: