
Dumping PHP For Go - BarkMore
http://mikebeale.blogspot.com/2012/07/dumping-php-for-go.html
======
stephenr

        Sometimes your app just stops working because of some typo in your code
    

I don't know of any programming language that will auto-correct typos for you.

    
    
        or the spaghetti code becomes just too unreadable.
    

If you don't write spaghetti code, you won't have a problem

    
    
        PHP just doesn't seem exciting for me anymore.  There doesn't seem to be anything exciting happening.
    

PHP isn't some 0.6-pre-alpha release software that douchebag developers use
for production apps and get excited about when the core API changes every 3
weeks.

    
    
        not much has been happening with the language and nothing interesting as far as apps or frameworks.
    

so you, as a developer, are complaining that no interesting apps are being
developed in a specific language..?

    
    
        Since I'm not a sysadmin, I prefer to pay extra to have my code managed by someone.
    

Sysadmin's don't manage code. You are a developer, you should be managing your
own code.

    
    
        Interfaces and reflection are awesome.
    

both of which PHP has.

    
    
        Go helps me write cleaner and more maintainable code
    

I doubt it. You claimed that your code "becomes" spaghetti. Which implies that
it starts out "clean and maintainable". I'll wait with baited breath for how
long it takes your new code to also "become" shit.

~~~
batista
> _I don't know of any programming language that will auto-correct typos for
> you._

I know of many compilers that will point them out to you, and IDEs that will
offer to auto-correct them (Eclipse, XCode and Visual Studio for example).

> _If you don't write spaghetti code, you won't have a problem_

Yes. And if you don't make any memory allocation errors you don't need a GC.
Hell, if you don't make any errors period, you can just program in hex,
building the executable code directly and skip assembly.

The thing is, different languages have different inherent characteristics
(syntax, features) and different cultures (pertaining to libs, common
practices, frameworks, etc), so one can tend to create more spaghetti code
than the other, the programmer being equal.

~~~
stephenr
>I know of many compilers that will point them out to you, and IDEs that will
offer to auto-correct them

PHP's lint option will identify syntax errors, and an IDE can identify or
auto-correct typos in any language - it's not a Go specific thing.

>And if you don't make any memory allocation errors you don't need a GC.

Memory allocation is a feature. Spaghetti code is a symptom of a poor
developer/team. They are not comparable.

> Hell, if you don't make any errors period spaghetti code is not a "mistake"
> like a typo, missing function reference etc.

