
JZed.js – The functional JQuery alternative - SEMW
https://github.com/zedshaw/jzed
======
sdegutis
> _This also only really works on IE9 and maybe IE8 or better, but honstly IE6
> and IE7 users users can seriously go fuck themselves with a dirty brick._

This kind of language doesn't belong in a software project, let alone its
README, and is very likely one of the reasons software professionals are often
not treated like professionals.

~~~
merijnv
And what kind of language _does_ belong in a software project? He's literally
giving away work he did in his own time for free and you complain about the
language he used when he did so?

If you don't like the language, don't use the library? Seems a simple
solution.

~~~
sdegutis
That sounds nice, but I don't think it works that way. People see software
projects like this, and they develop impressions that software programmers are
not professional. The result is that programmers are not treated like
professionals.

~~~
jeremiep
I would pick Zed's code over the code of a "professionnal" any day. I prefer
direct, raw and to the point language over watered down politically correct
speech any day. The former cares about substance while the later cares about
appearances.

After years in the industry, I've become weary of the word "professionnal". It
doesn't mean youre talented, it doesn't mean you have a good understanding of
how computers really work. It only means you're good at being politically
correct.

And that has very little value when it comes to developing software. You can't
describe something rational using emotional language.

~~~
sdegutis
"Politically correct" seems to mean "being respectful, courteous, and
considerate of everyone involved". I fail to see how that's a negative thing
to be avoided, or how it's "watered down".

~~~
jeremiep
That's negative if you use it as a filter. I'm not saying being polite is
wrong, far from it. What I'm saying is that professionalism is a mediocre
metric in our industry. Just like lines of code is a mediocre metric for the
progression of a project.

Both metrics look good on the surface. Yet using them shows a very poor
understanding of what engineering is.

------
maaaats
>> I'm doing a bunch of work with CORS and requiring target sites to use
jquery is insane when I just need a few little things.

Why would target sites need to have jquery?

~~~
fiatjaf
I don't understand this also. Isn't CORS a server thing? I have used CORS, but
still don't understand this.

------
binarymax
I'm a fan of min.js[0], as it is closer in spirit to jQuery. Looks like the
major addition this has is the XHR. Not sure how I feel about the individual
$method style, but it looks like you covered almost anything one would need!

[0] [https://github.com/remy/min.js](https://github.com/remy/min.js)

------
grannyg00se
I'm guessing zed was bored - or just felt like trolling?

The library isn't "functional", does very little of use, and horribly pollutes
the global name space.

Maybe he just felt like venting about jQuery overuse and snobby programmers.

------
gexla
> The library is tiny. Seriously, just go read the code. It's good education

Thanks, Zed! I really appreciate what you have done for helping in education
in other programming languages. Reading a small library which does much the
same as Jquery is a great addition to your materials. I may not use this as a
Jquery replacement, but I will certainly be looking through the code to see
what I can learn from it. I spend far too little time in the front-end and
it's time to change that.

Edit: Edit: Okay, you guys didn't like my joke. So I removed the joke and
expanded on the first part of my comment.

------
ryanackley
If this interests you, check out [http://zeptojs.com/](http://zeptojs.com/).
Seems like the same concept.

~~~
binarymax
Zepto really aims to match the jQuery style and the majority of methods while
trimming the fat and sacrificing browser compat, and weighs in at 9.2k min
gzipped.

I'd say the only thing this has in common with jQuery is the use of the $.
Most of the methods here can be found in many homegrown toolboxes. There is no
chaining and no relationship to any of the methods here.

~~~
ryanackley
I guess the semantics really matter to some people but a few direct quotes
from the Readme

 _JZed is my alternative to JQuery_

 _This is a tiny amount of code that has enough of the functionality found in
JQuery_

 _then I filled it out with more based on the list
at[http://youmightnotneedjquery.com/](http://youmightnotneedjquery.com/). _

The semantics are different but the functionality is completely based on
jquery.

------
jiggy2011
This is a wrapper around the DOM API, nothing like jquery at all.

~~~
coldtea
You know that jQuery is primarily a "wrapper around the DOM API", right?

~~~
jiggy2011
Not exactly, jquery offers it's own API which is what makes it powerful and
allows for it's method chaining, plugin system etc. A $(".className") returns
a jquery object , not a DOM element.

~~~
coldtea
> _Not exactly, jquery offers it 's own API_

Yes, that's the definition of a wrapper: it offers it's own API.

~~~
jiggy2011
jquery is really it's own abstraction, the jquery API allows you to interact
with jquery objects which can do DOM manipulation on your behalf. This library
literally returns DOM objects.

------
Kiro
I don't understand the talk about CORS. In what way does this library help
CORS stuff and what situations is he referring to exactly?

------
the-kenny
What makes this library functional?

------
asattarmd
I see nothing that makes this library "functional".

------
EGreg
Pull requests like this show it's rather immature so far:

    
    
      Fixed $next() and $previous() not returning anything - 2 hrs ago

------
amasad
So how is it "more functional"?

------
jbeja
Don't like to much the name, is so "egoista", but i love the functional
approach :).

~~~
gdw2
In the Readme he says he picked that name to annoy people!

~~~
bct
Annoying people is easy, I don't know why he would go out of his way to do it.
It's certainly not something to be proud of.

------
joiguru
How cross browser is this thing? Does it at least support all the browsers
versions as JQuery v2?

~~~
damon_c
_This also only really works on IE9 and maybe IE8 or better, but honstly IE6
and IE7 users users can seriously go fuck themselves with a dirty brick. I may
add a function to detect these two bad browser so people can start forcing
them to use a real browser for a change._

------
grexi
I like the idea, but the tone of the docs is a little too rough for me
(although I don't consider myself a functional snob).

[http://www.snapbugz.com/p/98f1d5a6](http://www.snapbugz.com/p/98f1d5a6)

------
arkitaip
I'm really liking the idea of having lots of new $ instead of chaining/burying
things like jQuery does. Most of the functions are bareboned but as a concept
it looks interesting.

~~~
deckiedan
The reason jQuery (and _.js, and others) do this is so that you minimize the
number of global variables/functions used.

------
zackious
Looking through your code, you have some name mismatching in $parse. Best of
luck.

------
agilebyte
Would be nice to detect CommonJS environment and not export to the global
scope.

------
bluepill
Always nice stuff, it would be cool if Zed would publish this on npm or Bower.

------
adito
This gives me an idea of reimplementing jQuery as part of learning javascript.

~~~
fiatjaf
Don't do that, do something no one has ever done.

------
bachback
cool, this guy is doing some good work.

see also mongrel2, a language agnostic webserver
[https://github.com/zedshaw/mongrel2](https://github.com/zedshaw/mongrel2)

------
bdfh42
function $new(tag, id, html) looks like it has a bug.

next line should read var new_tag = document.createElement(tag); not var
new_tag = document.createElement("div"); unless I am missing something

~~~
scotth
Isn't this what GH Issues is for?

~~~
bdfh42
Zed actually fixed it - this joke will run and run. Smashing.

------
j_m_b
Thanks! But I've long ago replaced my js with clojurescript.

------
benihana
> _It 's also functional so now LISP hackers can pretend they're both
> JavaScript Oakland Living Node.js gangsters and high class San Franciscans
> with their functionality snobbery._

Oh Zed. Don't ever change, our industry needs people like you.

------
TheRubyist
Zed is dead.

~~~
jbeja
As your comment.

------
gaius
Jay-Z will be along for trademark infringement in 5... 4... Same as Coinye
West!

