Live data from Hacker News

Vanilla JS, fast, lightweight, cross-platform framework

vanilla-js.com

51–60 of 134 posts

Re: Vanilla JS, fast, lightweight, cross-platform framework

#51
post #16

Earlier quoted context omitted.

jQuery API is not pretty

I am a c developer, now I want to learn jQuery , but its syntax seems so weird to me, Vanilla JS looks more comfortable to me , one questions, does it supported by webkit?

Look at other libraries. I cant beat the MooTools drum loud enough.

Re: Vanilla JS, fast, lightweight, cross-platform framework

#52
post #22

Earlier quoted context omitted.

The jquery version is easier to write, and less prone to error, but in the native version it's much more clear what's actually going on.

Also in the native version, you know you're only doing the work required. The jquery one will be doing a lot of extra useless inefficient grunt work to achieve nothing. Making it incredibly slow in comparison.

The jquery one will be doing a lot of extra useless inefficient grunt work

Such as?

Re: Vanilla JS, fast, lightweight, cross-platform framework

#53

Earlier quoted context omitted.

I am a c developer, now I want to learn jQuery , but its syntax seems so weird to me, Vanilla JS looks more comfortable to me , one questions, does it supported by webkit?

I'm sorry. I don't know if you're joking or are serious. But if you're a C programmer and have no experience with JS I guess it must be really easy to be fooled by this "joke". Some JS people (the ones usually with a long beard) hate how kids use frameworks like jQuery and this site is an attempt at telling them "The vanilla JS, i.e. the standard language that all browsers use and your cool jQuery leverage under the…

there's no block scope. Only function scope.

There is global scope as well, and it's (unfortunately in most cases) the default.

Re: Vanilla JS, fast, lightweight, cross-platform framework

#54
post #50
post #10

Recently, I was interviewing a front-end developer candidate and I gave them a simple JavaScript problem. The sad thing was, they didn't recognize `document.getElementById()` and didn't know any of the parameters to `addEventListener()`. We finished the exercise assuming the example used jQuery instead.

That's a fair assumption since most of front-end development is done using jQuery as far as the DOM goes. Did you expect your interviewees to have memorized APIs? There's Google so that you can look up those when needed.

I agree. I think it's important to know Javascript as a language well, but there are very few cases when you'd be using Javascript without some abstraction from the DOM.

Re: Vanilla JS, fast, lightweight, cross-platform framework

#55
post #38
post #25

I can't be the only one getting tired of sites like this making the front page. Really? It would be one thing to see someone write a legitimate article on why they think the move to JS frameworks is harmful and/or the benefits of using plain JS, and for that to make it to the front page. I'd be interested in that perspective. But this is just somebody being snide. It's the internet equivalent of the kid on The Simpso…

If you'll look at the comment below, you'll see a rather interesting discussion going on. Jokes can be an effective way to start a dialogue.

You're right. And now I feel bad that my whiny comment is the top-rated one, edging out that interesting discussion, but oh well. Hopefully I motivated people to prove me wrong. :)

Re: Vanilla JS, fast, lightweight, cross-platform framework

#56
post #23
post #9

Fast and lightweight, yes. But vanilla-js is certainly not cross platform ;) You see, that's actually one of the biggest problems with JS and one of the main reasons why people use things like jQuery (apart from the pretty API..). That cross platform bit is the weakest link sigh .

If you're only targeting modern browsers (latest Chrome/FF/Opera/Safari, IE10), is this still true? I was under the impression the recent browsers were standards-compliant enough that you could use vanilla JS. Of course, most developers still have to target older browsers, but for a private Web app where you know your target audience, this shouldn't be a huge issue.

Until Microsoft either discontinues support for Windows XP or releases a modern version of IE for it, libraries like jQuery are all but necessary, in my opinion.

Re: Vanilla JS, fast, lightweight, cross-platform framework

#57
post #9

Fast and lightweight, yes. But vanilla-js is certainly not cross platform ;) You see, that's actually one of the biggest problems with JS and one of the main reasons why people use things like jQuery (apart from the pretty API..). That cross platform bit is the weakest link sigh .

Aren't the polyfills pretty good nowadays?

Re: Vanilla JS, fast, lightweight, cross-platform framework

#58
post #50
post #10

Recently, I was interviewing a front-end developer candidate and I gave them a simple JavaScript problem. The sad thing was, they didn't recognize `document.getElementById()` and didn't know any of the parameters to `addEventListener()`. We finished the exercise assuming the example used jQuery instead.

That's a fair assumption since most of front-end development is done using jQuery as far as the DOM goes. Did you expect your interviewees to have memorized APIs? There's Google so that you can look up those when needed.

Not recognising document.getElementId is pretty bad, though. It's perhaps the most basic and commonly used part of the DOM itself.

Re: Vanilla JS, fast, lightweight, cross-platform framework

#60
post #2

http://vaporjs.com/ is way better, and was here first.

I prefer semicolon.js, more secure and reliable :) https://github.com/madrobby/semicolon.js

Actually, function.js is vastly superior as readers of "JavaScript: The Good Parts" will know: https://github.com/TazeTSchnitzel/function.js
Post reply on HN