PHP vs. .NET: Which Should You Learn?

shutterstock_127502615

If you’re a software developer, there simply isn’t enough time in the world to learn every single technology, language and platform you might need for work, or to land a better job; at some point, you’re going to have to decide in what direction you want to expand your knowledge base.

The choices you make in that regard will have a huge impact on your life. If you devote too much time to learning a technology that’s on the verge of obsolescence, it could make future employment a problematic affair. Fortunately, there are lots of technologies that will continue to grow and prove useful to the world for the next several years—but how do you choose between those?

Click here to see PHP jobs.

With all that in mind, let’s look at PHP and .NET, two programming platforms that enjoy broad bases of support. PHP is a general-purpose scripting language that many people rely upon for Web development (hundreds of millions of websites leverage it today) while .NET is a framework built by Microsoft for Windows-related Web work. While it’s certainly possible to learn the intricacies of both platforms, is there one worth tackling more than the other?

First, What’s the Difference?

As mentioned above, PHP is an open-source programming language primarily used for developing Web-based applications. There are a few tools out there that allow you to use it to write desktop applications, but the majority of apps written in PHP run on a Web server (most people using PHP seem to do so with an Apache server, although a few also rely on Microsoft IIS).

PHP is a language, but .NET is a whole platform comprising a few different technologies. There are two main languages you can use with .NET to create either desktop or Web applications: VB.NET and C# (others exist, of course, but those are the main two). As with PHP, .NET requires a Web server (specifically Microsoft IIS) to create Web applications (it also requires ASP.NET, a technology that’s part of .NET’s broader platform).

While .NET is built into Microsoft Windows, you can run .NET desktop applications on Linux using a free and open source product called Mono. PHP sometimes comes pre-installed on Linux, and if not, it’s quick and easy to install. But to develop with either platform, you need some free tools: for .NET, you’ll want one of the free Visual Studio Express products from Microsoft; For PHP, there are several options—one popular choice is Eclipse.

There are benefits to learning either PHP or .NET. Should you learn both? If you’re new to programming, the answer, I think, is No: At an early stage in your career, you need to focus your energy on getting very good at one thing, which will translate into higher-paying jobs down the road. If you try to go to broad, you will stretch yourself thin and not master anything. (I made that mistake early in my career, and it started hurting my job prospects—employers tend to distrust resumes that list hundreds of technologies in which the applicant is supposedly an expert.) Pick one thing and be great at it!

Which Should I Pick?

So which do you pick? Of course, you could take a look at the entry-level jobs for PHP and .NET in your area, and use that data to influence your decision. But that research will only tell you about today: What about five years from now?

Here are some questions to help you work through a possible decision:

  • First, do you want to create desktop applications on Windows? Then .NET is a great way to go.
  • What about Web applications on Windows? Again, .NET is an excellent choice. However, you can do PHP on Windows (although it’s probably more commonly used on Linux).
  • Do you love Linux and want to focus on it? Then go for PHP if you’re doing Web development. While .NET can run on Linux with the help of Mono, it’s more suited to desktop and not Web.
  • So what about desktop apps on Linux, then? In that case, you probably want to move away from both PHP and .NET and study other languages and technologies, such as C++ and Gtk+, or perhaps wxWidgets combined with a language such as C++ or Python. While Mono works on Linux, it’s a bit too narrow in terms of entry-level job opportunities.
  • What if you want to do both Windows and Linux? That’s moving away from what I said earlier about focusing; focus on one or the other early in your career. Later on, you can start to think about things like cross-platform development. But for learning a new technology and landing an entry-level job, please stay focused—with one caveat: If you’re going to go for Web development, don’t forget the client side. Also learn some JavaScript too. (You’ll thank me later.)
  • If you’re going to go for Windows, do you choose C# or VB.NET? This is a potentially contentious question, with strong opinions on either side. One thing to bear in mind is that they’re actually very similar languages underneath, just with different syntax; you can accomplish the same thing with either. But as a software developer with 25 years of experience, I would probably suggest you go the C# route. My reason is where things become contentious: VB.NET has a bit of stigma attached to it as an “amateur” language (even though it’s not). As a result, advanced programmers are more likely to choose C# when starting a new project.

Conclusion

