Live data from Hacker News

How to Become a Great JavaScript Developer

blog.ustunozgur.com

131–140 of 171 posts

Re: How to Become a Great JavaScript Developer

#131
post #90

No. Not this. Net even close to this. Let me illustrate: How to become great at Sports: - Read books about sports. - Watch other people play sports. - Read in-depth analysis of past sports games. How to become great at Playing Violin: - Read books about playing violin. - Real sheet music by the great masters. - Listen to many concerts. It's inherently obvious that the above approaches are totally and completely wrong…

It continually amazes me that programming books are as popular as they are. I can't think of a format I'd prefer less than static text when it comes to learning new programming languages.

Much better to just jump in and start figuring things out. Google your questions, find Stack Overflow questions. Fiddle with CodePen (etc) examples to see what variables and functions do what. Once you're well versed, read the occasional blog post about emerging techniques and patterns.

I work in JS day in, day out, and this approach hasn't seen me wrong. But we're all different.

Re: How to Become a Great JavaScript Developer

#132
post #77

Earlier quoted context omitted.

I haven't gotten much into Javascript yet, but is there any reason I would not terminate with semicolons? Without understanding which "certain cases" won't have them inserted automatically, relying on that feels like asking for trouble.

My understanding is that the original decision was to make life easier for the programmer: if you forget, we'll put one in there for you. Myself, I'd rather be told that I made a mistake, then have it ignored, because how does the compiler know what I really wanted? Here's a good one: http://stackoverflow.com/questions/18986144/javascript-compi... Instead of being told there's some problem with the code, it inserts a…

The actual reason that third function compiles, and the fourth does not, is that

    {
      x: 0
    }
is a block statement with a label x. Try it in your console, it returns 0. The last one is an object literal outside an expression, which is a syntax error.

In addition to that, the return statement is 'restricted production' where the line break itself is a terminator, this has nothing to do with semi-colons or ASI.

Re: How to Become a Great JavaScript Developer

#133
post #90

No. Not this. Net even close to this. Let me illustrate: How to become great at Sports: - Read books about sports. - Watch other people play sports. - Read in-depth analysis of past sports games. How to become great at Playing Violin: - Read books about playing violin. - Real sheet music by the great masters. - Listen to many concerts. It's inherently obvious that the above approaches are totally and completely wrong…

Having a coach is a luxury. For us software developers the closest thing we get to coaching is a code review by a more experienced developer. That is certainly valuable but rather hard to come by consistently if you are past certain level.

So what to do without a coach? Find something that will direct your practice. For this reading quality code is indispensable as it shows you the range of possibilities of what you can do with certain technology.

Considering your example of sports: past certain level it is essential to meticulously study video footage of yourself and your opponents in action as it provides insight into your weaknesses and your opponents' tricks which you can then adopt or learn to counter. Also when someone comes with spectacular advancement in technique (think Fosbury flop) it is quickly analyzed and adopted by others. So watching others is sometimes very useful.

Re: How to Become a Great JavaScript Developer

#134

Earlier quoted context omitted.

Knowledge work is different. How to become great at Chess: - Read books about chess. - Watch other people play chess. - Read in-depth analysis of past chess games. How to become great at Math: - Read books about math. - Watch other people perform math. - Read in-depth analysis of math. You also skipped a key assertion from the author: "Do exercises and try to explain common JavaScript concepts such as inheritance in…

Any great chess player (let's define that as near-IM fide ratings and up) will tell you that it's a highly iterative process between practice, analysis and reading that is very much anchored around practice. They play thousands and thousands of hours and, yes, also spend quite a bit of time reading, thinking, analyzing (both their own and others') games and learning from mentors/teachers. However, practice is king an…

Take a beginner player who has been playing at the local chess club once a week (two hours) for 12 weeks. This player enjoys the game and wants to be better. He plays anyone who will give him a game. He occasionally wins against other beginners. He loses to the stronger players when he gets a chance to play them. This player has 24 hours available to work on chess over the next 12 weeks. What is the best way for this player to improve? Suppose the options are, 1) continue attending chess club for the next 12 weeks, or 2) stay at home and study two hours a week for the next 12 weeks. The study material is Logical Chess Move By Move by Irving Chernev (mentioned above by msluyter). The book covers 33 master-level games in two categories: kingside attack, and queen's pawn opening. Chernev, a Grandmaster, explains the reasoning behind every move in all 33 games. When the player shows up at chess club on week 25, will he be better off having chosen option 1 or option 2?

