Live data from Hacker News

Show HN: My new JavaScript MVC framework

lhorie.github.io

41–50 of 167 posts

Re: Show HN: My new JavaScript MVC framework

#41

new function(window){}(this) is kinda weird to me. Sorry that's nothing valuable to add to your code.

Correct me if I'm wrong, but what this does is: 1) allows the code to be run in an environment where 'window' is not the global object (perhaps for testing), and 2) in a browser, gives the caller the option to isolate the module code so it's not allowed to touch 'window'.

Re: Show HN: My new JavaScript MVC framework

#42
post #36

Here are my thoughts, but you won't like them. Stop with the frameworks. Learn Javascript. Learn CSS. Learn HTML. You'll find pretty quickly that what you need are libraries , not frameworks. Things like jQuery, underscore, etc...

That's similar to my viewpoint. Stop with all the frameworks - what new, powerful functionality will it provide your users that existing things can't do (ie JQuery, raw JS)?

Re: Show HN: My new JavaScript MVC framework

#43

Hi lhorie, I like this. I want to use this. How long will this supported is my concern. Or is this a fun side hobby you worked on and plan on moving on to the next with no future updates? Cheers.

It's open source. You provide the support and updates.

Re: Show HN: My new JavaScript MVC framework

#46
post #36

Here are my thoughts, but you won't like them. Stop with the frameworks. Learn Javascript. Learn CSS. Learn HTML. You'll find pretty quickly that what you need are libraries , not frameworks. Things like jQuery, underscore, etc...

When I saw the link title, my first thought was "why do we need yet another new MVC Javascript framework"?

Re: Show HN: My new JavaScript MVC framework

#47
The approach we've taken in our anti-framework is that the model is your data (and the code you use to manipulate the data), the view is your HTML/CSS (not a special templating language -- actual HTML), and the controller is automatic for simple stuff and custom for complex stuff.

So the big example at the end of Mithril would, for us, be something like (we implement binding as a jQuery extension)

$('.display').bind(data);

Where .display selects the root node of the bound UI, and data is our object.

Which is simpler and less code, I think. (Oh and our binding library has jQuery as a dependency, but is sub 3kB minified and gzipped.)

That said, we haven't put our libraries on github yet :-(

Re: Show HN: My new JavaScript MVC framework

#48
post #36

Here are my thoughts, but you won't like them. Stop with the frameworks. Learn Javascript. Learn CSS. Learn HTML. You'll find pretty quickly that what you need are libraries , not frameworks. Things like jQuery, underscore, etc...

That's similar to my viewpoint. Stop with all the frameworks - what new, powerful functionality will it provide your users that existing things can't do (ie JQuery, raw JS)?

Faster development, potentially less bugs, conventions, etc. All of that is highly dependent on what your projects needs but I can't imagine writing some of the Ember apps I've worked on in just plain jQuery while maintaining a clean and readable code base.

You eventually end up writing your own framework of sorts anyway when you take minimal path.

Re: Show HN: My new JavaScript MVC framework

#49
your "getting started" page is like a crash course in building websites with javascript - just forwarded it to a bunch of friends

it felt like you were giving a smart person a crash course in javascript

wish more apps sturctured their tutorials like this

great job!

One thing: it feels like it's aimed at people who are already competent at javascript

but your tutorial isn't too many steps away from a being solid "javascript for absolute beginners" guide

So would be cool if you made it slightly more beginner friendly, like I'm sure you're losing a lot of engagment and users because they read the first line of your guide and immediately think it's too complicated

"Mithril is a client-side Javascript MVC framework, i.e. it's a tool to make application code divided into a data layer (called "Model"), a UI layer (called View), and a glue layer (called Controller)"

Like I'd suggest adding a VERY simple sentence about why you'd want to use javascript AT ALL

both on the guide and the start page

like if someone landed on your page and they were good at HTML and css but never really programmed, they could probably use your framework to build their first programming project if you made it a little more beginner-friendly

great work! :)

Re: Show HN: My new JavaScript MVC framework

#50
post #37
post #15

I don't mean this in a bad way, but do we really need another Javascript framework? Wouldn't author's energy be more useful when contributing to one of the existing ones?

Not sure why I'm getting downvoted, it was a serious concern I expressed, with 0 intent of insulting anyone

You're getting downvoted because this guy thought it was an interesting problem to think about, sat down and put some effort in, came up with something he liked (and which appears to be very good) and wanted other people to see it, and your input was, "isn't this a waste of time? People have done this before!"

The fact that frameworks are appearing at a ridiculous rate is also the reason people still feel compelled to make their own: the existing ones sometimes feel thrown together and flawed in obvious ways, so people automatically think about ways they could be better and try those things out. The result is progress (edit: sometimes the result is a bag of crap, but that's beside the point).

No, we don't need more frameworks. And yet that still isn't a good reason to stop building them, if for no other reason than to explore for yourself what goes into building one (if that's your interest).

Post reply on HN