<p>I'm curious to hear from anyone who reverted back to Node as their go-to backend after giving Golang a shot.</p>
<p>My main concern so far is ecosystem size. It seems like there is a package for pretty much everything on npm, and it's pretty easy to spot what is most heavily used. On the other hand, Golang packages seem to typically be of higher quality with better documentation.</p>
<p>Just curious for opinions on this one.</p>
<hr/>**评论:**<br/><br/>kpublik: <pre><p>Go back to Node? Crazy talk. ;)</p></pre>schumacherfm: <pre><p>I would never ever switch back to neither Node nor PHP</p></pre>djslakor: <pre><p>So I take it you've found the stdlib and package ecosystem to be more than sufficient for your needs in comparison?</p></pre>septaaa: <pre><p>I agree with him, I could never go back to Node or Python. The main advantage of Golang is that it's statically typed, while still being nice to use due to fast compile times and good tooling. Deployment and runtime environments are way less of a hassle too. And it's faster.</p></pre>danredux: <pre><p>I did, for a fairly simple but custom distributed map-reduce system. I figured the callbacks and single-threaded nature would help.</p>
<p>I regret it.</p></pre>diegoki: <pre><p>you wrote your own distributed map reduce system!! That is kind of awesome. </p></pre>domdomdom2: <pre><p>Depends on the project, no language works for everything. For something backend processing, I'd stick with Go. For a dashboard or web app with complex relations/lots of database calls, I'd probably go PHP. For something with a heavy Javascript/React front end, I'd probably just do it in Node.</p>
<p>I've used all three in the past year and for each project, each language had a different use.</p></pre>jns111: <pre><p>I'd rather go with v8worker (embedded chromium engine) than adding node to my stack.</p></pre>domdomdom2: <pre><p>That could work. We went with node for a recent project because we had a UI person that knew React/JS really well, but not much about backend. Node was a good idea because he could understand most of the backend which made it easier when I wasn't around. That's probably the one benefit I see to Node.</p></pre>no1youknowz: <pre><blockquote>
<p>My main concern so far is ecosystem size. It seems like there is a package for pretty much everything on npm.</p>
</blockquote>
<p>There is nothing stopping you from coding your own missing package. That's what I do, if I find something I want from PHP, NodeJS, Python.</p>
<p>Of course, it's nicer if someone else has done it for you. But give it time!</p></pre>burnaftertweeting: <pre><p>Haven't been writing Go for very long, I definitely think Go will destroy node in the backend. Can't see a reason to use it there anymore. </p>
<p>However, the go ecosystem is still maturing so I might use Node for Web scraping / integration testing - until a suitable alternative arrives.</p>
<p>For custom command line tools I'll probably still use Node until I feel well versed in Go. Programming in javascript is a headache for sufficiently complex projects, but for simple ones it's very comfy. Not having to worry about declaring types or mapping data to structs, pointers, or other data types is a big bonus to me, it allows me to focus on solving the problem and not getting lost in programming minutiae.</p></pre>no1youknowz: <pre><blockquote>
<p>Not having to worry about declaring types or mapping data to structs, pointers, or other data types is a big bonus to me, it allows me to focus on solving the problem and not getting lost in programming minutiae.</p>
</blockquote>
<p>Says the Javascript programmer lol. I don't ever seem to have that problem. I can actually code something quicker using Go than NodeJS and actually not only have I been able to port my previous code from Javascript/PHP to Go. I have been able to introduce type safety and massive gains in speed and lower memory use.</p></pre>jechols: <pre><p>I used nodejs for a somewhat complex web app that needed web sockets. After a few months, I was wishing there had been another option, but at the time we didn't know Go even existed (and websocket libraries for Go were iffy at best back then anyway).</p>
<p>I would choose PHP if I needed a quick and dirty web app I don't expect to maintain. I would choose Django if I needed a bigger web app with lots of pre-built libraries and minimal framework magic. I might even choose Rails before Node. Rails is filled with horrible magic which just kills me when doing maintenance / debugging, but I find it more pleasant to use when creating a new application. Node is just unpleasant all around. Back-end tools and command-line tools are unquestionably Go unless a higher-up says it's absolutely not going to be allowed, in which case it's Python or Bash.</p>
<p>Node may be a better choice than Go in some situations, but it's never <em>the best</em> choice.</p>
<p>My opinion is of course mine, but I do dev full-time, and I do a mix of back-end integrations and public-facing website work, for whatever that's worth.</p></pre>polypus74: <pre><p>Just curious what you ended up using for websockets?</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传