Live data from Hacker News

To boldly go where Node man has gone before

blog.jgc.org

41–50 of 124 posts

Re: To boldly go where Node man has gone before

#41
post #2

So does Go's net/http module really provide basically exactly the same programming model as Node? If so, why use Node? One thing the author didn't mention is that Go will use multiple cores in this example, whereas Node is single-threaded. Right?

I doubt it does. net/http looks like a basic http listener? As such, the comparison looks biased to me. Mind you, I don't know much about node.js or Go.

Re: To boldly go where Node man has gone before

#42

Earlier quoted context omitted.

npm is awesome, this direct import doesn't seem like a feature, more like a lack of a feature.

It works very well for me. If I want someone to install a Go program I've developed, in Ubuntu 12.04 they can just: $ sudo apt-get install golang $ go get github.com/pauek/garzon/grz That's it, and it takes a few seconds.

That's great to quickly show someone a program, but not so great if they try it a few weeks later and get a non-stable version of your program, otherwise that definitely won't be it, they'll have to spend some time figuring out what went wrong.

If Go adds some method to specify a tagged version that could be pretty nice though.

I hope it goes without saying that there's no way this kind of hack (neat as it is) is a substitute for a proper package management system like npm (which is a very good package manager).

Re: To boldly go where Node man has gone before

#43
post #15

Earlier quoted context omitted.

'npm' is covered by the Go tools themselves. You can import packages using their github/bitbucket/code.google.com URL.

That is really interesting. Thanks for pointing that out. Can you specify specific version dependencies like you do with a full-blown package manager?

After 'go get'ing the package, you can use git/hg/bzr to checkout the specific version you want. From there, all of the Go build tools will work as normal.

Re: To boldly go where Node man has gone before

#44
post #15

Earlier quoted context omitted.

'npm' is covered by the Go tools themselves. You can import packages using their github/bitbucket/code.google.com URL.

That is really interesting. Thanks for pointing that out. Can you specify specific version dependencies like you do with a full-blown package manager?

[deleted]

Re: To boldly go where Node man has gone before

#45
post #6

I'm sure the reason why users pick node is probably similar reasons why one picks ruby/python -- it's not for the speed. The language of the web is javascript. Until web browsers allow Go as the embeddable language, node will remain useful. I seriously doubt people would pick Go over node because of a micro-benchmark.

You can compile Go to js with gwt. You can reuse code that way. I personally even reuse Java code between Android, front end Web and server. Because of gwt. I don't think there are many people who choose js because they like it. It's usually because they feel forced. Javascript is a terrible language, I always prefer one of the compilers. Dart can't come fast enough.

Go is not related to java in any way. It has it's own runtime. Applications are compiled to native binaries on each platform.

Is there a separate branch/fork of GWT with Go support? That would be absolutely awesome in fact but it doesn't seem to be true.

Re: To boldly go where Node man has gone before

#46

Choosing Node.JS isn't just a performance / scaling decision for me -- one of the main draws to Node is the huge community and wealth of awesome modules. Socket.io, Now.js, cradle, redis, and dozens of other modules abstract away the tedious work and let me build functionality _really_ fast. Go is really promising but it won't win over the majority of casual developers until there's a community around it. I might as…

> one of the main draws to Node is the huge community and wealth of awesome modules. Socket.io, Now.js, cradle, redis

Really? In my experience, all but the most mature modules are hardly beta-quality and in constant flux. Find a good module for your job? Too bad it only runs on 0.4. Find another to get around that; oops, too bad your version of gcc needs to be patched and re-built. The language and its entire package ecosystem is so immature, I'm blown away people trust it in production at all.

"So fix it and submit a Pull Request," you say? That doesn't help me when I'm trying to deliver on a deadline. I love contributing, but I often have more pressing things on my plate.

Re: To boldly go where Node man has gone before

#47

Earlier quoted context omitted.

If I wanted a specific tag or release, I would just download that revision in the GOPATH directories, and refer to the package directly, instead of through the github URL.

Kind of a clunky way to handle versioning though. In Lein (for example), adding [noir "1.2.0"] ensures I'm always grabbing the same version. In Go, appears the only way to guarantee this is to check in the full source of the library alongside your own in your repo.

I wish Leiningen would also handle bleeding edge dependencies as easily as rebar eg:

    {deps, [
      {quoted, "1.0.3",
        {git, "git://git.corp.smarkets.com/quoted.erl.git", {tag, "1.0.3"}}},
      {proper, ".*",
        {git, "git://git.corp.smarkets.com/proper.git", {branch, "master"}}}
    ]}.

Re: To boldly go where Node man has gone before

#48
post #31

Earlier quoted context omitted.

Why not validate on both? Validate on the client to give a nicer and quicker notice if something is wrong (good UX) and then validate on the server for actual security.

To avoid a split-brain validation scenario. Update your model? Don't forget to update your validation in both the client and server. Otherwise, you'll validate something on the client but not the server (bad UX), invalidate something on the client but not the server (bad UX), or corrupt your data slowly when validation entirely fails (bad UX). Since it's a pain in the ass to remember to update two places when you mak…

That's a straw man if I ever saw one. This isn't a debate as to whether JS should be a server-side language or not. The fact is that if you're using Node and you're validating data, you can reuse the code to validate both on the front-end and the back-end. Front-end validation will likely improve the way your users perceive the app.

Re: To boldly go where Node man has gone before

#49
post #31

Earlier quoted context omitted.

Why not validate on both? Validate on the client to give a nicer and quicker notice if something is wrong (good UX) and then validate on the server for actual security.

To avoid a split-brain validation scenario. Update your model? Don't forget to update your validation in both the client and server. Otherwise, you'll validate something on the client but not the server (bad UX), invalidate something on the client but not the server (bad UX), or corrupt your data slowly when validation entirely fails (bad UX). Since it's a pain in the ass to remember to update two places when you mak…

That is why the guy is using the same code to do both validations.
Post reply on HN