Sunday, July 8, 2012

Dumping PHP For Go


It has been a long time coming for me to switch out of PHP for my main programming language.  I have been working with PHP for years and have grown tired of the limitations/issues.  It has been hard for me to convert, being that there are always jobs for PHP programmers out there and I gotta eat! For me, the aggravation coming with working with PHP has forced me to switch.

Why do you hate PHP?

I don't hate PHP at all.  The language itself has many advantages like a great community, numerous libraries (although how many different MVC frameworks can you have?), great documentation, and ease of entry.  There are libraries to connect PHP to virtually every database, REST API, or other third party software.  These are all reasons I began using the language in the first place.

PHP is supported on virtually every web hosting company on the planet, making PHP a useful skill to have.  There are some great open source frameworks and apps like WordPress, Zend, Joomla and too many others to list.

Why no more PHP?  First, I should probably clarify that I will continue to use PHP as many of the projects I'm working on still use PHP.  However, there are many quirks about PHP that have been bothering me.  I won't go into detail because I will not be saying anything new about the subject. If you want to read the most epic of rants on PHP issues, see this post.

PHP code, especially large code repositories, have become difficult for me to enjoy maintaining.  Sometimes your app just stops working because of some typo in your code or the spaghetti code becomes just too unreadable.

PHP just doesn't seem exciting for me anymore.  There doesn't seem to be anything exciting happening.  Yes PHP 5.4 was recently released which has the new Traits feature, but other than that, not much has been happening with the language and nothing interesting as far as apps or frameworks. The only object that piqued my interest was Laravel.

Why not Python/Ruby/Java/Any Other Language?

I like to consider myself open to trying new programming languages.  Even if you don't wind up using a language long term, sometimes your programming skills can still benefit from solving solutions from a different point of view.  Below is a quick overview of my dealings with other languages.  Most were brief enough that they shouldn't be taken too seriously.

Python - I have no problems with Python.  I have completed a couple of projects in Python and find it a joy to work with.
Ruby - My only experience was with Ruby On Rails around version 0.9.3.  At the time, the framework made coding easier but at the expense of performance.  Scaling was terrible at the time.
Node- This seems to be all the rage.  Everybody likes to use the term "Non-Blocking" to make themselves seem cool.  The draw is to be able to code the same language client side and server side and even share that code so you don't have to write validations in two places.  Node is still young but provides ample libraries with a large developer community already.
Java - Too bloated for me and if I use it there is a possibility Oracle might sue me!
C -   I mostly used it in school and haven't had the need to use it since.
C# -  This language seemed well thought out, but I am not into using .NET products and Mono just wasn't a viable solution for me.

There are some languages that I would like to still try (for various different reasons) like Clojure, Scala, Dart, Smalltalk, Erlang, and Haskell.  I will get to them when I can.

Why is Go the Shiznit?

Go makes me a better coder!  I enjoy coding more with Go and was productive very quickly.  The documentation was complete and organized.  The support forums are great and are frequented by the core contributors of the language.  Effective Go is a great way to get started with Go.

I like the multiple return values instead of exceptions which forces you to deal with errors right away.

Some people don't like static typing and strict compilers, I do.  It saves me a lot of debugging time and prevents my program from crashing in a rare use case.  The compiler will tell me if I declared a variable and didn't use it or tried to use an undeclared variable, both signs that I have probably made a typo somewhere. The compiler is very fast!  Large apps can still compile in under half a second.

Since I'm not a sysadmin, I prefer to pay extra to have my code managed by someone.   Besides Google App Engine, people have implemented Go on Heroku and OpenShift.

Although I haven't used it, Go's concurrency model seems straightforward and easy to use.

Interfaces and reflection are awesome.  Takes a little getting used to, but once interfaces click in your head, you'll be hooked.  There is a blog post that sums interfaces/reflection up better than I can at


Go helps me write cleaner and more maintainable code.  Now that Go 1 has been released, the code base has really stabilized, allowing me to feel more confident about using Go in a production environment.  The maintainers of Go say: "People who write Go 1 programs can be confident that those programs will continue to compile and run without change, in many environments, on a time scale of years."