------
te_chris
It's interesting and I guess this just reflects what one of the founders said
in a speech (which was re-published onto the 'tubes), that though they went
out trying to make a systems programming language that would attract system
language programmers, they've been picking up a lot of us dynamic "script
kiddies" (I didn't mean that term seriously, lighten up).

I'm a PHP/Ruby/JS developer, I dabble in iOS/ObjC and it's ok, but the
language which has me most excited is Go. I've watched screen casts and read
things but still haven't got around to building anything serious in it, but
when I get the time/need to build something really performant, I will. It
could just be because it's new, but it seems to have an energy about it and
the developers have made a real effort to provide great docs and make it
accessible to us mere mortal, non-cs educated dynamic folk. I thank them for
that.

~~~
Detrus
Go is advertised as feeling scripty and light but I don't think it really
shakes the systems programming feel. Idiomatic Go has a lot of error checking
which adds verbosity.

It would be nice to have a language you can do scripty stuff with but also
build high performance systems, but I doubt Go will be it. Clojure seems
closer but somewhat less performant.

~~~
mdwrigh2
I mean, you _should_ be handling errors, that's the point. But if you want to
ignore them, it's almost always the last return value so you can just write:

    
    
        foo, _ := DoBar()

------
halayli
I think you made a decision to use Go without explicit reason beside that
you've been hearing about it and now you are coming up with reasons to back
your decision.

In other words, you are moving backwards from decision to made up reasons.

------
getsat
"I won't consider Ruby because I tried Rails once five years ago and it had
scaling problems."

Looks like he didn't seriously consider Python or Ruby at all.

~~~
elithrar
> "I won't consider Ruby because I tried Rails once five years ago and it had
> scaling problems." Looks like he didn't seriously consider Python or Ruby at
> all.

Agreed. I'm not one to push my language preferences on others, but "it had
scaling problems" more likely means "I read about Twitter's unique scaling
problems".

I don't think Go is a bad choice for web apps, though; perhaps, if anything,
the ecosystem is a bit immature and therefore can make deployment a bit more
of a chore.

~~~
BarkMore
I get the point about the ecosystem being small, but not how it relates to
deployment. Because Go executables are statically linked, deploying Go apps is
very easy.

------
Zenst
I always looked at PHP as the sane alternative to ASP. Not sure GO is ideal as
a drop in replacement by design. Seems like chap just wanted an excuse.

Now I'm doing a project which leans towards python and in some aspects C -
that does seem to be more pandaring towards doing it in GO. But if it was a
production project and not a fun project then I'd hold back from looking at
GO, but it's a fun one so I'm looking at it and finding it very suitable
alternative to python/C in this case. Still sussing out a nice IDE but I'm in
no rush.

But for a PHP project I'd say PHP may be a better fit for cases were you use
PHP as a ASP alternative. Lets that how I see it, though I'm no PHP guru, let
alone ASP.

~~~
uvTwitch
PHP is a sane alternative to ASP? Do you mean ASP.net written in VB, or using
webforms or something? I take it you haven't actually experienced firsthand
the glaring inconsistencies and bizarre behaviour present in PHP's core
language features, because it's a far cry to call php 'sane' in comparison to
ASP//C#.

~~~
Zenst
was on about ASP webforms - kinda scary there is another flavour. Cheers for
the headsup on that one to avoid.

~~~
uvTwitch
No worries; if idiosyncratic spaghetti frameworks like PHP are your thing,
then it'd be a very good idea for you to avoid .net mvc

------
alberich
Title says "Dumping PHP For Go"... then the article says: "Why no more PHP?
First, I should probably clarify that I will continue to use PHP"... hmm, is
this a contradiction or not?

------
billrobertson42
"Java - Too bloated for me and if I use it there is a possibility Oracle might
sue me!"

I hope the author was joking. That makes no sense otherwise.

~~~
briandear
The OP must have read a bunch of blog posts and suddenly he's an expert.

------
timaelliott
Author has either been making some ridiculously inappropriate system apps or
is about to start making equally questionable web apps.

Obviously languages can serve multiple purposes but the intended uses of these
have almost no overlap.

~~~
dataminer
Why do you think Go is no suited for web apps? At the end of the day web apps
are just servers, and Go is very well suited to create reliable and efficient
servers. Go is also one of the languages supported by Google App Engine to
create web apps.

~~~
maratd
> Why do you think Go is no suited for web apps?

Languages specialize. PHP is suited for the web because it is a dynamic
language, stuff is compiled right when it is accessed, and there is no memory
sharing between requests.

Go, C, C++, etc. are static languages, stuff needs to be recompiled for even a
minor change, and of course, memory is shared for each request.

And that's just the tip of the iceberg.

Obviously you can bring all functionality that the web demands to Go. A jit
compiler might help, maybe some loose typing, a few other widgets ... and
then, guess what? You turned Go into PHP.

For each job, a proper tool.

~~~
BarkMore
_Go, C, C++, etc. are static languages. Make a little change here? Gotta
recompile. Big project? Might take a while._

Not with Go. Go compiles super fast.

~~~
dotborg
how about using some scripting language inside your web app written in C/C++,

just like it was being done in game development for decades already, it's not
like web app is much different from computer game

------
M4N14C
Yay, parroting a line about statically typed languages saving them from
themselves. Typing and ahead of time compilation are fantastic tools for
optimizing your executable, but I wish people would stop insisting that they
write code with less bugs because the compiler made sure an apple was not an
orange. Every statically typed language I've worked in had some form of
generics to step around the inflexibility of static typing.

