News for hackers. Stuff that matters.
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by highCs on Friday June 12, 2015 @10:17AM (#9705998)
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by applecore on Friday June 12, 2015 @10:06AM (#9705923)
It seems like a lot of these real-time capabilties should be part of the database layer, à la RethinkDB and its model of continuously pushing query results as they're updated.

This way, you're not locked into one JavaScript-based application development framework.

Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by Lazare on Friday June 12, 2015 @10:35AM (#9706118)
CouchDB is possibly a better example, as you actually can have single-page applications connecting directly to the DB for streaming updates.

That being said, I think you're right: Whatever DB, server, or client tech you use, the real-time synchronization stuff seems like a minor add on.

Meteor seems predicated on the idea that you can't do synchronization with whatever random stack you want, but need to use Mongo as the DB, Meteor as the server, and Meteor as the client. This is kinda nuts; you can trivially do it with any tech stack. Postges, Express, and Knockout.JS? Sure, will work great. Firebase and React? Super. MySQL, PHP, and some jQuery soup? Yep. (Hint: Don't do that. But it'll work.) And with all due respect to the Meteor team, I think React or Mithril are much better frameworks than what they're developing.

Honestly, I feel like the Meteor guys have such a bad case of NIH syndrome that I'm always slightly surprisd they're using Mongo, and didn't write their own DB too.

Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by twerquie on Friday June 12, 2015 @10:19AM (#9706010)
But you can't have clients directly connecting to the database, their sockets still need to flow through an application layer where you have your business / application logic. Unless you start putting application logic into the db?
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by enos_feedler on Friday June 12, 2015 @10:52AM (#9706236)
Your right about this. Couchbase solves it by putting a sync gateway in front of a couchdb connection. But this makes things hard to manage for the reason you mention: business logic inside your DB. All your rules about access control and users are actually derived from values in your couchdb documents. Its not pleasant to design or maintain.
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by zippy786 on Friday June 12, 2015 @10:37AM (#9706130)
Shouldn't business logic reside in DB inside stored procedures ?
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by cristianpascu on Friday June 12, 2015 @10:50AM (#9706212)
Only if DB runs JS. ;)
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by jmakeig on Tuesday June 16, 2015 @02:21AM (#9724098)
http://developer.marklogic.com/features/javascript

(Full disclosure: I work at MarkLogic)

Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by murbard2 on Friday June 12, 2015 @10:27AM (#9706056)
This is a bit tangential, but I really don't get the value of using the same language on the client and the server. The advantages I see would be:

1) You need to know / be comfortable with one language less

2) During development, you can easily move functions back and forth between the client code and the server code, progressively deciding what will be computed on the server and what will be computed on the client

3) You can generate, exchange, and execute code in real time between the client and the server

but

1) I don't know any programmer who's both competent and monolinguistic.

3) is of course insane for security reasons

2) I used to think this would be a thing, but once you take the approach of making the client a GUI to an API, this doesn't tend to happen. It's generally very clear what's going to be server side and what's going to be client side.

Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by afshin on Friday June 12, 2015 @10:53AM (#9706239)
I think the biggest benefit of having the same view layer logic on the front-end and back-end is to send pre-rendered views to the client without having to to generate the markup using two different sets of code.

Other than that, your data access and APIs could be written in any language, if you separate your view logic out. React on the client and server makes it easy to have the same view logic without making a similar commitment about the rest of your business logic.

Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by roneesh on Friday June 12, 2015 @10:52AM (#9706235)
I sort of agree, I can see virtues, but I've never seen good examples. From all my full-stack work, it's hard for me to imagine really pure isomorphic examples. Definitely we'll have similar patterns and such, and small snippets that work in both contexts, but large functionality line for line code that works in the context of a server and a client, well I've yet to see good examples (anyone feel free to point me to some!). Perhaps that's not the goal of isomorphic code, but if it's just re-using small lines here and there, I can translate from one language to another pretty well.
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by enos_feedler on Friday June 12, 2015 @10:49AM (#9706207)
What about server-side render on page fetch and client side rendering afterwards? Or running business logic client side so the UI appears snappy and then enforcing that logic server-side? This would benefit from the same code running in both contexts. But I agree with your other points, its not a huge deal. Even the points I mention don't seem like core issues.
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by frivoal on Friday June 12, 2015 @10:50AM (#9706211)
agree on 1 and 3.

As for 2, I think it makes sense. You can pre-render your GUI on the server side, so that clients get served proper html rather than an empty pile of js, and then have the same codebase take over on the client side, single-page-app style, just talking to the backend to fetch data.

Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by murbard2 on Friday June 12, 2015 @10:57AM (#9706268)
That sounds good, but it only means that you have to be able to execute the client code on the server. You locally (i.e. on the server) simulate a client connecting and doing some rendering, then send a continuation to the real (remote) client.

Also - does Meteor do anything remotely like this? I doubt it.

Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by CydeWeys on Friday June 12, 2015 @09:56AM (#9705856)
If it's not going to be Free Software, who cares? I've seen so many people, projects, and companies burned by choosing a proprietary framework.
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by TylerE on Friday June 12, 2015 @10:16AM (#9705989)
Uh, it's MIT licensed. That's about as free as it gets.
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by JoeAltmaier on Friday June 12, 2015 @10:19AM (#9706006)
Except of course for, actually free. Like, unlicensed.
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by alfonsodev on Friday June 12, 2015 @10:22AM (#9706019)
Correct me if I'm wrong but things are copyrighted by default, being the creator the owner of the copyright. Unlicensed == copyrighted and therefore not free(libre).
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by TylerE on Friday June 12, 2015 @10:28AM (#9706059)
You're not wrong.
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by JoeAltmaier on Friday June 12, 2015 @11:02AM (#9706297)
That can't be right - what's the point then of the copyright symbol and statement in every copyright work everywhere? In the US at least.
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by alfonsodev on Friday June 12, 2015 @11:14AM (#9706366)
Go for instance to http://www.gnu.org/ in the footer you'll see that copyright symbol. "Copyright © 1996...2015 Free Software Foundation, Inc"

The symbol it's about being explicit about who owns the copyright. The owner of the copyright can then decide which license to use. Or not use any. But choosing not to license doesn't make you lose the copyright nor makes the creation free(libre).

Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by JoeAltmaier on Friday June 12, 2015 @11:21AM (#9706410)
The US govt thinks otherwise. They insist that only by registering a copyright can you protect your work in court. Any 'poor mans copyright' techniques are never useful in court.
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by TylerE on Friday June 12, 2015 @12:50PM (#9707058)
That's not true. Registering the copyright allows you to sue over it (but you don't have to register immediately, just before you sue!). Also, registration prior to infringement allows recovery of statutory damages (e.g. big $$$).

But don't take my word for it, listen to the federal government:

"Copyright protection subsists from the time the work is created in fixed form. The copyright in the work of authorship immediately becomes the property of the author who created the work. ... The way in which copyright protection is secured is frequently misunderstood. No publication or registration or other action in the Copyright Office is required to secure copyright. See the following note. There are, however, certain definite advantages to registration. See Copyright Registration on page 7"

http://www.copyright.gov/circs/circ01.pdf

Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by JoeAltmaier on Friday June 12, 2015 @01:38PM (#9707375)

    "Registered works may be eligible for statutory damages and attorney's fees in successful litigation. Finally, if registration occurs within five years of publication, it is considered prima facie evidence in a court of law"
http://copyright.gov/help/faq/faq-general.html#automatic
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by candybar on Friday June 12, 2015 @05:20PM (#9708622)
Hi Joe,

I think you may be misreading that clause. What they are saying is that if the works are registered, you may be able to sue for statutory damages in addition or instead of compensatory damages. This does not mean if the works are not registered, you cannot pursue legal claims, merely that you're limited to compensatory damages. Likewise, they are not saying you cannot prove that you own the copyright unless they are registered, merely that copyright registration effectively shifts the burden of proof.

https://en.wikipedia.org/wiki/Damages#Compensatory_or_expect...

https://en.wikipedia.org/wiki/Statutory_damages_for_copyrigh...

Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by TylerE on Friday June 12, 2015 @02:25PM (#9707662)
That's what I said. None of that has anything to do with the actual copyright status of a work.
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by JoeAltmaier on Friday June 12, 2015 @04:12PM (#9708237)
Hm. The fictitious 'actual status' might be less interesting than the actual legal standing, right? I'd follow my lawyer's advice on this one (register early).
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by alfonsodev on Friday June 12, 2015 @11:43AM (#9706568)
Ok, I'm from EU. Then unlicensed == copyrighted is not true everywhere, but we can agree that unlicensed != free(libre), right ? I might be simplifying here. :)
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by TylerE on Friday June 12, 2015 @12:51PM (#9707064)
No, you're right, GP doesn't have a clue what he's talking about.
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by nickstinemates on Friday June 12, 2015 @09:47AM (#9705802)
I have been hearing about Galaxy for around 2 years, looking forward to seeing it shipped and in users' hands.
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by bigtunacan on Friday June 12, 2015 @10:40AM (#9706150)
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by progx on Friday June 12, 2015 @10:43AM (#9706164)
Why you re-post the re-posted post below?
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by owenwil on Friday June 12, 2015 @10:33AM (#9706108)
Why is this back on here today?
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by serve_yay on Friday June 12, 2015 @10:36AM (#9706123)
Yes, I'm wondering that as well.
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by escusado on Friday June 12, 2015 @09:56AM (#9705858)
if(Meteor.isServer)... uhm, no thanks.
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by singlow on Friday June 12, 2015 @10:44AM (#9706173)
No one would actually use this in production code. It is a useful convention for examples so that you can tell you are in server or client code. Occasionally it might be useful in a function that only has a slight deviation in behavior on the server, although usually you would wrap that difference in a function that is implemented separately in client or server only libraries.

In application code you would put all server-only code in the server directory and that code is excluded from the client code, same for client only code. In plugins, you specify which files are included in the client and server explicitly.

Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by JustSomeNobody on Friday June 12, 2015 @10:51AM (#9706218)
I've seen enough code to know that if it's in an example, it's in production.
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by rglover on Friday June 12, 2015 @10:26AM (#9706049)
This is just one (basic) way to do this. In a real app you put all of your server code in a /server directory, removing the need for the if statements.
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by anon3_ on Friday June 12, 2015 @09:50AM (#9705813)
The reality of javascript is different in browser and server (node/io).

While I find that meteor was fun to work with, we ultimately opted for plain-old express + backbone. I think it's abstraction is more of a disservice. It adds a lot of magic and unknowns to the picture.

After a few months, the initial value of having the unified codebase is exhausted, and you're left with the technical debt of having already adopted their libraries and conventions.

It's not really accurate to say that meteor allows you to use any library, you are adopting their conventions. In the end - using a single unified codebase in JS involves going against the grain in many aspects (I can elaborate if you like)

Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by TY on Friday June 12, 2015 @09:56AM (#9705851)
Please do elaborate. I'm in the middle of building of my first Meteor app and would love to hear your perspective about it.
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by Exuma on Friday June 12, 2015 @10:22AM (#9706018)
He replied below
Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by philippnagel on Friday June 12, 2015 @09:54AM (#9705836)
Please do!

We are currently evaluating what to use to build a data analytics application (Work with data, ETL, connect to various DBs and APIs, etc.)

Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by anon3_ on Friday June 12, 2015 @10:01AM (#9705884)
They are inherently different on many levels.

Browser: global is window/document

Server: global is global

Browser: interacting against DOM objects and events (clicks, etc)

Server: you are wedged into the function(options,callback) pattern and many promise libraries. you are often using functions as "middleware" or wrapping them in promises.

Browser: bower

Server: npm

Browser: better debug tooling / inspector

Server: sometimes you won't be getting a good traceback unless you know how exceptions work. the way libraries are glued together make errors and error handling hell (practically another job) practice. If you want me to elaborate, please ask.

I could go on to say that most node projects I see in startups are misguided. I could elaborate.

Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by vdaniuk on Friday June 12, 2015 @10:38AM (#9706137)
> Browser: interacting against DOM objects and events (clicks, etc)

> Server: you are wedged into the function(options,callback) pattern and many promise libraries. you are often using functions as "middleware" or wrapping them in promises.

How much time did you actually spend evaluating Meteor? Meteor is using fibers on the server and thus the code is written in the synchronous style.

Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by anon3_ on Friday June 12, 2015 @11:22AM (#9706418)
The above comparison was about the difference between JS in browser and server-side.

> How much time did you actually spend evaluating Meteor?

A week? I saw the fibers dependency.

> Meteor is using fibers on the server and thus the code is written in the synchronous style.

There is no library (promises, fibers) that alleviates the simplicity of being able to do:

  users = User.objects.all()
And not having to wrap it in a promise.

I should add, we went from Meteor -> Express -> Django. It was such a relief to invest time in our features, and not having to have the downsides of every minute DB / API being asynchronous. I could elaborate.

Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by vdaniuk on Friday June 12, 2015 @11:54AM (#9706652)
> There is no library (promises, fibers) that alleviates the simplicity of being able to do: users = User.objects.all()

As an counter-example, Sequelize offers both callbacks/promises so you don't have to wrap the query function manually. In fact many libraries provide promise interface or can be promisified with bluebird.

Using ES7 async/await and babel you just write:

let users = await Users.findAll()

Async/await syntax was the feature that made JS development pleasant for me. Brackets and parentheses soup that tends to be produced by callbacks/promises made my pattern recognition sick.

Re:Meteor Raises $20M to Build the One JavaScript Stack to R... by timrichard on Friday June 12, 2015 @11:27AM (#9706452)
I'm currently working on a Express/Angular contract. I'd say the debug tooling in WebStorm for the Express server is more sophisticated than the browser debug tooling for the front end, if only for shortcuts like "run to cursor". And that's even before we get into SpyJS (which to be honest can work on either the front or back end).