15 ms·
Re: Moving from PHP to Go and Back Again
- deleted 9y ago[deleted]
- klodolph 9y agoEveryone I know who uses Go complains about it. Every day you write Go code you will come across some piece of code that would be shorter with templates in C++ or using <algorithm>, or you could do it more simply in Python, or if you were really clever it would be a single line of Haskell. And yet we keep writing Go. By comparison, I'm a bit put off by the Rust community's evangelism, but that might just be my personal experiences with Rust community members.
- megaman22 9y agoYou're attempting to slaughter all the sacred cows of this community. I predict that will end badly
- alrs 9y agoI use the quality of people's complaints in interviews all the time. I like it when they have a complaint but can see why the trade-off was made. I don't like it when they're obviously parroting HN group-think. I really don't like it when they have no complaints at all, but are able to recite the marketing happy-talk verbatim.
- emj 9y agoOften people are in all of those categories, they use what I see as marketing speech to talk about their own experiences. Those experiences might differ from mine so what I dismiss as parroting or marketing is later shown just to be difference in opinion. I admire people who can spot such things effectively and steer discussions in an productive manner. I see now that this is not really about interviews anymore but just everyday discussions.
- sagichmal 9y agoEveryone who uses any tool sufficiently frequently will complain about it. This is not a good proxy for quality.
- zaphar 9y agoIt's so prevalent our industry has a term for it. "Use it in anger". You know you've gotten to know a language when you have had to work around a quirk of it's semantics.
- noncoml 9y ago> And yet we keep writing Go. What are the alternatives if you want something with type checking? Java? No, thanks. Haskel? Where are the libraries? C/C++? I guess Typescript is the only alternative
- MrBuddyCasino 9y agoKotlin.
- deleted 9y ago[deleted]
- kaeawc 9y agoHave you gone to production with it yet for your backend? Curious Android dev here.
- mustardo 9y agoWorked on at least 2 projects using it in production (backend) zero language issues
- MrBuddyCasino 9y agoNot yet, but zero issues so far. Currently running Spring Boot 2M7 on AWS EB just fine. I was surprised how smooth it went.
- MrBuddyCasino 9y agoCorrection: found an issue with bean validation. https://github.com/spring-projects/spring-boot/issues/11343 https://github.com/spring-projects/spring-boot/issues/11343
- MrBuddyCasino 9y agoAnd it turns out it wasn't really an issue, just unintuitive. Documentation has been updated.
- submeta 9y agoCan't help but think of: "The grass is greener on the other side of the fence."
- barsonme 9y agoOr "There are only two kinds of languages: the ones people complain about and the ones nobody uses."
- powerslacker 9y agoI write Go on the daily and I really enjoy it. But hey, whatever floats your boat!
- tobbyb 9y agoA slightly different perspective. For the end user Go apps are by far the easiest to setup and use. Usually it's just a single binary to download. That is a huge advantage that can't be beat. Other languages usually need a large number of dependencies, with Ruby and Node, often an entire build environment, with plenty of potential for dependency hell and hours wasted. Some may advocate containers at this point, but it just hides the issue temporarily and may be too much for a certain category of end users. You now need to know how containers, ports, volumes and Linux systems work in far more detail when you actually just want to use an app.
- pjmlp 9y agoAll compiled languages support static linking, nothing special about Go.
- klodolph 9y agoAt least historically speaking, this wasn’t true. And the fact that it’s true today for Java and C# is an anomaly, since for most of the history of those languages native compilation was either third party, second-class with missing features, or both. Look at GCJ or Excelsior (commercial). Or look at Python, which is also compiled. Or Ruby, or JavaScript, TypeScript, Dart…
- pjmlp 9y agoLanguage and implementation is not the same thing. Does not matter where the implementation comes from, if it is free or commercial, what matters is that it exists.
- mustardo 9y agoWith say a java app thou you'd typically get a .zip with all your class path dependencies and a launcher in one bundle. This is not the case for ruby, js (node), python etc where the norm is to splatter dependencies across your file system. Its not quite static linking but closer
- royge 9y ago
- littlestymaar 9y ago> And yet we keep writing Go. Remember that Go is still a niche language, and the majority of programmers will never write a single line of Go. There is a nice trend around Go nowadays, but most people are still writing PHP, Python or Java and Go isn't going to replace any of those.
- klodolph 9y agoOne could equally remember that Java was a niche language in 2000 used by a few dot-com startups, and even today it has not replaced C++, COBOL, or Fortran. Languages don’t get replaced, people just don’t use them as often for new projects.
- littlestymaar 9y ago> One could equally remember that Java was a niche language in 2000 used by a few dot-com startups, and even today it has not replaced C++, COBOL, or Fortran. Ouch, the lack of historical accuracy of your comment is painful. Just a few points : - Sun Microsystem was founded in 1982, it's far from being a dot-com start-up. - Java was already ubiquitous by 2000, it was embedded in your phones, your credit cards, in your browsers thanks to applets etc. - in fact it did replace COBOL or C++ for a wide number of applications, not everywhere but it still had a enormous impact on the industry. Netscape even went as far as re-implementing their whole browser in Java[1]. It was a bad idea, but that gives you an idea of the revolutionary impact Java had. Go is nowhere near where Java was in 2000, by several orders of magnitude. It's not a criticism of Go, I don't even think we'll ever have a language as popular as Java in that time, because in the 90s there was a massive window of opportunity for a language that was at the same time : safe, portable, and licence-free. [1]: https://www.cnet.com/news/netscape-sharpens-javagator-plans/ https://www.cnet.com/news/netscape-sharpens-javagator-plans/
- geodel 9y agoWell the size of industry was much smaller than it is today. Java kind of replaced or used in first place where people would have used C/C++ etc. Same is true for Go as lot of container/devops, cloud etc infrastructure is written in Go which would most likely be in Java. Among the languages that came in last 10 years Go is most popular with exception of maybe Swift. So compare to marketing juggernaut Java with billions sunk in by leading enterprise vendors Go is nowhere. But among non corporate driven language Go is definitely on top.
- zaarn 9y agoGo has many flaws (lack of generics is my biggest gripe) but I still manage to be productive in it and it's fun to write. I think for many people, me included, it's flawed but good enough for the job and fun.
- baby 9y agoI'll give you my point of view then: I'm super happy with Go and way less happy when I have to read C++ with templates.
- pjmlp 9y agoNot me, I only touch it when the customer says so, and it is usually Docker related assignment.
- cft 9y agoI don't know why the author bothered to even respond to that Medium article. The Medium article starts with that Go shines as a systems programming language. He lost me right there: how can a language with a garbage collector and a runtime be called a "systems programming language"?
- sidlls 9y ago"systems programming language" doesn't start and stop with bit twiddling one step removed from assembler. There's a huge fuzzy region between that extreme and "application programming as a semi-skilled trade", and go seems to fill certain "systems programming" needs adequately as far as that goes.
- cft 9y agoLanguages like C and Rust are true system programming languages, and they are not one step removed from assembler. Rust has a very complex compiler. Go is a low level applications programming language.
- sagichmal 9y agoThis pedantic terminology fight about what constitutes a “systems” language hasn’t been worth having since 2009, when all of these arguments were already aired and resolved. Please find another hill to die on.
- BuckRogers 9y agoHe is correct though, at least from the perspective of Go's own designers? Wasn't "systems language" removed from the description at some point. I've listened to interviews with Rob Pike who even outright said they got the messaging wrong there. I think it's pretty well accepted that no systems language has GC. Go is on the same abstraction layer as Java/C#. Everything in text can be taken as a slight, and to ensure that doesn't read that way, I am a believer in targeting that level of abstraction most of the time. I think it's the sweet spot. I'm not a fan of the dual language approach targeting high (Python) and low (C). Java or C# makes more sense to me, for most software. That's my opinion. If I needed more than what those heavy hitters provide, I'd just go all the way and reach for Rust myself. So I don't necessary see the parent comment from ctf as combative. I think he's just seeking accuracy.
- maaaats 9y agoIt's not a good start when you have to resort to gifs ridiculing the other article.
- tempodox 9y agoYes, I wondered whether I was the only one that found this article a bit patronizing.
- adventured 9y agoIt did come across as quite patronizing. Particularly in contrast to its light-weight argument style that almost exclusively consists of one-sentence opinions, stated as fact, with very little behind them.
- maaaats 9y ago(the article has been tweaked a bit after being featured on HN, just in case my comment now seems out of place)
- frik 9y agoPHP is unique in several ways: it's especially designed for the web, is a Web framework itself, comes with everything inbuilt, has C/Java syntax, has a shared nothing architecture, replaced VB as the most popular language for beginners, is used by most websites, is easy to use just drop a php file to Apache www dir. You simply can't objectively compare PHP to other languages because it's different to all others, it's unique. And due it's wide spread usage and earlier non-academic approach it still gets (rather unfairly) some bad reputation. Anyway PHP 7.2 is great, and Go too.
- jstewartmobile 9y agoBut a pokemon character was rather unkind to it back in 2012, so here you are. Two years after that, Mickens wrote a glorious takedown[0] of Javascript--which must not have been as glorious as I thought--since people still seem hell-bent on using in as many places as possible. Alan Kay said that computing is now a pop culture... [0] https://scholar.harvard.edu/files/mickens/files/towashitallaway.pdf https://scholar.harvard.edu/files/mickens/files/towashitalla...
- spdionis 9y agoI mean, the way people bash PHP and praise javascript is completely ridiculous. The two languages are comparable at best in the amount of warts they have, while my firm opinion is that the js ecosystem is the most horrible thing in the world.
- deleted 9y ago[deleted]
- jstewartmobile 9y agoAMEN!
- warent 9y agoGo is not OOP in any shape or form, no matter what “they” try to tell you. Go is imperative language with procedural style of writing code. Yes, you have objects and you can attach methods to them, similarly to Ruby where everything is an object, but that’s basically it. Never, ever, try to repeat yourself in Go. You will crash and burn. When it comes to Go, spaghetti code is what you want to write. This was really funny. Definitely the rantings of someone who is used to too many layers of abstraction and coded themselves into a corner before finally blaming the language. I'm detecting a lack of self-awareness. Here is where the author should have used the gif that was used at the start of the article
- powerslacker 9y agoyou got me to make an account and move the gif, I hope you're happy with yourself
- warent 9y agoHappy enough to give you the ol' retweet: https://twitter.com/ArentWyatt/status/940480529740193792 https://twitter.com/ArentWyatt/status/940480529740193792 Italian chef kiss EDIT: p.s. thank you for designing your website so that can actually handle some traffic. That's worthy of the hacker news gold achievement
- majewsky 9y ago> thank you for designing your website so that can actually handle some traffic. That's worthy of the hacker news gold achievement Not really. When I had a blogpost on the frontpage for the first time, I checked the monitoring and saw a CPU load of 6% of a single core and 1 megabit per second (that's bit, not byte). [1] And it's simple, really. You just write some text on the page, add a small stylesheet. And then you just stop, resisting the urge to add any JS and tracking and hero images. You just stop. And instead of generating your HTML on the fly from a database, you just serve a static HTML file. [1] Graphs: https://blog.bethselamin.de/posts/latency-matters-aftermath.html https://blog.bethselamin.de/posts/latency-matters-aftermath....
- paxys 9y agoAll of the points this article makes are already addressed in the last one. Yes, Uber is running a production Go service with massive QPS. This is exactly what the original author meant when referring to Go's strengths with single-purpose, high performance, "nano" services with relatively little business logic. There is also the insistence that frameworks are bad and developers absolutely have to care about "granular control" and "manipulation of bytes and bits" and packets and IO (unless they're writing a "glorified todo list") which rubs me the wrong way. Why is it so hard to acknowledge that there are a large number of perfectly good websites and codebases that do well with popular frameworks? We ourselves have a proxy layer and a couple other services written in Go, and they work great, but the rest of our stack is Java and some Python. Developers are free to choose the best tool for the job when starting new project, but after a few days of messing around in Go every new service is undoubtedly built using our existing web stack.
- comandillos 9y agoFrom My point of view. Go is a great language and this author is right when talking about using Go is better than PHP in cases like Uber or Youtube. I mean, Im not a fan of PHP, I like to use low level languages the most time but web is complicated. First of all, I don't think that not abstracting all the IO and network HTTP socketing or all this stuff 'helps' somehow developing a 'better' web app. Maybe for Uber, Youtube, Google, Docker, AWS, yeah. But for the most of everyday-apps for small/mid-sized business? I don't think so. I mean, it would be great but from my point of view, developing a Go web app for this kind of business, but it could be a little bit overenginered. Using PHP/JSP would be much more straightforward for the developer/s, and maybe for maintenance. The entire cost of the app will be greather as Go developers for Web Apps cost you more than any PHP/JSP programmer out there. Remember Ruby? It's the same problem. From the point of view of engineering, right, take Go, but I think sometimes, isn't necessary. PHP is not the solution but will solve you some problems that could be great for even mid sized businesses. Just my opinion.
- powerslacker 9y agoI think JSP is a great contender, and I see your point about overengineering. PHP with type-checking is alright, but if I'm going to use a scripting language I'd prefer Python or Ruby.
- patricklouys 9y agoBoth ruby and python seem to encourage duck-typing. I worked with both of them in the past and that's the main reason why I always came back to PHP. I need my type declarations...
- spdionis 9y agoAgreed. The way i see it for the web is PHP is just a better Ruby/Python in terms of libraries, package management, deployment, language features, performance, with the only drawback being a quirky standard library.
- deleted 9y ago[deleted]
- pmontra 9y agoI don't know Go and I didn't use PHP very much so I'm qualified to comment only on this part: > I’ve worked with RoR, and a variety of frameworks in the Node world – and I have never had a framework project where I didn’t end up fighting the very system that was supposed to make development “easy”. This is not my experience with Rails, Django and Phoenix. Actually, I was probably fighting Rails in my very first project in 2006 (or was it 2005?) but I was writing it as if it were Struts (I was coming from Java.) Then I started coding as if it was Rails and got a great speedup in terms of coding time. I'm less proficient in Django. It seems that it doesn't really enforce a project structure and one can do almost what s/he wants. I've seen projects that look very different to a degree I never saw with Rails. Basically all Rails projects look the same. Phoenix is somewhat in the middle. So, if the author is wrestling with frameworks either he's not proficient with them, but this doesn't seem to be the case, or he genuinely doesn't like to be constrained by the requirements of those frameworks. This is not a bad thing per se. If one feels like that, he's going to be a happier developer writing code with the architecture he designs. I'm not sure customers will be happy too, but I don't know what kind of projects and customers he has. About me, I prefer to stick with standardized architectures that any developer after me will be able to understand in minutes. I'm a freelancer and I just don't have the time to spend a significant amount of my customers budget to learn (and make learn) more clever and optimized architectures before doing any real work. If I had my company running around one software product, then maybe I would design it from scratch. Reality check: I wrote so many MVPs in Rails, especially for customers. Given the usual outcome (failure to get traction) it would have been a waste of money to start with a more clever design.
- zaarn 9y agoFrameworks necessarily limit what you can do. For example, the labstack echo framework in Go is one of my favorite frameworks, it does a lot of work for me. On the downside, I can't hijack HTTP connections in the router, like for example, when I want to host something under customs domains and redirect internally to a subURL. I have to hack around the framework to do that, the solution is rather ugly. But there isn't much I can do otherwise that doesn't have various amounts of bugs. Frameworks will always limit what you can do, period, you will have to code around them once you want to do something they don't allow out of the box. On the other hand, the less the framework does for you, the less limiting it is but in the same moment it also does less work for you.
- rakibtg 9y agoFrom my point of view PHP 7.2 is a great choice for startups and with a small team, so build the product, make it run. If required then do some R&D to switch to go, jumping straight into go should cause some issue.
- heavenlyblue 9y agoGood luck hiring actual software engineers and not the ones who just managed to get into IT during the SEO boom. They are probably less expensive than the Py ones, but they probably don't have much of a future either.
- deleted 9y ago[deleted]
- cweagans 9y agoStill parroting that old trope, huh? The quality of an engineer is rarely dictated by their tools. You can be an excellent engineer with a shitty language, or you can be a terrible engineer with a great language. I'll be the first to admit that PHP certainly has it's share of really bad developers, but what language doesn't?
- heavenlyblue 9y agoIt is an old trope - I completely understand your point, but the fact is: wherever you're professionally going, PHP is <probably> not the language you'd like to use anyway. So why use it? I could see how doing FORTRAN for a banking institution is a good way to make money; but PHP doesn't even have that. Most of my closer friends with a Computer Science degree would probably try to stay away from PHP: neither does it pay better than other languages, and most of the companies that have chosen to work with PHP <probably> don't seem to be that appealing either. Is that an old trope? Well, I am parroting the industry: I had worked with PHP and I had realised that none of the cool people with money would do PHP anymore. It literally is similar to not using git in 2017 - if you're still doing PHP, then you're probably a dying business or a really bad software house.
- maxpert 9y agoI have been writing Go, Node.js and PHP for quite a while now. I don't think golang is overhyped; nor it's a silver bullet. There are systems like Kubernetes, etcd, and so on that are implemented in Golang and they work really well. I think problem is people trying to use Golang for EVERYTHING! There are so many things I would disagree with in the article; but I won't disagree with the fact that if you want language with dynamic nature (Ruby, PHP, JS) and you expect to find those conveniences in Golang you are flat out wrong. Reading original article this is the exact feeling I get, somebody was like "look look a cool new toy" and the herd followed.
- edem 9y agoIf you look for an oop or fp language you are also out of luck. You are only happy if you look for a better C which most people aren't.
- fileeditview 9y agoEven then you can go wrong. I've learned that first hand while trying to write some lower level networking stuff in Go. Also OOP in Go is perfectly fine.. it's just by composition only and without inheritance.
- lloeki 9y agoMany people were taught OOP the UML and Java way†, to which the concept of prototype-based inheritance is completely alien, while composition is not even on their radar. † Although they have their fair share of issues, this is not a jab at UML nor Java themselves, but the way things have been taught, terribly, for so many.
- fileeditview 9y agoYes that's true. When I was at university we learned about the concept of composition but the reference language for this 'software engineering' course was C++. The whole composition idea felt contrived at that point. Some time later I learned Lua for fun and almost instantly understood what this whole prototype based programming / composition was about :) TLDR: While I learned about composition at university, they failed to really show how it is used and what it is good for..
- robryan 9y ago> These are hard issues to solve with PHP, so hard that Facebook hand crafted a SPECIALIZED VIRTUAL FREAKIN’ MACHINE to deal with the performance issues inherent in PHP. Does that really seem like an “easy” solution? It is worth noting that this was pre-PHP7. Post-PHP7 the out of the box performance is similar or better to what Facebook did with the HHVM.
- mschuster91 9y agoAlso, very few projects will ever end up at the scale (user base/metrics) that Facebook had. 99% of all PHP software will be fine with a quadcore server with 4GB RAM, running a LAMP stack. This can be scaled as needed (eg moving off mysql, adding a reverse proxy, real load balancing).
- j0rd 9y agoI've always been really skeptical of those language performance comparisons which refer to PHP. As stated above PHP7 has similar performance when compared to HHVM which was made by Facebook. Additionally PHP has an amazing performance debugger by FB called xhprof. PHP performance could always be increased hugely by making sure is cache buckets have enough memory (opcode cache, realpath_cache_size). Secondly with any web framework your app will most likely be limited by IO (database, file lookups, networking) before it becomes limited by actual code execution performance. If anyone's ever worked on a project where the performance problem was the language and not IO I'd be really interested in hearing about it, but in my career of making websites I've never ran into this problem yet.
- idoubtit 9y agoBeing skeptical is a good attitude. I'm very skeptical of this Eldorado that some posters see in PHP7. My experience is quite different. > Additionally PHP has an amazing performance debugger by FB called xhprof. xhprof is unmaintained for years. The official version does not compile with PHP7. Various forks exist, but the only stable fork has been rebranded and defaults to sending all the performance data to the branding company. > PHP performance could always be increased hugely by making sure is cache buckets have enough memory (opcode cache, realpath_cache_size). Always, really? The history of PHP opcode's caches is complex. Before PHP5.6 where Zend published their opcache+, I've seen the various solutions (APC and others) cause vicious bugs. > Secondly with any web framework your app will most likely be limited by IO (database, file lookups, networking) before it becomes limited by actual code execution performance. I've seen quite a few PHP applications that were CPU-bound, and that were far from Facebook's scale. For instance, the learning platform Moodle is popular with universities, but getting it to handle hundreds of concurrent users cannot be done on a plain quad-core server. Another poster suggested load balancing as an obvious solution, but adding this is not that easy. E.g. Moodle has to track various files, including uploads. So once you add a load balancer and several PHP servers, you need to use a network mount for most of your files, which has a big impact on IO performance. I'm not saying that other languages are better, because I can't compare the exact same large application in two languages, but PHP7 isn't an Eldorado.
- jstewartmobile 9y agoHow many people here subscribe to the "they're all DSLs" theory?
- HeadlessChild 9y agoWow, that's a first. The website is hijacking the "go back" button for Google Chrome.
- tluyben2 9y agoNot strictly about Go, but how is it supposed to impress that 'big company X' uses language Y (in this case the author uses Uber as if that's some kind of + for Go); I would be far more interested in the language + framework used to solve what level of complexity and scale problem with how many servers + people. If you can build & run something with less people and servers than your competitor and which makes you make more money, I think you have something in terms of framework and language. I think K/Q exists because of that and Janestreet uses Ocaml for that reason. Also one should not forget that a company with 1000s of engineers is probably not you (yet); when you read that some company runs successfully on Node and saves $n amount of money by using it etc; when they have 1000s of engineers and devops on top of that it doesn't mean you can achieve the same (or any) success with it with 2 people. PHP for instance might be a much better choice with a small team; you don't need complex server setup, you don't need (or can handle) middle of the night alerts that require you to dive in vs just reboot the server etc.
- heavenlyblue 9y agoHow is restarting a go-based server harder than restarting a PHP-based server?
- tluyben2 9y agoFor most setups at most ISPs, PHP servers are zero setup, self contained systems which, without any setup from the client (the user, you), comes back after reboot with no issues. It has also been the case for 15+ years so it's quite something you can actually trust to happen. This is not so for Go or Node for most hosters out-of-the-box. Sure in the HN echo chamber, every hoster offers this maybe, but there are literally 100000s of small/big hosting companies/resellers in the world that run, say, CPanel. And the only thing that is trivial there is LAMP (with PHP/MySQL) hosting; the rest is just not very convenient or even impossible. So once you set it up, no there is no difference, but then you have to know how to set it up, secure it, have access to set it up and secure it and know how to maintain it which is the point i'm making (not meant about specific environments besides PHP/MySQL); if you are a small company that needs to make money, you might not(!) want to bother. Edit: Cpanel, in some near-future version will offer Node, I cannot find Go though. Edit2: I'm definitely not recommending anything here or saying Cpanel is any good; I just know it well and I know that it's the most installed 'admin panel' on hosting servers.
- herpderperator 9y agoAt my job, before I joined, I was told we were torn between using Go and Rails and ended up with both. Now we have a Rails frontend (for web requests / authentication) and a Go backend (for business logic), which communicate over Thrift RPC. I don't think it was a very wise decision because not only are you doing things twice, you're doing it three times, because you have to serialize/deserialize to/from Thrift for every request. It adds development time, more tests, and Thrift's binary protocol makes debugging RPC almost impossible. This isn't really an argument for/against Go, but it just shows that you should try to avoid using multiple codebases that have to be tightly integrated. Personally, I would've gone with a Ruby-only codebase that used Thrift RPC only if there was some backend task that was too slow in Ruby, and that Go's concurrency and speed might be better at. Then I'd serialize it and send it over to be processed by a better language. I wouldn't do it for every request. That being said, if I had the choice between writing an API in Go vs Rails, I would do it in Rails for the faster iterative development speed and quick debugging capabilities that is made possible by an interpreted language.
- bm1362 9y agoHave you tried thcurl or yab for debugging RPC? I’ve found that most services I consume using thrift have a yab template for easy testing and trace ids so I can follow the request- I haven’t really missed hand writing JSON curls yet. https://github.com/yarpc/yab/blob/dev/README.md https://github.com/yarpc/yab/blob/dev/README.md
- heavenlyblue 9y agoFor god's sake - does the structure of this project do any good to the company, or is it just there to familiarise the developers with a variety of technologies so that then they could go to another company and boast having used all of them? Hard to debug binary-based RPC? You have picked the wrong technology for communication, having forgotten that you'd need to build the necessary tools in order to debug it. There's literally nothing wrong with binary protocols, except developers forgetting about the necessary overhead of re-parsing the passed data in the debugger. But it's not an overly expensive overhead, if the architect had taken this into account. Having heard this point absolutely not for the first time, the only question that remains is: who and why did make a decision to have it this way?
- rmanolis 9y agoI use Golang for everything. For example I use GopherJs with polymer for the front-end and gin for the back-end.
- edem 9y agoI see no facts or genuine refutation in this article, just opinions. Therefore I can only assume that truth hurts because the article you are trying to argue with has a bunch of valid points. If you look at the history of Go you have to realize that it was created for the reason which is in the original article: to be a better C. If you come from C it is good, sure. And you can write big projects in it like in C (just think about Linux or Unix). But if you come from a high level language like Java (which is also performant by the way) Go feels like wearing a straitjacket! Go lacks the most basic tools which any seasoned developer can expect from a language (like generics). Just look at [my response](https://medium.com/@addamsson/this-article-is-wrong-in-so-many-ways-47c91584fd6 https://medium.com/@addamsson/this-article-is-wrong-in-so-ma...) to this topic elsewhere.
- majewsky 9y agoOkay, let's say I agree with your arguments: 1. Go "is still not as fast as Java can be" [1] 2. "Go lacks the most basic tools which any seasoned developer can expect from a language (like generics)" 3. "Go does not have a de facto build system and you can’t handle dependency management in an easy way" [2] 4. odd error handling 5. not a lot of libraries to choose from [3] 6. possibly more arguments that I missed when summarizing your post The way you paint it, people would be stupid to use Go. However, thousands of very talented developers use Go everyday. How can you explain this disconnect? [1] I like how you didn't say that Go "is not as fast as Java". That's a subtle, but important difference. [2] `go install` is the build system and I have solved dependency management for myself with literally a small shell script [4], and an official solution is in the works [5]. [3] I never had trouble finding libraries for use-cases both common and obscure). [4] https://github.com/holocm/golangvend https://github.com/holocm/golangvend [5] https://github.com/golang/dep https://github.com/golang/dep
- Erlich_Bachman 9y agoIt's not really stupid, it can be misinformed, or just a matter of taste. For some people having a small couple of specific qualities of a language is more important (because they "like" them) is more important than even some objective overall quality/ease of use. Many people are just forced to used it because the company uses it. And of course, all the people who actually ARE looking for a "Better C" - then they will of course use something like Go. It would be very "stupid" to use Java in that case.
- jaccarmac 9y agoPerhaps it's characteristic of all language discussions, but Go articles seem to generate an extremely polarized set of comments. My other favored languages (Common Lisp, Nim, Rust, Smalltalk) tend to do the same thing, but in Go's case the passion seems so... misguided. In my opinion, Go is just such a bland-in-a-good-way language. And I enjoy writing it, for the record. Came back to it after a while not writing it and discovered warts I had missed before, but it's still pleasant. Can't help but think people just need to relax a bit when it comes to Go. Listen to Rob Pike speak about it compared to Rich speaking about Clojure: Go's not the language to get worked up about. (Please put generics in Go 2!)
- cies 9y ago> (Please put generics in Go 2!) This. At least this is easily added. But why there is "nil" in Go I find less excusable, mainly because this "feature" is not easily (impossibly) removed.
- nine_k 9y agoWhen "bland" means "prone to copy-paste boilerplate", its starts to sound less relaxing. It sounds more like tedious search-replace and looking for not making a typo when adapting the boilerplate to the next similar-but-sightly-different use case. It turns a developer back into a coder. What Go takes away is mostly tools of abstraction. Some of them are removed for a reasonably good reason (hard to implement in 1.x). Well, people end up with codegen tools that replace not only templates and generics but also the C preprocessor.
- musage 9y agoI know this is about the weakest critique possible, but currently using Go, I know my next project won't be in it, simply for the impossibility to put an opening curly brace on its own line. Other languages that don't require semicolons at the end of a line have it, and even if they didn't, I'd rather have to put semicolons manually.. Go is "opinionated" I guess, but so am I. Whatever their target audience is, I'm not in it. One thing I used to hate about PHP but then kinda grew to like was variables being prefixed with a $, as it makes it real easy to distinguish between functions and variables at a glance. Other than that, it's just programming. For me, who is making really simple things, 99% of the work is figuring out the pseudo-code and data structures, if the language doesn't get into my way, they're pretty much all the same. I haven't tried Rust yet, but from a casual glance I do like what I see.
- donjoe 9y ago... curly brackets on new lines do work perfectly fine in case you're writing code on your own. As soon as you start working in a team and each team member starts to use their own formatting, it becomes super messy and unreadable. Either you inforce a clear style guide which leaves you to explain the team why your style is the best, or you leave this task to the language itself and never ever have to start arguing about curly brackets, whether to use tabs vs. spaces, ... (I'll stop here).
- musage 9y agoBut why should Go enforce it on behalf of everybody? A parser option to not automatically insert semicolons would be all I need, but no. To me, even with super short lines, braces at the end of the line are messy, and consistently messy is still messy. > Either you inforce a clear style guide which leaves you to explain the team why your style is the best, or you leave this task to the language itself Which then leaves the language to explain why that style is best. Did Google ever do that?
- donjoe 9y agoGo's authors didn't explicitly explain their choice of style, yet they explain why they enforce it: https://golang.org/doc/faq#Is_there_a_Go_programming_style_guide https://golang.org/doc/faq#Is_there_a_Go_programming_style_g... https://golang.org/doc/effective_go.html#formatting https://golang.org/doc/effective_go.html#formatting Style guides are a matter of taste. None is better or worse. Yet, I really don't like discussing about my taste within a team of different tastes. It's like asking someone why he/she'd prefer black coffee over cappuccino. I'd prefer someone (or the language) making a clear decision upon code style and enforcing it rather than ending up with a messy, un-styled code base.
- throwaway2016a 9y agoSome background. I actually wrote a semi-popular book on PHP (published by a major publisher) and have contributed to the core project. And I have spoken at many PHP conferences. Perhaps tellingly, PHP is rarely my first choice anymore. Which I think it a great language (contrary to many opinions) I just find other languages a better choice. Today my language usage looks like this: - Web services / APIs: Node.js [1] - Front-ends that require easily modifiable templates and quick command line scripts: PHP [2] - When I need speed and low latency for a network connected app: Go [3] - When I need speed on an app that requires no network: C [1] The promise chain asynchronous nature of Node.js makes it great for web services in my opinion. And the ability to easily have global variables that persist across connections for things like caching and pooling is a huge plus over PHP. [2] PHP is very good at spitting out HTML and making web service requests, the performance is acceptable in most cases, and it is really easy for most people to edit, even people without a CS background. Likewise, for quick command like scripts PHP is unbeatable in my opinion. The tools it provides out of the box means most common command line tasks can be done 100% with the standard library. No package manager required. Though if you need to add packages PHP is pretty good about that now. Incidentally the fact the standard lib does so much is also one of PHP weaknesses. The standard library is a mess of inconsistently named functions and classes that grew organically over 20 years. [3] I've saturated my loopback network interface on a non-trivial app on my Macbook Pro using Go. PHP and node don't even come remotely close.
- chj 9y agoin latest nodejs there is no a single place to catch exceptions in promise chain, which is very inconvenient.
- fimdomeio 9y agoI think this discussions are mostly pointless... Most of the times I can see one side or the other being right depending on the size of the project, size of the team, time to learn something new.
- tcfunk 9y ago> Would you rather? > > A – Be able to write new code 50% faster > B – Have 90% less errors in all new code you write For my employer, this is the most important question of the 3, and the answer is A every time.
- wccrawford 9y agoI guess the answer would depend on how many errors you have in the first place. If you have a ton of errors, B is going to be more important. If you have relatively few, then A is going to be a lot better. My employer would probably pick A, too. But there's a hidden side to this: If it's that much easier to code quickly, it's probably easier to understand the code as well. Which means fixing bugs is faster as well. At least, in my experience.
- leke 9y ago50% is a big number. 6 months or 1 year. 1 year or 2 years. XD
- huntedsnark 9y ago> I have never had a framework project where I didn’t end up fighting the very system that was supposed to make development “easy”. Not always, but often, I find this attitude in developers who either refuse to read documentation, or just entrenched in their ways and too stubborn to try it someone else's way. Is every project you're starting really so cutting edge that the problems others have solved and come to a consensus on don't apply to you? Perhaps, but maybe you should also be taking a look in the mirror and making an honest assessment on just how difficult you are to work with.
- Drdrdrq 9y agoI recently used Python for a project and was again reminded why PHP is still the king of smallish web sites. With PHP I could rent a cheap service to host a few sites, no problem, take FTP and just upload scripts. That was possible 15+ years ago and still works today. With Python - not so much. Sure, I can rent a whole VPS but I don't want to do server administration. And there are some options for hosting Django / Flask apps, but not many. Is it any wonder people still use PHP? I have used it for a long time and I hate the language - but it is hands down the best solution for small web pages where hosting is concerned. EDIT: thank you for the downvotes. It was nice having a constructive conversation. But then again, I knew in advance it is unpopular to mention on HN that PHP, MongoDB and similar technologies have their use cases.
- Annatar 9y agoHe never went back to PHP and most of the article is spent on extoling Go, so the title intentionally misleads. I feel jipped!