
Moving from PHP to Go and Microservices - mbanzi
http://blog.arduino.cc/2015/04/16/arduino-web-architecture-back-to-the-future/?utm_content=buffere40c1&utm_medium=social&utm_source=facebook.com&utm_campaign=buffer
======
chrisdegroat
"[Go] is impressively fast and soon we figured out that our bottleneck was not
the language/framework neither the application, but our database"

You re-wrote your entire REST API in a new language without first
understanding where your performance issues were?

~~~
therealwill
They also talk about switching DBs. In my experience it is rarely the database
choice but bad schema and/or poor SQL queries.

~~~
BinaryIdiot
Yes these were my biggest problem with this post; they don't spend the time to
try and find out bottlenecks and when they finally do instead of investigating
the WHY they're thinking about simply switching to yet another which is going
to have the same issues if they're not using an optimal data model, etc.

~~~
ceejayoz
This is unfortunately a very common problem-solving approach. I've seen devs
upgrade jQuery because they're getting a 500 error from a PHP app. No relation
to the problem - it's just flailing around in hopes something random works.

------
PedroBatista
Being 100% honest, the first thing it came to my mind after reading the title
was "Why?".

And now I still don't know why.

Maybe I'm dead wrong but for me this is yet another case of pure tech
fashionismo.

~~~
Svip
My personal motivation for rewriting some of my old PHP projects (albeit hobby
projects at best) to Go is A) willingness to maintain PHP (which is almost
nil) and B) rewriting programs can help discover bugs and re-understanding
your programs.

But that's for small hobby projects, where the developer team is usually just
me. For a large project, there should be some serious advantages to Go over
PHP in their use cases. Don't get me wrong, I think Go is a better language to
write websites in than PHP, but I am also a pragmatist.

~~~
EugeneOZ
There is a lot of reasons to choose Go over PHP for new project (static
typing, better scaling because of smaller memory footprint of each request and
so on). But for existing project all is not so simple. But after reading their
post I understand it as they just got tired because of code mess, so rewrite
was only way to clean things up. Only thing I don't understand is why they
didn't remove PHP at all.

------
Zikes
I love coding in Go, it's much more fun for me than PHP or node.js.

According to half the comments here and on every other Go-related HN post that
makes me a hipster, fashionista, hype-driven sheepdev.

If this had been a post about Arduino.cc being unhappy about performance and
refactoring their code in an attempt to improve that, nobody would be batting
an eye. But since they decided to refactor with Go, suddenly everyone is
asking "why?"

~~~
BringTheTanks
Asking "why" is a sign of curiosity, a desire to gain insight from the
experience of those who are, apparently, willing to share it with us.

Using fashionable tech X is not bad on its own. But without the "why" we have
no clue what the author's reasons for the given choices are, and how the end
results align with the initial reasons.

Lots of small businesses have driven themselves off a cliff basing their tech
choices on what their employees would "enjoy" most. It's a good reason to code
Go in your free time, but not to migrate a company's infrastructure to it.

It's very strange to see that you wouldn't want to know "why". Maybe you're
smarter than all of us.

~~~
Zikes
The "why" I'm seeing here is not the curious type, it's demanding
justification. It's telling people they must explain themselves thoroughly, to
defend their decision every single time they choose to use it.

Go is sufficiently mature enough that those questions need not be asked any
longer. Docker is built on it, Google's Vitess database sharding system (which
powers _YouTube_ , of all things) is built on it. Nobody is at risk of
"driving themselves off a cliff" for choosing Go, provided they are proficient
enough with it.

I haven't seen any other language get as much hate as Go does on this site.

~~~
wwweston
> Go is sufficiently mature enough that those questions need not be asked any
> longer. Docker is built on it

So... just so I can get the chain of thought, here:

    
    
       * the language has growing for a while
       
       * people have used it to ship something
    

Therefore, no more need to ask questions -- just switch to it!

> I haven't seen any other language get as much hate as Go does on this site.

Given the amount of criticism PHP and JavaScript get on this site, this
statement is simply indefensible.

And a lot of the criticism Go gets is concrete and a direct result of choices
the language designers consciously made.

~~~
Zikes
> Therefore, no more need to ask questions -- just switch to it!

Well, sure, if you want to twist my words then go ahead.

What I said rather clearly, but seems to have been lost on you, is that
questions not asked in earnest but in flippant disregard for the developer's
choices are not welcome.

And my statement on the hate Go gets is certainly defensible. I never
questioned the criticisms, I'm not here to say Go is perfect, only to rail
against the senseless vitriol that is guaranteed to fill the comments on every
Go-related link posted to Hacker News.

------
count
I'd love to hear how folks are actually deploying Golang for web apis - using
Gorilla, net/http, etc?

~~~
stilldavid
Like the others, net/http with gorilla packages pulled in as needed. Nginx for
static files and a reverse proxy for go. Upstart, and that's about it!

------
butterfi
As a developer, I appreciate having an interest in and using different
technical combinations, but as a site maintainer I've been wrestling with how
to accommodate different tech stacks with limited time and developer
resources. It's lead me to start questioning the developers choice of tech vs.
what the right tech choice for the organization. There's an assumption the
developer will choose the right tech, but frequently the client has no idea
how to access tech decisions and developers are left to pursue whatever they
choose. There are use cases where a custom stack is appropriate and other
cases where a an off-the-shelf solution (like WordPress, Django, Drupal, etc)
has better options for long term support. I'm not saying this is the case at
arduino.cc, but the blog post did trigger that reaction.

------
alexbilbie
Which IDEs have good Go support (code complete + debugging)?

------
coldcode
Go was interesting me to up to the point that I found out there is no real
debugger, and little interest in making one. I find it hard to get excited
about being unable to properly debug my code.

~~~
melling
Now there's a good interview question to determine if you're the type of
person who gets things done. Plenty of code has been written without "real
debuggers".

A debugger can make things easier, but can you effectively work without one if
needed?

~~~
anewhnaccount
Sometimes stepping through is faster than adding in trace temporarily. I say
that as someone who almost always uses trace. This is a terrible interview
question if "yes I use a debugger" is the wrong answer. What matters is if the
person can get the job done, not if they'd do it the same way as you.

~~~
lsaferite
I'm fairly certain I would have zero desire to work someplace that considers
'Yes, i use a debugger' the wrong answer.

~~~
melling
That wasn't the question.

------
prattbhatt
Not sure if going forward with Angular.js was the right choice, given Angular
2.0 had been announced, and will be different from Angular 1.0 (no backwards
compatibility)

~~~
iends
FUD.

There will be a clear migration path, including, it seems, the ability to run
both 1.x and 2.x modules side by side using the new router from 1.4. This
means you won't have to rewrite your 1.x modules immediately. 1.x also has a
commitment from the Angular team to remain maintained for the foreseeable
future.

