"Let's be real, Javascript is the #1 language on Github and for good reason - it runs everywhere." Similarly, anal sex is the best kind because it works on all genital configurations. /snark
No it doesn't; you need at least one penis involved. /taking-snark-seriously
Why Meteor will kill Ruby on Rails
321–330 of 336 posts
Re: Why Meteor will kill Ruby on Rails
#322Earlier quoted context omitted.
Iframes have a couple advantages over XHR: 1. You can do progressive rendering with an iframe. With an XHR you don't get the 'loaded' callback until the entire response has arrived, and so you can't start working with and manipulating the data until it's all there. With an iframe you can put successive chunks in tags and they will start executing as soon as the closing tag for the script is found. Or if you want to t…
Regarding the first objection, you could just send your responses as a series of websocket messages, rather than repeated AJAX request/response pairs. The other two objections I'm not so clear on--maybe because I don't often dynamically construct views by retrieving "presentation" from the server. In what I've seen as "idiomatic HTML5 client-side development", all the views are shipped as templates with the initial c…
As for sending JSON with rich clients vs. rendering HTML on the server; that depends a lot on the intended usage pattern of the app. For apps that you expect will be open for hours at a time, like e-mail or social networking, the former pattern is better - and indeed, GMail and G+ both speak JSON (well, a modified version that gives better latency) to rich client JS. For apps that you open quickly, perform your task, and then close (Search is the canonical example), it's far better to render all your HTML on the server and just ship that down to the browser. There is a large cost to downloading and executing all that JS, and you lose many, many customers if your app is slow.
There are strategic reasons why, if I were founding a startup today, I'd prefer to play in markets where the latter case held, unless I was writing enterprise software. Consumer markets where people spend hours with an app open are rare, and Google/Facebook generally want to own that space. I would rather not compete with them. On mobile, the open-for-hours apps are generally moving to native, where you can interact with the platform's notification API. The sweet spot for long-running webapps is enterprise and intranet applications, which has many fruitful markets, but many technologists shy away from it because there are frequently many arbitrary and difficult requirements.
Re: Why Meteor will kill Ruby on Rails
#323Earlier quoted context omitted.
Regarding the first objection, you could just send your responses as a series of websocket messages, rather than repeated AJAX request/response pairs. The other two objections I'm not so clear on--maybe because I don't often dynamically construct views by retrieving "presentation" from the server. In what I've seen as "idiomatic HTML5 client-side development", all the views are shipped as templates with the initial c…
Yeah, websockets are fairly useful if your data is JSON blobs or other byte data, but awkward if you just want to ship some more HTML for display. They're best used in long-running client applications. As for sending JSON with rich clients vs. rendering HTML on the server; that depends a lot on the intended usage pattern of the app. For apps that you expect will be open for hours at a time, like e-mail or social netw…
Any more details on this (that you're allowed to talk about)? Low-latency JSON-alike communication is something I'd be highly interested in.
Personally, I've investigated BERT.js for this use-case, but it didn't work quite right (likely since the available client library was written to construct binary messages using String.charCodeAt, rather than just writing directly to an ArrayBuffer.) I kind of gave up when I realized I might be--especially on mobile--spending long enough on the pure-JS encoding/decoding processes (versus the browser's native JSON implementation) to lose any gains I'd get from the network. If you know otherwise, I'd like to hear about it.
Re: Why Meteor will kill Ruby on Rails
#324Earlier quoted context omitted.
> And to be clear, Node is not a 100% perfect platform either. Absolutely. But as a software piece, I think it can apply itself to the web more easily than Ruby currently can. > Of all the options available, why Meteor? Right, there are plenty of options, MEAN is getting nicely popularized. You also have Derby. > Like someone on this thread said, it has a lot more evolving to do, to even become on par with rails in t…
First you say > . You just have to do so much glueing In your previous post. Then you list out MEAN(Mongo, Express, Angular, Node), which is all glueing. I have used this stack extensively, and I must say its not even close to Rails. In fact it's not even on the same planet. After all you guys finish your piddly todo lists, start trying to write some real business logic in Node, and see how far it gets you. There is…
First of all, I only claimed you have plenty of glueing in Rails (although you glue when working with anything, it's the degree at which I think is important).
Secondly, I was agreeing with about there being options, I didn't really reply to the "why Meteor", I think I went over that enough.
> I have used this stack extensively, and I must say its not even close to Rails. In fact it's not even on the same planet.
They are both used to build web applications, I think they have many similarities. But yes, they do have a wide range of strength and weaknesses.
> After all you guys finish your piddly todo lists, start trying to write some real business logic in Node, and see how far it gets you. There is a reason the Meteor team chose fibers. You can async.waterfall all you want but structuring your code in a synchronous manner, lets you get stuff done.
I don't find it exceedingly difficult to be productive in Rails, Meteor, or MEAN. Again, each has their strength and weaknesses.
And in terms of structuring code: async or not, you have plenty of options to properly organize it (eg: Deps.autorun, promises, npm's async).
> People tout Node and Meteor for real time stuff.
I think because it tools itself well there.
> I could do similar things with SSE and Rails/Ember or Angular.
Right, no one is taking Rails away from you.
> The users of your applications don't care if you use Websockets
True, most users won't care about the specific technologies used to load a page. But it could play a role in the experience, which is something they will care about.
> and really most of the time you don't even need Websockets, you just need SSE or long polling.
See, here's the thing "most of the time", but not all of the time. So there are cases for each.
Long polling has plenty of cons, and SSEs don't provide you with a bidirectional channel. That's important for some applications.
Re: Why Meteor will kill Ruby on Rails
#325Earlier quoted context omitted.
There is when the client doesn't want to pay for the extra work for the 0.1% of tinfoil hat-wearing people who turn off JavaScript. "You need to spend an extra 30,000 to get this to work for the 3 crypto-anarchist wannabes who live in your state". I don't think the client is going to want to pay for that kind of interop. EDIT: I don't mean to be snarky but you absolutely HAVE to make these kinds of trade offs when wo…
I think you're ripping off your client if such basic functionality as displaying a static page on a website is "extra work" for you.
Screw you buddy.
Re: Why Meteor will kill Ruby on Rails
#326Earlier quoted context omitted.
There is when the client doesn't want to pay for the extra work for the 0.1% of tinfoil hat-wearing people who turn off JavaScript. "You need to spend an extra 30,000 to get this to work for the 3 crypto-anarchist wannabes who live in your state". I don't think the client is going to want to pay for that kind of interop. EDIT: I don't mean to be snarky but you absolutely HAVE to make these kinds of trade offs when wo…
It shouldn't be extra work. It's actually less work because it encourages you to play to the browser's strengths and to separate your concerns. It keeps rendering speed high, it makes it easy to debug issues because you can switch off JS to see if the problem is with the underlying HTML/CSS. If one JS component fails it doesn't take down the rest of the site, and so on. Your website should work in IE7. It's a legitim…
Non trivial example: client wants drag and drop uploads. What browsers support this functionality? Oh we can't do that in browser X Y and Z. Is that a problem? Oh, it turns out it is because manager A promised this to the CEO and she runs IE7 due to corporate IT policies. Crap. OK trade-off time, what should we do? Drag and drop for chrome that my boss runs or just stick to old school uploads? Use some plugin from jquery.com? OK let's do that. Now we have apparent 'automatic fallback' via the plugin but... boss wants it to display the image for confirmation in newer browsers, shit... Does the plugin support this? Yes? No? Let's say no now you're looking for another off the shelf or a roll your own.
Now you can say what you want about 'it should just work bler bler it's easy' but if you extract this attitude out to all areas of a software project you end up with the inmates running the asylum pretty much overnight. Like it or not, but the team or individual you are working with all have varied skill sets and you have to make work with what you have. The trick isn't 'just make it work with javascript off', it's 'deliverer something in the timeframe and on budget with the resources available' and those are different every time you embark on something.
Re: Why Meteor will kill Ruby on Rails
#327Earlier quoted context omitted.
Making repeated prototypes (in est, experiments ), quickly, is how you approach entrepreneurialism in any sort of scientific manner. Nothing needs to scale, or work at the edge-cases, until it has product-market fit; and you might need to write twelve or twenty or two-hundred different apps until you find one that works out that way. That's what makes these frameworks popular with HN: startup founders are not in the…
That's all true, but I'm also beginning to wonder how much you actually need those frameworks to build MVPs quickly. I used to do the bulk of my prototyping with Python + Django + JQuery + Postgres or AppEngine Datastore. Of late, I've switched a lot of it to just straight HTML + Javascript + a JSON feed from backends. If I need server-side computation, I'll build a quick Go or webapp2 app on AppEngine. I work just a…
Re: Why Meteor will kill Ruby on Rails
#328Earlier quoted context omitted.
That's all true, but I'm also beginning to wonder how much you actually need those frameworks to build MVPs quickly. I used to do the bulk of my prototyping with Python + Django + JQuery + Postgres or AppEngine Datastore. Of late, I've switched a lot of it to just straight HTML + Javascript + a JSON feed from backends. If I need server-side computation, I'll build a quick Go or webapp2 app on AppEngine. I work just a…
This is pretty interesting. What causes latency issues with this approach?
Re: Why Meteor will kill Ruby on Rails
#329It's amazing for hackathons. I wrote http://battlehack.meteor.com in 24 hours by myself after having done meteor as a hobbyist for 2 months.
Thanks a ton!
Re: Why Meteor will kill Ruby on Rails
#330It's amazing for hackathons. I wrote http://battlehack.meteor.com in 24 hours by myself after having done meteor as a hobbyist for 2 months.
I've been meaning to learn more about meteor. I've read the official docs, tutorials here and there, but haven't really found any resource that clicked. Would you mind sharing resources you used to learn meteor? My email is sumanyu at hotmail Thanks a ton!