I'm a php developer working on a startup, and my friend, my partner(a developer also), who is building the startup with me, is an asp.net/C# developer.

How do we work together collaboratively, as we program in two distinct languages? I know you can use Mono http://mono-project.com to design android applications, (which is java based) by writing C# codes and iOS.

Is there any platform or framework we can use to create php apps by writing codes in C# or a framework that can convert C# codes to php, just like Mono?

closed as not a real question by gnat, Dynamic, user40980, user53019, Jalayn Jun 11 '13 at 12:11

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.


You should learn ASP.NET/C#. The fact that you say you're a "PHP developer" hints that it's your only language; learning C# will be both a great learning experience and a good career move. If possible, pair with your friend using one monitor and two keyboards. Take turns typing code and asking questions. Jon Skeet's book, C# in Depth, is excellent. If it feels too advanced, try Head First C#.

  • I can start learning C# and asp.net, that's not a problem. Another thing is time, i might not have the time to start learning asp.net, but i'm very conversant and good with php. I was thinking if there's any framework that can help convert my php codes to asp.net codes and still maintain the same functionality, like a compiler or something, i've not really heard of any like that, it will be cool if there's something like that. – samson ade Jun 10 '13 at 23:00
  • There is nothing like that; and, even if there were, you would pay more in maintenance costs later than you will pay up-front in learning costs to learn a new language now. – asthasr Jun 10 '13 at 23:16

The short answer is no, there isn't.

You (or he) could produce a web API that the other could use for website / mobile apps or there are frameworks like Phalanger that you can compile assemblies in PHP to use with with other .Net languages (C#, VB.Net, F# etc). Note: I've not used Phalanger (so please don't take it as a recommendation) and it doesn't convert between languages.

To work in the same project C# and PHP are worlds apart in many respects (for example C# enforces type safety) and a lot of work goes into keeping code, data and presentation/markup separate. A best practice that in my experience of PHP (mostly Wordpress plugins) is possible but rarely happens, and more so in the types of code snippets that most people learn PHP from.

Ultimately it would be a lot of effort for little return to keep writing both and at most all you could do is produce assemblies for each other to use which is just going to make life difficult eventually. The books Syrion recommends in his answer are a great start if you want to expand your horizons, otherwise you'll have to try & tempt a C# dev to PHP.

  • i've checked it out it converts php codes to .net assemblies but i'm not sure about this php-compiler.net phalanger, security, and others, and i don't think people really use it. – samson ade Jun 10 '13 at 23:11
  • You probably don't understand what a .Net assembly is which probably doesn't help - it's not a concept that really exists in PHP. I included Phalanger as a way you could work in native languages and reuse your existing php if you have some and said that it probably wasn't a good idea. I'm glad you agree. – James Snell Jun 10 '13 at 23:35

If you both are going to work on a shared codebase, the only sensible way is to use a language you both master.

The best option, by far, is to learn each others' language. Not only will this give you two shared languages to work with (which means you can choose the most appropriate one for the job at hand), learning new languages is essential to becoming a versatile developer with an eye for the big picture and a nice big toolbox full of alternatives to pick from.

Another option is to both learn a third language. This is especially interesting when neither language is a good fit for whatever it is you're going to build: both PHP and C# have some serious downsides, and it might just turn out that, say, Python could be the best language for your project. Again, learning a new programming language is always a good investment, even if you end up not using it.

A third option would be to strictly split up the codebase into a C# part and a PHP part, and define language-agnostic interfaces between them. For example, you could have a C# front-end that talks to a PHP server over a RESTful API. This is seldom a good choice, though, and it will make your team structure overly rigid: you can't just jump in and help with the other half of the project, because it's in a language you don't know. It also means the both of you will have a huge bus factor, so I suggest you don't do this.

TL;DR: Just get your act together and learn each other's language.

Not the answer you're looking for? Browse other questions tagged or ask your own question.