Anyone revert back to Node after trying golang for a while?

xuanbao · · 518 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;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&#39;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&#39;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&#39;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&#39;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&#39;d stick with Go. For a dashboard or web app with complex relations/lots of database calls, I&#39;d probably go PHP. For something with a heavy Javascript/React front end, I&#39;d probably just do it in Node.</p> <p>I&#39;ve used all three in the past year and for each project, each language had a different use.</p></pre>jns111: <pre><p>I&#39;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&#39;t around. That&#39;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&#39;s what I do, if I find something I want from PHP, NodeJS, Python.</p> <p>Of course, it&#39;s nicer if someone else has done it for you. But give it time!</p></pre>burnaftertweeting: <pre><p>Haven&#39;t been writing Go for very long, I definitely think Go will destroy node in the backend. Can&#39;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&#39;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&#39;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&#39;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&#39;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&#39;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&#39;s absolutely not going to be allowed, in which case it&#39;s Python or Bash.</p> <p>Node may be a better choice than Go in some situations, but it&#39;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&#39;s worth.</p></pre>polypus74: <pre><p>Just curious what you ended up using for websockets?</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

518 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传