2

I have been coding in python/django and c/c++ from last three years for various web-based and desktop applications in my previous companies. While following the general learning curve, I started working on functional programming languges like Haskell/Erlang. But recently I switched to a company where the programming languages used are php and Java.

Having switched to python did change the way I used to code, mostly in good sense, and then learning haskell added another dimension to the thought process.

I would like to know if:

  • Learning php and java (I have done a project in groovy/grails too) would be like stepping back on the learning curve?

  • The present company basically uses smarty as a template engine, also there is no ORM which is kind of frustrating after having worked in django, Is there any way ORM and other such features can be included?

  • Does it make sense to continue learning python/haskell assuming that I will be staying in the present company for pretty long ?

  • Also, what can be the right way to move from python to php? I know its wierd because usually people ask the other way around (php to python)

3
  • 8
    The right way to move from Python to PHP is at 120mph straight down. Commented Jun 13, 2011 at 5:49
  • Yes, I understand that, but porting down the whole code from php to python will take a long time, and is not commercially viable for the company, so anyhow I am supposed to learn it, though I am hating the experience. Commented Jun 13, 2011 at 5:53
  • 5
    Unfortunately all I can suggest is that you hunt down the largest bottle of naproxen that you can find. Commented Jun 13, 2011 at 5:56

1 Answer 1

3
  • If you must do step down to php, at least use one of the good available MVC frameworks with an ORM:

  • Adopt the good parts of using the framework: Don't forget to write tests as you move to php!

  • Keep database/serialized objects simple and clear - so they can be accessed from other programming languages in parallel or when you move out of php world. I.e., don't use php's serialize(), but json, protobufs, thrift.

  • Try to keep the php portions of your code as small as possible and limited to web frontend - fight any attempt to create new backend services using php, which is not so good in memory management, threading etc. If you already use Java, you can use it for this purpose (or intrduce python...)

  • http://www.phpsh.org/ is your new ipython, although not as useful

  • If possible, try sticking to php 5.3 with namespaces and better memory management

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks Udi. Zend is being used already, although I still see people making raw db queries in the code which doesnt make much sense. Also, not having namespaces is considered a good point for php, isnt it?
@bilkubekar: namespaces are many times a matter of personal taste. Usually python programmers love them and php programmers don't: It is hard to tame existing code to use namespaces, and does not make sense in many php contexts. However php 5.3 have other goodies as anonymous functions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.