4 edycja
warsztatów zakończona

Python vs PHP - business and developer’s view

Published: Fri 05 September 2014
Author: Piotr Mazurek
tags: python php

Introduction

Although 21 century definitely belongs to IT specialists, being a good developer is neither easy nor cheap. Programmers are in constant process of learning and developing skills, in a state of permament change. Being called a geek is a compliment which shows just how engaged you are and how advanced is your knowledge.

Moreover, there is a difficulty in chosing a programming language or frameworks which must be not only a good source of income but also challenging and fullfilling.

Unfortunately, as it often happens the decision about your programming language of choice is taken randomly, and the college study programme simply does not reflect reality and the bussiness expectations of Product Owners. In many cases after few years of work, in order to be able to still develop yourself and stay up to date, you need to reskill to another language.

This may concern some PHP developers who had already drained the potential of this language and are looking for something new. In this article I am going to describe the reasons why Python is worth getting familiar with.

STX Next is a Python Software House, the biggest one in Europe. We base our work on Python frameworks (i.e. Django, Plone, Flask, Pyramid). We are specialists in this language. The fact that we manage all our projects using only agile methods, places us on the cutting edge of modern Software Houses in the world. It's been a while since we had discovered that there is a huge potential in PHP programmers that reskilled to Python. Those developers are the quickest to learn Python and they achieve really high efficiency. This inspired us to carry out a big educational action called Python Has Power (www.pythonhaspower.com), aimed at the group of expierienced programmers. This action consists of series of articles and free workshops. By taking part in them everyone will be able to learn basics of Python and maybe even get an interesting job oportunity in an international environment.

About whom and on what?

I primarily address this article to PHP programmers who already have a few years of experience. If you are a junior you are probably still very fascinated about your workplace. Your tasks, even though objectively easy, are challenging and fun. Provided that you have been using PHP for about two or three years so far, you possibly asked yourself a question: what will I be doing the same time next year? The basic problem about every PHP programmer is that he probably did not give it enough thougt.

Be honest with yourself - will work that you will be doing in a year or two from today be very different from what you're doing now? Probably yes - you will be developing some other app, perhaps in other bussiness, maybe for a different boss. Will it be challenging for you?

Projects that are being developed in PHP in most cases do not go far from setting up a not very complicated applications with few functonalities. You will probably contradict, saying that the application you are currently working on is not that simple. But when I say "not very complicated" I am comparing it to a projects that are developed during thousands of hours by a dozen or so developers. Is the application you are currently developing like that? Don’t get me wrong, I'm not saying that there are no ambitious projects in PHP. Of course there are! Some would probably overgrow me and some other I would find very amusing. The issue I try to address here is the character of the market.

The attractiveness of PHP developer on the job market

Let's face it - PHP is a language of a very low entry point. It is possible that student is able to download a nice looking template, pin it with some CMS - or even write someting on his own - and sell it for a few hundreds euro. He will probably spend ten times more time you would need, and the code produced will be probably not even the tenth the quality that you would produce. But the client only needs a working website, so the users can visit and see neatly prepared pictures, photos of products, or maybe commercials. Will he be willing to pay you more money, because you have more experience? Have you ever thought about bussiness side of your job? If you run a small company all you need is a small website. Are you willing to pay for code quality and the inteligence quotient of the contractor? I don’t think so.

Part of the websites’ market is strongly dominated by PHP technology especially because of the low entry point. That is why we often see a job offers "we are looking for a PHP programmer, 3 years of experience minimum, we require strong skills in JS, jQuery, HTML and CSS, knowledge of Photoshop is a plus". You can guess what you would be doing in this position? Now, it’s the time for the cause and effect relationship leading to a conclusion - if you will be doing what you’re supposed to do - do you think that your employer will be getting big cheques for the project? Will he be then willing to pay you more?

What I'm trying to point out here is the fact, that your attractiveness on the job market is slowly declining after some time. It's not necessarily because you’ve stopped developing yourself. If you feel that your skills are constantly growing, and your salary is not growing as dynamically as them - it may be not you that causes the problem but the market you work on. I know it might sound harsh, but your attractiveness for about 90% of your market is not growing proportionally with your abilities.

What do you think - what differs the employer who is able to ensure worthy conditions of collaboration, good salaries and interesting trainings, from the one that always gives you the feeling of cutting the budget on every step? There are probably many factors, but in my opinion their intentions are not very different - they both aim at pure profit. What differs them is probably the clients whose projects they realise. The more complicated the project the bigger the entry point is, and what follows - higher paid employees. And if the projects differ in size, they probably also differ in the technology involved.