Since there are millions of PHP users and six people who read this blog (Hi Mom!), I doubt that I will cause of a shift of PHP users to use Go, but maybe the next time you have a project that is a fit for Go, you will give it a try!  You can create Google App Engine projects for free to help you get started.


  1. This matches many of my own feelings.

  2. You should post a simple hello world with Go on Heroku.

  3. I have never been a PHP developer but I do Python. I agree with your last header completely, glad I'm not the only one who feels that way.

  4. I'm a PHP developer, but I'm trying to switch too.
    But I'm interested in HTML5 so I'll go for DART

    1. Go is great to use the features of HTML5. My web applications use the native facilities to handle for example json and websockets in an incredibly easy way.

  5. This comment has been removed by the author.

  6. If you like python/ruby please check groovy/grails.

  7. I read this article for the fourth time
    I think I also want to move from the php language to a new language and more efficient
    In this article based on comments
    Dart better for me to online applications because it is server & client side will save time
    But I want to Go with the language of another client side

    1. Glad you took the time to read it once let alone 4 times!

  8. As you immerse yourself with Go. You will find that some of it's virtues besides speed and concurrency are the tool sets. Go's philosophy is aimed at optimizing the efficiency of the end user. There are so many small optimizations to mention; such as "go fmt" which automatically formats indentation of your builds, "go doc" built in documentation, etc,...

    Another major encounter was design. Note, that I come from an Object Oriented language (Ruby). If this is your case; you will find that the idiomatic way to Go programming is a bit different. Go is a procedural language, but it's implementation details are slightly different than one might imagine, almost anything you can achieve using inheritance in another language, you can build in Go! using what gopher's like to call as, "composition."

    There is an awesome article written by Nathan Youngman which I highly recommend every beginner should read. It really put many details into perspective for me. Go Object Oriented Design

  9. I wrote a similar article a few years ago. For me it was PHP to possibly Groovy and Grails. I found that too bloated right along with Java. I also went through Go when it was too young and Python which I loved. I'm now on Go as my language of choice. Easy to write, compiled native code, and probably the least problems I've had with typed languages. Just can't beat it.

  10. The draw is to be able to code the same language client side and server side and even share that code so you don't have to write validations in two places.

    pgp download

  11. What Database do you suggest to use with GO? is MySQL good to go with Go?

    1. There are libraries for all the major databases out there to use with Go. I would recommend using whichever you are most comfortable with. If you like MongoDB, there is a great wrapper for it.

  12. Go is extraordinary to utilize the characteristics of Html5. My web requisitions utilize the local offices to handle for instance json and websockets in a fantastically simple way.

    cool website design // Best Web Design

  13. So.. Are you getting any Go work or is the PHP work still dominating?

  14. Go is a procedural language, but it's implementation details are slightly different than one might imagine, almost anything you can achieve using inheritance in another language, you can build in Go!

    PHP Development Company

  15. Really Nice Information,Thank You Very Much For Sharing.
    Web Designing Company

  16. Web programmer than would be who makes dynamic applications. Web programmer has little bit of designing information but better at making applications.Develop Android App

  17. Delta Decisions Inc. is a premiere web development firm specializing in e-commerce and business websites. We offer services including website design, web hosting, SEO servives, pay-per-click, google adwords, website branding and much more.
    web design Toronto

  18. This comment has been removed by the author.

  19. Those are the important features and will surely bring around more of the certain features which are needed to be occupied herewith. best splash pages

  20. Easily, the post is actually the best on this deserving topic. I fit in with your conclusions and will eagerly look forward to your upcoming updates. Just saying thanks will not just be sufficient, for the extraordinary lucidity in your writing. I will at once grab your rss feed to stay privy of any updates. Delightful work and much success in your business efforts!
    website development company in United States

  21. Thank you for sharing this post about the best techniques for PHP Development, This is very useful for PHP Development and PHP Development CompanyBangalore Web Design Company | Web Development Company Bangalore

  22. The Post was really very useful and thanks for sharing the information about this topic. Website Development Company in Florida

  23. Great site for these post and i am seeing the most of contents have useful for my Carrier.Thanks to such a useful information.Any information are commands like to share him.
    PHP Training in Chennai

  24. Really it was an awesome article...very interesting to read..You have provided an nice article....Thanks for sharing..
    Android Training in Chennai
    Ios Training in Chennai

  25. Hi,

    Thanks for sharing a very interesting article about Dumping PHP For Go. This is very useful information for online blog review readers. Keep it up such a nice posting like this.

    Web Design Company Bangalore

  26. I found your blog while searching for the updates, I am happy to be here. Very useful content and also easily understandable providing.. Believe me I did wrote an post about tutorials for beginners with reference of your blog. 
    rpa training in bangalore
    best rpa training in bangalore
    RPA training in bangalore
    rpa course in bangalore
    rpa training in chennai
    rpa online training

  27. Whoa! I’m enjoying the template/theme of this website. It’s simple, yet effective. A lot of times it’s very hard to get that “perfect balance” between superb usability and visual appeal. I must say you’ve done a very good job with this.

    AWS Training in Marathahalli | AWS Training in Bangalore

  28. This is quite educational arrange. It has famous breeding about what I rarity to vouch. Colossal proverb. This trumpet is a famous tone to nab to troths. Congratulations on a career well achieved. This arrange is synchronous s informative impolites festivity to pity. I appreciated what you ok extremely here 
    python Online training in chennai
    python training institute in marathahalli
    python training institute in btm
    Python training course in Chennai

  29. Nice post. By reading your blog, i get inspired and this provides some useful information. Thank you for posting this exclusive post for our vision. 
    AWS Training in Bangalore
    AWS training in sholinganallur
    AWS training in Tambaram
    AWS training in Velachery

  30. Very nice post here and thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.
    AWS Training in Bangalore
    AWS training in sholinganallur
    AWS training in Tambaram
    AWS training in Velachery

  31. Great post. I was once checking constantly this weblog and I'm impressed! Extremely useful information specially the closing part. I maintain such information much. I was once seeking this specific information for a very long time. Many thanks and best of luck.
    oneplus service center chennai
    oneplus service center in chennai
    oneplus service centre chennai
    oneplus service centre
    oneplus mobile service center in chennai
    oneplus mobile service center

  32. That was a great message in my carrier, and It's wonderful commands like mind relaxes with understand words of knowledge by information's.

    Python Training | Python Course | Python Training in Chennai | Python Course in Chennai

    Php Training | Php Training in Chennai | Php Training Institute in Chennai | Php Training Institute

  33. Very nice post here thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.

    Check out : best hadoop certification in chennai
    best hadoop training institute in chennai with placement
    best bigdata hadoop training in chennai
    big data training in chennai velachery

  34. Hello, I read your blog occasionally, and I own a similar one, and I was just wondering if you get a lot of spam remarks? If so how do you stop it, any plugin or anything you can advise? I get so much lately it’s driving me insane, so any assistance is very much appreciated.
    AWS Training in Chennai | Best AWS Training in Chennai
    Best Data Science Training in Chennai
    Best Python Training in Chennai
    Best RPA Training in Chennai
    Digital Marketing Training in Chennai
    Matlab Training in Chennai
    Best AWS Course Training in Chennai
    Best Devops Course Training in Chennai
    Java Training Institute in Chennai
    C C++ Training in Chennai

  35. Thanks For Sharing The Information The Information Shared Is Very Valuable Please Keep Updating Us Time Just Went On Reading The article Python Online Course Hadoop Online Course Aws Online Course Data Science Online Course

  36. FQ Technologies is a significant IT sector, offering courses on high-quality technical areas. Through us, aspiring students will get to learn the importance of IT training project Data Science Online Training | Data Science Training | Hyderabad | India Machine Learning Online Training | Machine Learning Training | Hyderabad Python Online Training | Python Training | Hyderabad | India

  37. Nice Post about PHP. I am front end designer.. So i use it some times in form.

    Flats in shahakr nagar bangalore

  38. Ready to build a mobile application with the iOS or Android SDK? Learn how with our tutorials that cover iOS and Android development, as well as Windows Mobile app development.

    Currently, there are 5 major mobile platforms, each with its own core language(s) and development environment:

    Mobile PlatformCore Language(s)Dev. EnvironmentMobile Devices

    AndroidJavaEclipseMultiple Vendors

    iOS (Apple)Objective-C & SwiftXcodeApple Devices Only

    RIM (Blackberry)JavaEclipseBlackberry Only

    SymbianC++Multiple choicesMultiple Vendors

    Windows MobileC#Visual Studio 2010Multiple Vendors

    Responsible for Android / iOS client development and maintenance

    Develop the corresponding function according to product demands

    To complete the application module design, coding, and testing

    Provide the technical support, and responsible for the product online, subsequent versions of the update.

    Typical employers of mobile developers

    Android and iOS app development companies

    Android and iOS platform development companies

    Software companies


    The healthcare sector

    Travel and tourism industry

    Entertainment industry

    Financial services

    Media organizations

  39. Hey, very nice site. I came across this on Google, and I am stoked that I did. I will definitely be coming back here more often. Wish I could add to the conversation and bring a bit more to the table, but am just taking in as much info as I can at the moment. Thanks .

  40. Download latest audio and video file fromvidmate

  41. Php is still very famous and rich with library functions.

    Flats in Sahakar nagar

  42. Our team has expertise in every niche: Agriculture Web Design | Aviation Web Design | Beauty Web Design | Bike Shop Web Design | Cardiology Web Design | Fashion Web Design | Home Care Web Design | Hospital Web Design | Hotel Web Design | Medical Spa Web Design | Pool Company Web Design | Salon Web Design | Travel Agency Web Design & many more.