Re: How to Become a Great JavaScript Developer

#135

Earlier quoted context omitted.

Ah, the "minify" bug: forcing people to put statement separators into a line oriented language. Think of semicolons in JS like colons in BASIC: they let you stack multiple statements on a line. Then, go learn what the language REALLY thinks is the end of a statement, which is not "I put in a semicolon". Too bad JS doesn't use (an explicit) backslash for line continuation, rather than guessing when a line/statement wa…

Missing semicolons have more pitfalls than just minifiers being naughty. return someExpression will parse out as: return; someExpression; and you have assumption of function call in x = y (z).whatever() which parses out as x = y(z).whatever() Nothing hint or lint wouldn't catch though. IMHO, you really need to be special to avoid explicitly writing out semicolons, but to each his own. I can maybe give it a point for…

Only evil people put their return value on a second line...

Regardless:

http://blog.izs.me/post/2353458699/an-open-letter-to-javascr...

Although to be fair:

http://benalman.com/news/2013/01/advice-javascript-semicolon...

Re: How to Become a Great JavaScript Developer

#136
post #90

No. Not this. Net even close to this. Let me illustrate: How to become great at Sports: - Read books about sports. - Watch other people play sports. - Read in-depth analysis of past sports games. How to become great at Playing Violin: - Read books about playing violin. - Real sheet music by the great masters. - Listen to many concerts. It's inherently obvious that the above approaches are totally and completely wrong…

Knowledge work is different. How to become great at Chess: - Read books about chess. - Watch other people play chess. - Read in-depth analysis of past chess games. How to become great at Math: - Read books about math. - Watch other people perform math. - Read in-depth analysis of math. You also skipped a key assertion from the author: "Do exercises and try to explain common JavaScript concepts such as inheritance in…

Dunno about chess, but when it comes to doing original pure math research, bookwork is necessary but not sufficient. Practice is also necessary, and lots of it. Even when it comes to reading math textbooks, the exercises are the most important part.

Re: How to Become a Great JavaScript Developer

#137
post #60

Earlier quoted context omitted.

This made me gag, years ago: // Statements can be terminated by ; doStuff(); // ... but they don't have to be, as semicolons are automatically inserted // wherever there's a newline, except in certain cases. doStuff() // Because those cases can cause unexpected results, we'll keep on using // semicolons in this guide.

I haven't gotten much into Javascript yet, but is there any reason I would not terminate with semicolons? Without understanding which "certain cases" won't have them inserted automatically, relying on that feels like asking for trouble.

I don't, simply because I don't need to. I'm aware there are edge cases to that, but they're usually edge cases caused by doing very odd things.

Re: How to Become a Great JavaScript Developer

#139
post #3

Earlier quoted context omitted.

As minimalistic as your comment is, I think it points to the single most important truth about JS: It's practically impossible for human beings to write “good” JS code. The only hope you have is using a sane language with sane concepts that can be compiled down to the JavaScript of the week (ES6, ASM.js, the works...). I would argue that JS should be handled analogously to Assembler: Good for you if you understand it…

> I think it points to the single most important truth about JS: It's practically impossible for human beings to write “good” JS code. I'm sorry, but that's just an absurd statement. JS isn't that bad or confusing.

It's so easy to write code and have something running. It's a whole other affair with regards to a 'structured' project involving a team of devs. If you look at the myriad of libraries and frameworks for JS, just so the dev workflow stays at a sane level without ending up with masses of balls of muds. Including a .js within a .js has to be done outside of the language ... and that is just the tip of the iceberg last time I checked.

Re: How to Become a Great JavaScript Developer

#140

Earlier quoted context omitted.

Well I mentionned Dart because it is a very small step up to learn when you know Javascript. Not sure the same can be said of JS -> Haskell ... don't get me wrong I started looking into Haskell and I find it fascinating!

Instead of JS -> Haskell I think I'd recommend JS -> Purescript[0][1] 0: http://www.purescript.org/ 1: https://leanpub.com/purescript/read

Ahh yes, PureScript is definitely a good suggestion.
Post reply on HN