And here we come to the bottom line. If you feel happy about your job, your employer is able to ensure everything you need, your job is interesting and still gives you challenges - you don’t need changes. If on the other hand you feel that it is getting a little burn out, your abilities are not being appreciated as much, and your daily tasks start to look very alike - it is the right time to change something!

From PHP to Python, my story

If I were to advice you from my personal experience, my opinion is that there is no better choice for a PHP programmer than Python. There are many reasons. Allow me to enumerate these which played the biggest role for me.

First of all, after few years of programming you probably know the IT world good enough to be able to easily jump into some new, big framework - probably both from the technical and business side. This is something that you learn with time. Pure experience. It makes you able to literally "jump" into the Python world. The entry point of Python is greater than PHP - I'm talking not only about the language but also the business complexity of projects. However, you being a programmer for quite a few years have a great advantage here. The switch from the few years of PHP programming to Python was really easy for me. It is something that is worth noticing and remembering - although this change will be really easy for you - it might be hard for developers without much experience.

Another case is that along with your reskill you earn a lot of possibilities you hadn’t even dreamt about before. Python is not restricted only to web development. Isn't it a tempting perpective, that with language you work in and learn for 8 hours a day (and getting paid for it! :) ) you will be able to write, let’s say, desktop application? Or maybe a plugin for, a recently very popular editor - SublimeText?

What you gain - What you loose

A huge plus of Python is that some of the solutions commonly used in PHP are present in Python for a long time, and naturally - are well tested. A good example of this is Composer, which is an outstanding solution. The ability of managing your packages easily is very useful. In Python however, there has always been a tool called pip. It's a manager based on the official Python package repository - the best equivalent of this in PHP is the packagist.

Moving towards Python you could be affraid of losing what’s became very popular in the PHP community lately - unit testing, TDD, etc. You probably already like this way of programming, you know its benefits and you would not want to join a group of programmers that never heard of testing. You couldn’t be more wrong! These methods of testing are also present in Python. Well tested applications are the standard in nowadays Python - an application not covered with tests is actually considered incomplete.

An incredible advantage for Python is surely a tool called pdb. In PHP there are some more or less successfull approaches to debugging applications - for example xdebug. Not sure about you, but for me using it was more like a debugging xdebug than my code.

Of course I'm writing it with a pinch of salt here, nonetheless running and using xdebug - especially on applications not written properly - often wouldn’t lead to a spectacular success. When you switch to pdb, you suddenly feel like your hands have just been untied and you feel freedom. You could even say something even more bold - after switching to Python debugging will finally have sense, which it has never had before!

The pdb itself is incredibly easy in usage, you just need to add one short line of code, and after you run the application Python will stop executing right in place you showed him and present you a "gate" through which we can freely view/define variables, call functions, methods, move to another line of code or even list the code of a given function. As a retired PHP programmer I can say with clear consciense that I've learnt what debugging really is only using Python. Even though before I would call myself a decent debugger.

Currently the Python universe is torn apart into two parts - Python 2 and Python 3. Python 3 introduced incompatible changes, so to use it all libraries, frameworks and applications have to be migrated. This transition has been going on for the last few years. More and more new projects start on Python 3 but majority of big projects stuck on Python 2. What this means for new Python coders is that you need to learn both versions.

Summary

Many examples can be given, which we will surely do during our Python workshops for PHP programmers. We are starting off in November. Participation in Python workshops can be a great opportunity for you but also a great possibility to discuss the topic with tutors.

And what about the work in python? It will surely be fun and efficient. Perhaps, having your own habits makes you stay with you old language? It might be. No one will force you towards change. But just think about the chance that awaits you to grab it. It is for sure that Python market is full of great, complicated and ambitious projects. However, it is still missing specialists, and what follows - they are well paid. If you have been using PHP for few years and you need an impulse which would allow you to discover the world of Python, take a look at Python Has Power run by STX Next. Perhaps it is the Python language that will completely change your day to day boredom in your current job?

Piotr Mazurek Piotr Mazurek

I began my career in PHP technology when I graduated from University of Technology majoring in technical physics. Throughout my life I have always been interested in programming and from the young age I was involved in IT related projects. I also had an adventure with Linux servers administration. I am currently a Python developer at STX Next, where I am part of the team that creates software for customers in the banking sector. In addition, I write articles and I am involved in educational projects, supported by the company, such as Python Has Power.

comments powered by Disqus
Współpraca: programista