As your programming knowledge becomes more advanced, you’ll find it’s easier to pick up new languages. Many of the popular languages today share similar syntax that has its roots in the original C programming language. (I’m talking about C++, Java, C#, PHP and JavaScript.) That makes it easy to learn them later, and multiple languages may indeed lie in your future—but for now, stay focused. And most importantly: Have fun!

More Articles

Image: Piotr Adamowicz/Shutterstock.com 

Comments

  1. BY Donald Peters says:

    There are some really bad applications written in PHP/MySQL. I don’t think all those crashing and buggy blogs and applications can be blamed on the developers, some of it is an unsteady foundation. Which leads to the question of whether you want your reputation to be associated with that foundation. C# just works and it has the advantage of being syntactically close to Java. So if you really need to migrate to Linux 5 years down the road, you might have the easy option of writing your applications in Java.

    • BY Joe Bob says:

      Really? PHP is a wrapper for C, which has been used since, oh the beginning of software. And you claim it is buggy, so go with Microsoft’s “unbuggy” platform. There’s a reason web developers call it “Internet Exploder”.

      You are just flat out WRONG, WRONG, WRONG.

      Open source problems get fixed, proprietary problems get kicked down the road.

  2. BY Mike Robinson says:

    Thirty-five years ago now, I had the great opportunity to start making a living with what was – and still is – my hobby: computer programming. I’ve witnessed a lot of marvelous things during that time, including both “the Internet” and “the PC.” And, I’ve worked with all of the major hardware platforms, from mainframe to (some) handheld; and pretty much all the major programming languages, including these two, COBOL, Prolog, SPL/3000, Ruby, Prolog, Haskell, “R,” and … well, you get the idea.

    And, I hope, you also get my point: if you’re going to be a tradesman, your tool-box had better be full. For every new system that you get to write, you’ll encounter ten more “legacy systems” that need to be worked-on. You can’t predict which language(s) were used to do the work. You also can’t fully anticipate which ones will be used in the future. Who knows what operating system(s) will be used by your next employer or client? You need to be self-prepared to do the work, no matter what it turns out to be.

    And, I would argue, not only can you “do this yourself,” but it’s actually fun. All of these are tools to make a digital computer do things. All of them do it in slightly different (or, very different) ways. Learning about them, teaches you. Don’t forsake such opportunities. That’s so much of what makes computer software so interesting to me – always did, still does.

    • BY Scott DuBois says:

      @Mike Robinson,

      Very well said! We never know what each situation will bring so the best we can do is prepare ourselves with the fundamentals required to understand the problem we are facing then attack it appropriately.

      I had to pick up on PHP myself and I got some experience with .NET in school. Both have their merits depending on the application. I didn’t really get into the .NET via the MS VisualStudio as it seemed to lack in the essence of programming and was more like a drag-and-drop scenario, I guess I just prefer to be in Vim or Eclipse so I feel like I’m actually programming. For those who enjoy instant gratification without having to go through the details of syntax, .NET is a good platform.

      Between the two I would lean towards PHP but I’m actually more fond of Perl myself. The syntax is easy to figure out and the foundation already understands what it needs to do without a lot of specification such as determining an int from a double.

  3. BY BobVilla says:

    Performance is definitely a big factor in the choice between PHP and .NET. PHP is much faster. PHP contains the whole spectrum of job opportunities but if you want to learn .NET you’ll be finding a lot of business focused opportunities for work. Also no mention of Python or Rails for web development?

    • BY kk says:

      Where did u get “PHP is much faster than .NET” from ? I have to call BS on that.
      If anything, .net is much faster than PHP, since .net code is compiled vs PHP, which is interpreted.
      Ofcourse, bad coding can make any platform look slow.

  4. BY Joe Dempsey, Sr. says:

    My answer to the A vs. B type questions is always: Learn Both!
    Don’t worry, it can be done and it won’t break your brain, in fact,
    just the opposite. Don’t be lazy, learn it all!

    • BY Unca Alby says:

      Unfortunately, when you learn both, you become mediocre at both. If you want to be an Expert at something, you can only be an Expert at One Thing.

      Also unfortunately, generally when an employer is looking for an Expert in one, they don’t care if you also happen to be mediocre at the other.

      And even more unfortunately, the range of choices isn’t just PHP vs. .NET. There is Java, JSP, Ruby, Python, and more. There’s C, C++, JavaScript, at least a dozen different frameworks that go with one or more choice (e.g., find a Java job that doesn’t include Spring these days; it can’t be done).

      Do you suppose there are enough hours in the day to become EXPERT in ALL of these?

      Yes, you can LEARN all of them. But you can NOT learn all of them well enough to become EXPERT or survive an employment interview in any one of them.

      • BY Joe Dempsey, Sr. says:

        Unca Alby, That’s quitter talk. And speak for yourself. The arrogance of what you are saying is mind boggling! It may not be possible to be an expert in more than one thing for YOU, but I assure you, it is possible to work at and beyond the expert level in many computer languages and frameworks. Not counting myself, I know about a dozen people who are proficient at both Java and .NET plus PHP, Python, and Ruby and others that you have probably never heard of. The problem with lightweights is they think that their knowledge is gold and that software development is akin to rocket science or brain surgery. I assure you that it is not. People like that have an over-inflated opinion of their own abilities because they had to work so hard to attain their skills and they think it must be hard for everyone else.

Post a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>