(no title)
austerity | 10 years ago
I mean it does feel like superpower when applied to tasks you'd previously have to use C for. But have you tried any of the modern web development stacks? They are like a zillion times more productive. Hint: PHP is not one of those.
I guess some people just can't get by without the iron hand of the compiler :)
afandian|10 years ago
And then I thought "why not use it for something web-like". My experience was dreadful. After coming from Python+Django, it felt like writing Java 1.4 (not a good thing). Especially for returning JSON objects with lots of mixed types.
So I switched to Clojure and never looked back (Python would have been an equally valid choice).
Go's a great language, but it's being applied in some very odd (and potentially unsuitable) places.
pramodliv1|10 years ago
One problem I have is that the application is extremely CPU intensive. I can't get past 35-40 requests per second with 500 concurrent users (at 4 CPU cores, 14 GB RAM), which seemed too expensive economically. (I cached as much data as possible, both at the Nginx tier and with Redis) and tuned the number of uWSGI worker processes.
Do I have to try other languages or do you think I have more room for optimization with Python?
StavrosK|10 years ago
How did you like Clojure? Does the ecosystem it compare well against Django? I tried it once during an on-site interview but was put off by the multi-minute startup times.
coldtea|10 years ago
Hint, PHP is 100% one of those. The bad rap is either because of hipsterism or for issues that have been long solved.
The rest of its warts are no worse than the kind of BS any language has -- in fact before JS got in fashion the same things was said all the time for it too (for its bizarro coercion rules, only fp arithmetic, bs scope rules etc).
true_religion|10 years ago
It's almost an irrational fear, but I remember working on plugins for applications where plugin hooks were non-existent, and the canonical approach was to patch code. I remember applications where there was no frontend server, but rather a sprawl of PHP files each doing one thing and hooking into the 'main' system via a 'require settings.php'.
Apart from that, working within PHP still obliges you to do a lot of hairy things---like working with Drupal. Now Drupal is certainly better architected than say Mambo/Joomla ever was, but it's still a better CMS than it is a web framework and for some odd reason lots of companies insist on building things into Drupal even today.
Now ... all of my recent knowledge is second hand, I've been out of PHP and into Python for at least 5 years now
wpietri|10 years ago
I'm not snarking; I honestly don't know. I tried using PHP years ago, threw up my hands in horror, and have never touched it since. I felt a little bad about that, but a few years back Eevee's "PHP: A Fractal of Bad Design" [1] persuaded me I wasn't missing much, and that my "learn a new language" time was better spent on Scala and then Python.
So what's changed in the last few years that makes it 100% as good as Ruby or Python for web development?
[1] https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
brightball|10 years ago
http://www.brightball.com/golang/go-from-a-php-perspective
TLDR: Go is good at the things PHP is bad at. PHP is good at the things Go is bad at. They actually compliment each other very well.
untog|10 years ago
spdionis|10 years ago
EDIT after reading the article: I do have to agree that concurrency in PHP is a bit of a pain, but those 3d party tools are pretty easy to use and maintain.
> Without significant forethought to several levels of caching; such as in memory caching, op caching ...
This is so trivial to setup it's not even worth mentioning.
> Sure, PHP has PSR standards etc, but they're fairly new and developers have been slow to adopt them.
Everyone I know and every library I use uses those standards. PHP is pretty standardized now, especially compared for example to js.
PHP frameworks work well out of the box and contain solutions for most use-cases.
Go is nice but when I tried it I really missed something like composer. "go get" and commit your dependencies to the repository? Seriously? That's wrong on so many levels. Meanwhile I think composer is one of the best package managers around.
riquito|10 years ago
I still don't like it but the landscape definetely changed, and it keeps getting better.
> Meanwhile I think composer is one of the best package managers around.
Apart from the fact that it uses gigabytes of ram on real projects. At work we ended up using it outside virtual machines, to later copy back the dependencies.
onion2k|10 years ago
It is, but the overwhelming majority of tasks in a web app don't happen concurrently, so it doesn't matter.
When it does matter just use something else.
aries1980|10 years ago
Why is this a pb? Makes your app is more resilient to external outages and no need to git clone all the repos with historical data.
aws_ls|10 years ago
But I've used it in the web app scenario. Replacing Java (jetty/tomcat servlets with pure Java code) with Golang. My own discovery was it could replace the jetty/tomcat with servlets part seamlessly, just with a bunch of http url handlers. I know it could be possible still more easily in other languages/stacks which are "zillion" times more productive.
Now, we all know that nothing comes free. For e.g. C++ templates cause compilation to take more time; have heard people complain about Ruby/ROR (including one on this page); I myself hated the Java configuration of the app servers, even in minimalist use of just a Servlet (the least needed for a web app thing), not to forget the SOAP-Servlets (Axis et al) before JSON ( good common sensical structure IMHO from the XML schemas/dtds (any one remember them?!)) became fashionable.
So the bloat/overhead can be in terms of useless jargon (e.g. the latter part of above para) which are too verbose and mean something very simple. Slowness e.g. Ruby/Rails. Or simply memory bloat (Which means more servers for the same amount of app processing capability).
So please do understand that there could be reasons other than "just can't get by without the iron hand of the compiler", where people use Go. :-)
People who have come to realize they wasted a decade chasing promises whether they were called OOP, EJBs, SOAP, XML, App Server, etc. Only to have been left with mysterious crashes because of "out of memory exceptions" (heck, jetty/tomcat are open source, but does any app developer should be debugging them. No, right? )
So there are also people disillusioned by the promises they fell for earlier. Who now prefer the minimalist approach. And actually very much appreciate when the wise people developing Golang, are hesitant to add a thing like Generics, despite the pressure from many quarters.
To summarize, why I use it:
Don't try to make it too easy for me, and pinch me at wrong times (when I start to get more users for e.g). Just Give me speed and give me transparency baby. I know how to make it work.
Edit: Typos and minor rephrase
Mick-Jogger|10 years ago
goldbrick|10 years ago
Also, it's relative newness combined with the fact that it is on the lower level of things means that basic tasks that have been iterated to precision on other platforms are still very raw around the edges and require quite a bit more boilerplate, which is not at all suited to almost all "web development".
I know, I know. "But it's faster!" I'd take a clean, cohesive system that can scale horizontally even if it takes me 5 times the servers of my entire-system locking clusterfuck that makes me guess about data.
There is probably an interesting metaphor to be made that is corollary to the adage about the hammer, something about how if you give that man a screwdriver he starts looking for nails to pound with it?
joncalhoun|10 years ago
When I learned Ruby I came from a Java background, and being able to search for things like "java interfaces in ruby" was incredibly helpful. It is a very succinct way of defining what you are trying to do in the new language, and often leads to a useful post explaining how to do what you want to do (even if that means doing it a completely different way in the new language).
I suspect this is also why you see frameworks like Revel gaining so much popularity in Go. Developers coming from Rails, etc all want something they are familiar with, and Revel looks familiar. It may not be the best way to build web apps in Go (I don't know), but limiting what you have to learn has its benefits.
I personally view this as a positive thing. It makes it easier for developers to learn Go and find out what it is useful for so that when they can benefit from it they realize it.
kqr|10 years ago
Hey, Haskell and Scala exist!
Kiro|10 years ago
What stacks are you referring to exactly?
metachris|10 years ago
[1] https://www.djangoproject.com/start/overview/
esaym|10 years ago