Live data from Hacker News

JavaScript: The Right Way

jstherightway.org

41–50 of 136 posts

Re: JavaScript: The Right Way

#41

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…

Backbone may or may not be right for you. Fortunately it's small, and fairly easy to read. The annotated sources [1][2] for BackBone and Underscore are fairly accessible.

Also, I would highly recommend adding an AMD loader like require.js to your "basics kit". Code organization gets very important very fast, and it helps to think modular-and-reusable from the beginning.

[1] http://underscorejs.org/docs/underscore.html

[2] http://backbonejs.org/docs/backbone.html

Re: JavaScript: The Right Way

#42

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…

It's funny, even as someone who knows js really well, having worked with it for a decade (actually, longer!), the explosion in the ecosystem took me by surprise.

I left my web agency role over a year ago to work on my start up with a friend so I've been in relative developmental isolation (lots of python and js, not so much keeping up with the latest trends). I came back to help out on a project recently and had to spend a day researching all the new tools. Particularly around package management, bower, grunt, yeoman, node, npm etc. A year ago a js lib was generally delivered as a js or min.js file. Now there's the whole system to sit around it; every project on github now seems to include the config for each of the different package managers. Even a vagrant file so you can get it all up and running on a brand new vm.

Something as simple as adding bootstrap to a project. It's not totally obvious when you first look at it. Where does the code go? How do you compile it in such a way that you don't touch the vendor src itself but you can customise it etc. I have a method that works for me, but I had to play around a little to figure out how to fit it to my needs.

Once I got through that stage I was really happy with where things were at. JS libs are nice and easy to install and version control now, dependency management with bower has worked really well for me so far. Grunt makes the automation side of development nice, contained and easily shared. All in all it's a really good transition.

I'm lucky in that I've been developing for the web since people were changing files in ultraedit and ftping to the live server to see the changes. When each new thing comes along I only have one new thing to learn. Step away for a year and suddenly there's a lot to figure out to get back in to it.

I can only imagine how daunting it could be for a complete newbie trying to find their way.

As ever these tools can be great, but you ultimately you really want to understand what goes on underneath so they don't limit you too much. Amazing talk on this subject posted by another HNer in a comment the other day - https://www.youtube.com/watch?v=ShEez0JkOFw

Re: JavaScript: The Right Way

#43
> "Different from C, C# and Java, JavaScript is an interpreted language. It means that it needs an "interpreter"."

I have an issue with the above statement. There are no compiled or interpreted "languages". There are only implementations.

There's nothing preventing someone from "compiling" it.

Re: JavaScript: The Right Way

#44

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

Same here. Probably one of those modern web sites optimized for Google Chrome.

Re: JavaScript: The Right Way

#45
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.

Thanks!

Re: JavaScript: The Right Way

#47

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…

I understand the whole 'paradox of choice' thing - but this should never be seen as a negative. It is a sign of a strong, healthy community making lots of progress.

If you're looking for popular tech, i think a good proxy is github stars.

Re: JavaScript: The Right Way

#48

> "Different from C, C# and Java, JavaScript is an interpreted language. It means that it needs an "interpreter"." I have an issue with the above statement. There are no compiled or interpreted "languages". There are only implementations. There's nothing preventing someone from "compiling" it.

The distinction can very much exist in practice, depending on the existence and capabilities of production-quality implementations.

While there have been attempts to compile a language like Python down to native code, they are still very limited and not useful in a practical sense. Hence, Python is a de facto interpreted language, since its usable implementations are implemented as interpreters.

The same goes for JavaScript today. Given that all of the usable implementations are interpreters, JavaScript can currently be considered an interpreted language.

Re: JavaScript: The Right Way

#49
I occasionally code in Javascript and I always get the feeling that I'm working with a language without a decent built-in standard library.

Want to work with dates? Use a third party library (or use built-in 1995-style library). Want to format a string? Use a third-party library. Want to do X? Use a third-party library.

Coding in e.g Python feels completely different: almost everything I need is in the standard library.

Re: JavaScript: The Right Way

#50
Is there a "too clever" mentality in frontend web dev culture of late? An overly fragmented workflow toolset?

Not sure the cause, perhaps the influx of engineering "computer science disciplined" brains into the frontend world. Or a panicked competitive race to achieve a nirvana dev environment. Or a tendency to think that workflows for large websites with countless modules is the best workflow for a one-page web app.

Overkill for the intended task, or cluttering your project with too much technology, is the thing to watch out for in the frontend aspect.

Layers of tools and libraries and plugins can easily get out of control and beyond a joke. Don't forget you've got a web app to build while you mess around with the "right way" to build it.

You do not need a cup-holder on your scaffolding.

Just using plain JS with Jquery, and perhaps some additional smaller specific plugins/libraires, is enough to do a lot of cool stuff if we're talking "javascript" projects. Then just get a good editor and off you go.

Post reply on HN