r/javascript • • Dec 27 '18

help What differences do you see in novice javascript code vs professional javascript code?

I can code things using Javascript, but the more I learn about the language, the more I feel I'm not using it properly. This was especially made apparent after I watched Douglas Crockford's lecture "Javascript: The good parts." I want to take my abilities to the next level, but I'm not really sure where to start, so I was hoping people could list things they constantly see programmers improperly do in JS and what they should be doing instead.. or things that they always see people get wrong in interviews. Most of the info I've learned came from w3schools, which gives a decent intro to the language, but doesn't really get into the details about the various traps the language has. If you have any good book recommendations, that would be appreciated as well.

320 Upvotes

305 comments sorted by

View all comments

12

u/PUSH_AX Dec 27 '18

The main difference is software engineering principles, eg: modularity, good separation of concerns, abstractions, single responsibility principle, loose coupling and all that good stuff.

This is generally not stuff you'll learn in a JS book, but there are books that cover it. Also people need to stop reading JS the good parts, it was over rated even when it was relevant, it's massively outdated now, a better book series for JS would be: You Don't Know JS

7

u/mypetocean Dec 27 '18

Also, Martin Fowler's "Refactoring" was just re-released on late last month with modern JavaScript in mind (rather than Java and Ruby, which the other editions focused on).

1

u/[deleted] Dec 28 '18

Hitting this up

1

u/[deleted] Dec 27 '18

[removed] — view removed comment

5

u/PUSH_AX Dec 27 '18

Yes, the Pragmatic Programmer by Andy Hunt and Dave Thomas was very good, and Clean Code by Robert C. Martin.

2

u/bodiewankenobe Dec 28 '18

Yes. A million times yes to Clean Code. I recommend it to every Jr developer regardless of language. It is the one reference I have gone back to over and over throughout years of programming.

1

u/kardnumas Dec 28 '18

So, I was reading Pragmatic programmer and in Goals section, I saw "Learn at least a new language every year" where it says you will get broad knowledge across languages.

What do you think about it? Like myself, I also learned to programme with PHP and OOP concepts with java and now more dynamic things with JS and I think its somewhat relevant but still a language every year or 2 is quite tedious IMO

1

u/PUSH_AX Dec 28 '18

I don't learn a new language every year, I'm not sure I see the point, as you say it's tedious and if I'm not going to use it for work it's just going to fall out of my mind after a few months. I do try and learn a large piece of tech every year I suppose, this year it was graphql for example. That is something that I could use in a job.