3 ms·
https://www.amazon.com/DOM-Scripting-Design-JavaScript-Document/dp/1430233893/ref=sr_1_3?crid=3LXHFTCHMI92P&keywords=document+object+model&qid=1693419458&sprefi
by austin-cheney 3y ago
https://www.amazon.com/DOM-Scripting-Design-JavaScript-Document/dp/1430233893/ref=sr_1_3?crid=3LXHFTCHMI92P&keywords=document+object+model&qid=1693419458&sprefix=document+object+model%2Caps%2C99&sr=8-3 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/ 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.
- flopriore 3y agoOOP isn't a problem at all since I already know Java well. Thx for DOM
- locallost 3y agoNot 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.
- austin-cheney 3y agoThat 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.
- locallost 3y agoLate 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.
- austin-cheney 3y ago> 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.
- mock-possum 3y agoAren’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?
- austin-cheney 3y agoObjects 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.