Sunday, July 8, 2012

Dumping PHP For Go

Background

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 http://blog.golang.org/2011/09/laws-of-reflection.html.


Conclusion

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.






139 comments:

  1. This matches many of my own feelings.

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

    ReplyDelete
  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.

    ReplyDelete
  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

    ReplyDelete
    Replies
    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.

      Delete
  5. This comment has been removed by the author.

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

    ReplyDelete
  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

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

      Delete
  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

    ReplyDelete
  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.

    ReplyDelete
  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

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

    ReplyDelete
    Replies
    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.

      http://labix.org/mgo

      Delete
  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

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

    ReplyDelete
  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

    ReplyDelete
  15. 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

    ReplyDelete
  16. 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

    ReplyDelete
  17. This comment has been removed by the author.

    ReplyDelete
  18. 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

    ReplyDelete
  19. 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

    ReplyDelete
  20. 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

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

    ReplyDelete
  22. 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.

    Regards,
    WondersMind,
    Web Design Company Bangalore

    ReplyDelete
  23. 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

    ReplyDelete
  24. 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 BTM LAYOUT | AWS TRAINING IN BANGALORE
    AWS Training in Marathahalli | AWS Training in Bangalore

    ReplyDelete
  25. 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

    ReplyDelete
  26. 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

    ReplyDelete
  27. 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

    ReplyDelete
  28. 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

    ReplyDelete
  29. This comment has been removed by the author.

    ReplyDelete
  30. 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

    ReplyDelete
  31. 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

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

    Flats in shahakr nagar bangalore

    ReplyDelete
  33. 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

    Retailers

    The healthcare sector

    Travel and tourism industry

    Entertainment industry

    Financial services

    Media organizations

    ReplyDelete
  34. Php is still very famous and rich with library functions.

    Flats in Sahakar nagar

    ReplyDelete
  35. 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.

    ReplyDelete
  36. This blog is awesome. I find this blog to be very interesting and very resourceful. I would say Your resource is so interesting and informative for me and this article explained everything in detail.

    Send flowers to hubli
    send flowers online
    send flowers to dharwad
    online flower delivery to hubli
    send gifts to hubli
    online gifts delivery to hubli
    online flower delivery to dharwad

    ReplyDelete
  37. This blog is awesome. I find this blog to be very interesting and very resourceful. I would say your resource is so interesting and informative for me and this article explained everything in detail.
    send cake to mysore

    online cake delivery to mysore

    send flowers to mysore

    online gifts delivery to mysore




    ReplyDelete
  38. This blog is awesome. I find this blog to be very interesting and very resourceful. I would say your resource is so interesting and informative for me and this article explained everything in detail.
    Send flowers to hubli
    send flowers online
    send flowers to dharwad
    online flower delivery to hubli
    send gifts to hubli
    online gifts delivery to hubli
    online flower delivery to dharwad

    ReplyDelete
  39. This blog is awesome. I find this blog to be very interesting and very resourceful. I would say your resource is so interesting and informative for me and this article explained everything in detail.

    Web design company in dharwad

    Web development in dharwad
    Seo service in belgaum
    Web development company in hubli
    Web design in belgaum
    Web design company in belgaum
    Seo company in dharwad

    ReplyDelete
  40. This blog is awesome. I find this blog to be very interesting and very resourceful. I would say your resource is so interesting and informative for me and this article explained everything in detail.
    send cake to mysore
    online cake delivery to mysore
    send flowers to mysore
    online gifts delivery to mysore

    ReplyDelete
  41. I really enjoy simply reading all of your weblogs. Simply wanted to inform you that you have people like me who appreciate your work.Such a nice post,thanks for sharing this with us.Really so impressible and attractive post.
    Send flowers to hubli
    send flowers online in dharwad
    send flowers to dharwad
    online flower delivery to hubli
    send gifts to hubli
    online gifts delivery to hubli
    online flower delivery to dharwad

    ReplyDelete
  42. This blog is awesome. I find this blog to be very interesting and very resourceful. I would say your resource is so interesting and informative for me and this article explained everything in detail.
    send cake to mysore
    online cake delivery to mysore
    send flowers to mysore
    online gifts delivery to mysore

    ReplyDelete
  43. Thank you for your article. I have read through some similar topics. However, your article gave me a very special impression, unlike other articles. I hope you continue to have valuable articles like this or more to share with everyone!
    Send flowers to hubli
    send flowers online in dharwad
    send flowers to dharwad
    online flower delivery to hubli
    send gifts to hubli
    online gifts delivery to hubli
    online flower delivery to dharwad

    ReplyDelete
  44. This comment has been removed by the author.

    ReplyDelete
  45. Florist – Bouquet Flowers Shop in OMR, Flowers are capable to express your innermost feelings in the silent language of love.Flower bouquet shop in omr

    ReplyDelete
  46. Florist – Bouquet Flowers Shop in OMR, Flowers are capable to express your innermost feelings in the silent language of love.Flower bouquet shop in omr

    ReplyDelete
  47. Thanks for sharing this informative post. I m very pleased to read this article .I enjoy this site. its so usefully and helpfully post.Visit Webdots Hubli for best website design and development.
    webdesign in hubli
    seo service in hubli
    webdesign in dharwad
    digital marketing services
    digital marketing classes



    ReplyDelete
  48. The information you shared is marvelous. Do you have a website and want to rank on the first pages of the Google, contact one of the best seo company in Indore. Thanks for sharing.

    ReplyDelete
  49. Whatever we gathered information from the blogs, we should implement that in practically then only we can understand that exact thing clearly data science training
    , but it’s no need to do it, because you have explained the concepts very well. It was crystal clear, keep sharing..

    ReplyDelete
  50. This blog is awesome. I find this blog to be very interesting and very resourceful.I would say your resource is so interesting and informative for me and this article explained everything in detail.

    Homestay near Haveri
    Resort near Haveri

    ReplyDelete
  51. I really like looking through a post tv that can make people think. Also, thank you for permitting me to comment!

    ReplyDelete
  52. The next time I examine a weblog, I wish that it does now not fail me genuinely as a good deal as this specific one. I imply, I comprehend it was my choice to observe, despite the fact that I definitely believed you will likely have some aspect beneficial to speak about. click All I listen is a gaggle of whining about some thing you may restore if you have been now not too busy seeking out attention.

    ReplyDelete
  53. Wow!! Really a nice Article about Python. Thank you so much for your efforts. Definitely, it will be helpful for others. I would like to follow your blog. Share more like this. Thanks Again.
    Java training in chennai | Java training in annanagar | Java training in omr | Java training in porur | Java training in tambaram | Java training in velachery

    ReplyDelete
  54. thanks for sharing this is really helpful and needy for my
    project.Hope you add more in future also

    ReplyDelete
  55. This comment has been removed by the author.

    ReplyDelete
  56. I have just finished reading your article. I want to tell you how much I appreciate your clearly written and thought provoking article. Thank you for thorough research and creative writing.
    Web Designing Course Training in Chennai | Web Designing Course Training in annanagar | Web Designing Course Training in omr | Web Designing Course Training in porur | Web Designing Course Training in tambaram | Web Designing Course Training in velachery

    ReplyDelete
  57. thanks for sharing this is really helpful for my upcoming project

    ReplyDelete
  58. 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.

    AWS training in Chennai

    AWS Online Training in Chennai

    AWS training in Bangalore

    AWS training in Hyderabad

    AWS training in Coimbatore

    AWS training


    ReplyDelete
  59. Wow, This is really appreciating and looking foreword to. This is really kind of relaxation thing because world is thinking as the same way we are.

    ReplyDelete
  60. It's a really great and useful piece of information. Thanks, and please keep up the rewarding work. Van Helsing Coat

    ReplyDelete
  61. This is the best post I have ever seen. Very clear and simple. Mid-portion Is quite interesting though. Keep doing this. I will visit your site again.

    Rocky Tiger Jacket

    ReplyDelete
  62. If you need help learning how to write an essay, this is a great place to start. College writing can be challenging and difficult to understand for new college students. This brief guide introduces essay writing at the college level. essay writing service

    ReplyDelete
  63. Thanks for posting this info. I just want to let you know that I just check out your site and I find it very interesting and informative Fashion bloggers in India

    ReplyDelete

  64. Your work is very good and I appreciate you and hopping for some more informative posts. ExcelR Data Science Course In Pune

    ReplyDelete
  65. I want you to thank for your time of this wonderful read!!! I definitely enjoy every little bit of it and I have you bookmarked to check out new stuff of your blog a must read blog! ExcelR Data Analyst Course

    ReplyDelete
  66. Thanks for the interesting content. I like your post and your blog is amazing.
    If you are interested in Video Downloader apps you can check my blog site. It is new and really informative.

    filmywap 2015 hd movies download

    ReplyDelete
  67. Thats great post !! I like ur every post they always give me some new knowledge.
    VidMate | VidMate for PC |
    VidMate 2014

    ReplyDelete
  68. Really helpful and great article thanks a lot .
    web Designs and Development company in Indore, Digital Marketing services in Indore, Digital marketing company in Indore.

    https://lassoart.com/

    ReplyDelete
  69. good and knowledgeable content thanks for sharing.
    https://lassoart.com/
    Web Design and development services and company in Indore, Digital Marketing services in Indore. Digital Marketing company in Indore.

    ReplyDelete
  70. its very interesting to read.thanks for sharing.Angular training in Chennai

    ReplyDelete
  71. Nice post brother, I have been surfing online more than 3 hours today, yet I never found any interesting article like yours. It is pretty worth enough for me. In my view, if all web owners and bloggers made good content as you did, the internet will be much more useful than ever before. There is certainly a lot to know about this issue.I love all of the points you’ve made. I am sure this post has touched all the internet viewers.
    vé máy bay từ mỹ về việt nam hãng ana

    khi nào có chuyến bay từ đức về việt nam

    lịch bay từ anh về việt nam hôm nay

    vé máy bay từ úc về việt nam giá rẻ

    Săn vé máy bay 0 đồng tu Dai Loan ve Viet Nam

    chuyến bay thương mại từ canada về việt nam

    ReplyDelete
  72. Enjoyed a lot while reading this amazing article this was very informative & knowledgeable content on this blog thanx for sharing such an amazing article. WEB DEVELOPMENT Company in Indore

    ReplyDelete
  73. Such an interesting article here.I was searching for something like that for quite a long time and at last I have found it here. Royal Enfield Jacket

    ReplyDelete
  74. Welcome to CapturedCurrentNews – Latest & Breaking India News 2021
    Hello Friends My Name Anthony Morris.latest and breaking news drupepower.com

    ReplyDelete
  75. I never read an informative blog such as this. I really appreciate your work. keep it up and keep updating.

    ReplyDelete
  76. How to Deal with Search in Outlook Not Working?

    Outlook users mostly have the query related to search in Outlook not working. If you are also facing the same issue then you need to restart your Outlook device properly. One can also think to repair Outlook program by using the Microsoft Inbuilt Repair tool. This tool will help you to deal with the issue smoothly without facing any other error.

    How to Silence Outlook Notifications on iPhone?

    Check out the steps properly and know how to silence Outlook notifications on iPhone, then follow the steps properly. For Gmail users, you need to click on the gear icon towards the upper right of the Gmail window. Now, choose the settings ink and then tap to mail notifications off under the Desktop notifications section. Lastly, tap to save to smoothly silence Outlook notifications on iPhone devices. Follow the steps properly to know about Outlook notifications on your iPhone device.

    Why is My Yahoo Mail Not Working?

    The possibility for users facing why is my Yahoo mail not working issue is because of technical glitches in your account. To deal with it, check for the underneath steps. For this, proceed to iPad or iPhone and then open Safari. Now, proceed to Yahoo homepage or choose the link and i.e.http://mail.yahoo.com/. Lastly, you need to login to your account and then you can send or read the emails properly. Even if everything is working properly then also you need to check account settings as there might be chances those issues lies here only.

    How to Perform Bellsouth Email Setup?

    To perform Bellsouth email setup, open Android and then open Bellsouth in your Gmail account. After that, select the menu bar option and press the drop down next to name and select the add account button. After that, you need to choose either Bellsouth settings, you can either choose POP3 settings or choose IMAP settings for configuring the email account. After that, enter password and tap on next button. Verify the POP server and type att.net for inbound server and 995 as port number. After that, enter Att.net for SMTP settings and 465 as secured security layer. These are the steps to perform Bellsouth email setup process.

    How to Recall Email Outlook App iPhone?

    If you are an iPhone user and want to know about the steps to smoothly recall email Outlook app iPhone then here’s what you have to do. For this, open web browser on iPhone and proceed to Outlook.com. Now, log into your Outlook account by using correct credentials. Now, choose sent items folder and open email that you want to recall. Locate the message tab in open window with your email. Click on recall this message under move option. Lastly, you need to replace the sent email with the new one or delete the unread email by clicking on OK.

    ReplyDelete
  77. Avast SecureLine VPN Crack is an easy-to-use VPN client from a reliable anti-virus software developer - AVAST Software. Avast Secureline Vpn Subscription Code

    ReplyDelete
  78. Reaper Cockos Full 6.70 Crack 64-bit Patch provides you with the greatest audio production unit. A new trend to make a sound, capture the tracks .Reaper Full Crack Download

    ReplyDelete