Live data from Hacker News

Show HN: My new JavaScript MVC framework

lhorie.github.io

61–70 of 167 posts

Re: Show HN: My new JavaScript MVC framework

#62
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?

Framework fatigue is understandable. Need? No. Want? Yes and maybe. Fortunately, no one's forced to use any one thing. That's because of the answer to your question: yes, no, and maybe. Do we really need another app? Another book? New languages? More music? Yet another program? People choosing their time and pursuits is what leads to countless dead-ends and countless progress. One might want to fear a day when the generality of a no displaces the spirit of a yes, about whether an activity is justified inherently.

Re: Show HN: My new JavaScript MVC framework

#63
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)?

I don't like rewriting boilerplate code for every new project-- as I see it, Angular is to jQuery what jQuery is to raw JS, just in terms of reimplementing basic functions for the nth time.

Of course, if a framework automates a ton of functionality, it'll naturally be inappropriate for certain projects. I wouldn't try to use Angular for an HTML 5 game, for example, though there's a good chance I wouldn't use jQuery either.

Re: Show HN: My new JavaScript MVC framework

#64

I've become a huge fan of simple things. When I was just starting out developing software, I was a big fan of huge integrated solutions. But as the years went on I loved well scoped, lean options. This is the reason why I like Backbone.JS instead of Angular. The reason why I like Go instead of Java. Mithril looks really promising! Don't let feature creep turn it into a behemoth! Keep it lean and mean, and excel at th…

I think this is the same taste-maturation that many woodworkers experience. At first, you salivate over these crazy, overly specific, over engineered power tools. Over time, you start to really love things that are stupidly simple instead, like a card scraper, or a hand plane.

Re: Show HN: My new JavaScript MVC framework

#65

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…

I want this

Re: Show HN: My new JavaScript MVC framework

#66
Hi, Mithril's author here. I'll just put a big comment here, and hopefully everyone can see it.

@stronglikedan: I don't have plans for extending the core (in fact, keeping it small and modular is a major focus point for me). I do have a list of things I want to tackle next (see the roadmap page), but I'll most likely release them separately from core.

@hcho: re: integrating w/ jQuery: see the integrating w/ other libraries page in the guide section. There's a simple example w/ select2 there.

@abjorn: those are excellent points. Re: turing completeness: my take is that things like good error messages in the view layer are more important than trying to prevent people from doing stupid things (that's what code reviews are for). Re: Bindings: I'm most familiar w/ Angular ones and yes, their bidi-bindings are really convenient, but they fail in some 5-10% of the use cases for me (either by being too aggressive or not expressive enough). So, that's a conciseness vs power trade-off in design from my personal experience. Re: templating, you can take the model-level utilities and integrate w/ other templating libraries. I do provide some comparisons w/ React and a few other frameworks in the misc section of the guide, as well as design rationales in the main guide page. TL;DR I use other frameworks full-time and I've done homework before I settled on the current implementation :)

@hanburglar I do provide a tool to convert HTML to Mithril (although not automated yet), see the "useful tools" page.

@timmiwil: you're right, jQuery is not MVC (I mention this in the comparisons page). The point is that with idiomatic jQuery, the app developer is responsible for knowing when to use .text() instead of .html(), whereas with, say, idiomatic Angular, that's not a concern, ever. jQuery "templating" tends to get pretty hard to audit as widgets become more complex (see select2 source code, for example)

@tzaman: I do contribute to Angular and other projects that I use as time permits (mostly bug reports)

@BaconJuice: it's a side project, but a scratch-an-itch one that I work on pretty much every night. Planning on continuing work on it for the foreseable future. I'm also considering introducing it at my day job as well.

@all: thank you for the feedback, I really appreciate :)

Re: Show HN: My new JavaScript MVC framework

#67
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)?

Frameworks add to codebase maintainability, not to user experience.

Re: Show HN: My new JavaScript MVC framework

#69
post #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"?

That's sort of like the tone Microsoft took after releasing ie6. Landscapes change. Every single js framework in existence today will be unfit for purpose in 10 years. So we enhance the frameworks we have and try out new ones so in 10 years time we don't find ourselves stuck with tools that don't work anymore.

Re: Show HN: My new JavaScript MVC framework

#70
post #63

Earlier quoted context omitted.

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)?

I don't like rewriting boilerplate code for every new project-- as I see it, Angular is to jQuery what jQuery is to raw JS, just in terms of reimplementing basic functions for the nth time. Of course, if a framework automates a ton of functionality, it'll naturally be inappropriate for certain projects. I wouldn't try to use Angular for an HTML 5 game, for example, though there's a good chance I wouldn't use jQuery e…

> I wouldn't try to use Angular for an HTML 5 game, for example, though there's a good chance I wouldn't use jQuery either.

I actually did use Angular for an HTML5 game last week as part of a demo for a conference. Admittedly it was a really simple game (tic tac toe), and it did use Polymer as well as angular, as sort of an experiment. But it worked pretty well, and only took about a day and a half to hack together, with realtime multiplayer and chat using socket.io.

Obviously you're going to run into things that Angular is not really ideal for, but we are trying to make it do what it does very, very well, so in the future it should be suitable for pretty much any mobile or desktop app.

---

This sounds like evangelism, which is not my intent, you're absolutely right about what you're saying, but it's true, sometimes a framework works (and saves a ton of time) that you'd otherwise spend hacking together something awful. Hopefully this mithril thing also saves people a ton of time without them having to worry about numerous other issues.

Post reply on HN