Live data from Hacker News

JavaScript: The Right Way

jstherightway.org

111–120 of 136 posts

Re: JavaScript: The Right Way

#111

Having recently started getting into Javascript, I have to say it is the most confusing ecosystem ever. Learning the basics of the language is easy enough, but as soon as you start trying to create a non-trivial application, bam, you're hit with information overload - X framework, Y library. It's different from Python, Ruby et all because at least with them, there are good consistent popular choices that you can rely…

There's a lot of choices, and that's not a bad thing necessarily. Javascript is in a heavy growth period right now. But I totally get the choice overload thing. There's a lot of people interested in javascript from all different areas of computer land, and they all have different ideas of what "best" is, and they all want to make javascript more like lisp, or more like ruby, or more like java, or more like c# or more…

Is there any strong reason to use Underscore over Lodash?

Re: JavaScript: The Right Way

#112

Earlier quoted context omitted.

I think that's a naive way of thinking about the problem. Do people write rich server-side web apps in Plain Ol' Python? Of course not. Why reinvent the wheel? For a tiny app, sure, maybe it's not so bad to just use jQuery. But if you're working on something with a very rich front-end architecture, a framework gives you a very necessary...er...framework to use to eliminate boilerplate and organize your work. Not only…

Do people write rich server-side web apps in Plain Ol' Python? Perhaps not, but plenty of us write them using a lightweight framework like Flask rather than heavyweights like Django, and even in a relatively mature field like ORMs, there are downsides to using them that sometimes outweigh the advantages. For a tiny app, sure, maybe it's not so bad to just use jQuery. I've got ~100,000 lines (before minimising etc.) a…

That's great, but it sounds like this project predates the modern frameworks. It probably doesn't make sense to try to shoehorn it into a framework at this point. But to write 100,000 of framework-less JS today on a green field project seems ridiculous. 5 years ago, some person was probably bragging about their 100,000 line app built without jQuery. 5 years from now, someone will be bragging about how all they use is Backbone.

Re: JavaScript: The Right Way

#113

Having recently started getting into Javascript, I have to say it is the most confusing ecosystem ever. Learning the basics of the language is easy enough, but as soon as you start trying to create a non-trivial application, bam, you're hit with information overload - X framework, Y library. It's different from Python, Ruby et all because at least with them, there are good consistent popular choices that you can rely…

There's a lot of choices, and that's not a bad thing necessarily. Javascript is in a heavy growth period right now. But I totally get the choice overload thing. There's a lot of people interested in javascript from all different areas of computer land, and they all have different ideas of what "best" is, and they all want to make javascript more like lisp, or more like ruby, or more like java, or more like c# or more…

Is there a good, focused, website where these .js tools are discussed on an ongoing basis? Yes, I know HN and a thousand other places scattered all over, and maybe that's really all there is, but I'm hoping there's a way to figure out what .js tools ought to be used for what, and keep abreast of changes, without having to read the whole Internet.

I suppose I could ask experienced developers on StackOverflow.... (Just kidding! "Stop! Silence! Nobody answer him! Not constructive! Not Constructive!")

Re: JavaScript: The Right Way

#114
I started web development 8 months ago. First I started by reading "The good parts" but honestly it's not really a good book to learn from 0 with.

The thing that really got me going? Typescript. Not only does it help with abstracting javascript syntax, but the intelisence made me not have to google every 20 characters i write.

Re: JavaScript: The Right Way

#115

It funny, but clicking to this link caused high CPU usage for N seconds and message from Firefox: A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete. Script: http://jstherightway.org/js/jquery.js:1144

happened to me as well and eventually I had to close firefox. oh the irony! (but lots of nice links on the site for sure..kudos to the creator)

Re: JavaScript: The Right Way

#116

Earlier quoted context omitted.

Do people write rich server-side web apps in Plain Ol' Python? Perhaps not, but plenty of us write them using a lightweight framework like Flask rather than heavyweights like Django, and even in a relatively mature field like ORMs, there are downsides to using them that sometimes outweigh the advantages. For a tiny app, sure, maybe it's not so bad to just use jQuery. I've got ~100,000 lines (before minimising etc.) a…

That's great, but it sounds like this project predates the modern frameworks. It probably doesn't make sense to try to shoehorn it into a framework at this point. But to write 100,000 of framework-less JS today on a green field project seems ridiculous. 5 years ago, some person was probably bragging about their 100,000 line app built without jQuery. 5 years from now, someone will be bragging about how all they use is…

But to write 100,000 of framework-less JS today on a green field project seems ridiculous.

Why? I've worked on non-web software projects 1-2 orders of magnitude bigger that didn't need anyone's magical framework to develop and maintain a sound architecture. How come we can't just use good design that fits the project if the software we're writing happens to be the front end for a web app?

It's about picking the right tool for the job, the same as always. For some projects and some development teams, I'm sure these modern JS frameworks and tools have proved valuable and will continue to do so. On the other hand, we're currently planning another web app that is expected to grow at least as big as the one I described earlier, and no-one on the team is seriously considering using any of the current crop of front-end frameworks. That's not because we don't know what they do or how they work. It's simply because none of us thinks it's a smart idea to build such a large and hopefully long-running project with a fundamental dependency on the kind of technology that typically measures its time at the top in months.

Re: JavaScript: The Right Way

#117

Hey guys! I see there's a lot of great suggestions and critics here! Since it's an open source project, you can feel free to open a pull request telling which resource you think it's better to be there, or which one should be removed. As well help me correct the grammar errors. I'm from Brazil, and my english is not that good. I'm really glad about all the opinions, and for sure the site will be improved from now on.…

How does this website relate to this repo [1]? I was going to contribute some fixes to the page, but when I cloned the repo, I found significantly different content. I'm also confused as to why the website [2] says that it is based on itself [2] at the bottom of the page.

[1] https://github.com/braziljs/js-the-right-way [2] "Based on a work at http://jstherightway.org"

Re: JavaScript: The Right Way

#118
post #86
post #65

Some additional comprehensive JS resources: http://eloquentjavascript.net/ http://shichuan.github.io/javascript-patterns/ https://github.com/airbnb/javascript

Dont forget: http://addyosmani.com/resources/essentialjsdesignpatterns/bo...

Thanks this one is awesome, I had never seen it before.

Re: JavaScript: The Right Way

#119

The command pattern is featured in the article. Why would you use that pattern in a language that supports first-class functions?

For tasks that are created, executed, and processed purely in code, you wouldn't. But it still has uses in other areas, especially when you need to build something up from user input.

Could you give a concrete example? Why wouldn't you be able to use first-class functions when building something up from user input? How about giving us a code snippet? The consensus in the CS community is that the command pattern disappears (becomes overkill) for languages with first-class functions. This has been noted as early as 1998 by Norvig when comparing C++ to Lisp. It's one of my criticisms of Addy's JS Patterns book. He just blindly copies the GoF patterns and many of them are not needed in languages with modern features.

Re: JavaScript: The Right Way

#120
post #22

"JavaScript has strong object-oriented programming capabilities" What would be an example of a language with weaker OOP capabilities? PS: "The bad parts" section did not fit the page?

Java would be an example of a language with weaker OOP capabilities. Javascript can emulate classic OO inheritance and it also supports prototypical inheritance. Crockford covers this in his Good Parts book, and you can find stuff around the web.
Post reply on HN