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!

Upload Your ResumeEmployers want candidates like you. Upload your resume. Show them you’re awesome.

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.

      • BY Bob Biswas says:

        True that

      • BY Jack Davis says:

        PHP is also compiled using either HipHop (Linux) or Phalanger (Windows).

        • BY Bruce says:

          HipHop does not compile PHP, it converts it to C++ and then compiles that. According to Facebook’s development blog, the reason they created HipHop was because they needed better performance and it wasn’t cost effective to rewrite Facebook in C++. They also have an investment in PHP developers they wanted to keep.

    • BY Mark M. says:

      This comment is a perfect example of both this quality of this article and the majority of comments. Completely ignorant of the facts.

      .Net is vastly faster than PHP, and exceedingly more robust. It’s type system is the richest available, (far superior to Java, which was left in the dust years ago) whereas PHP added object orientation as an afterthought. (Compare with Ruby, which was designed to be OOP in reaction to the procedural artifacts of Python.)

      .Net is a general purpose framework that supports multiple languages that support different programming paradigms. If we only consider C#, we not only get support for the world’s most advanced strict typing, but for dynamic typing and functional programming as well.

      Anybody that would think a web scripting language like PHP, even with compilers, even with standalone interpreters, is as capable for the range of projects that .Net is appropriate for has no business getting anywhere near a non-web project.

      And no, not that it matters, but .Net’s newer web frameworks do not require a web server to run. Selfhosting has been in both Web Api (web services) and Asp.Net MVC long before this article was written. But this ignores that in all probability (I don’t have direct evidence, but anecdotally speaking) most .Net apps are not written for the web.

      The OSS version of the .Net framework, Mono, is a second option almost on par with the original.

      As for tooling, the primary problem with dynamic languages like PHP, Python, Ruby and Javascript is that their IDE’s are inherently limited in functionality due to limited (or non-existent) type reflection. MS not only offers multiple flavors of Visual Studio, which is outstanding IDE, but you also have MonoDevelop, which is strong in it’s own right. Xamarin, the sponsor of Mono, offers a third closed source version of MonoDevelop which is very highly regarded for cross platform mobile development, because it permits an almost unified code base for Android, iOS, Windows phone, Windows, and Mac apps written in C#, F#, and even the craptastic VB.Net.

      Lastly, large portions of .Net, including Asp.Net MVC, were open sourced years ago. As of last week, all of .Net is now open-sourced.

      If PHP has all the complexity of a reasonably fun, second hand camaro, then .Net is an F1. Any kid can drive a camaro, but it takes a pro to maintain and drive an F1, which can do things no camaro ever could hope to accomplish, at the cost of a significantly higher learning curve.

      That said, where should you start? Take the camaro, but don’t stop there if you have the aptitude to move up. Don’t worry, it will take years to master the level of complexity that is expected of competent .Net developers.

  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.

      • BY Steven says:

        If you want to be a good web developer, you are going to need to master at least three languages: JavaScript, a server-side language (or Node.js if you want), and some sort of database query language like SQL. That’s in addition to understanding HTML 5 and CSS 3, and the countless libraries and frameworks you’ll need to apply with those languages. As someone who has passed interviews for senior level PHP, C#, and JS jobs and I can tell you that there’s a point in your career when all of these different technologies are variations on a theme. You can become an expert at many languages at the same time by growing your understanding to fully comprehend the underlying programming concepts that all of these languages share. At some point it’s all the same stuff with variations on syntax and convention.

      • BY Unca Alby says:

        @Joe, @Steven, lets take a quick thought experiment and carry your arguments to their logical extreme.

        So, why not learn both PHP and .NET? While you’re at it, why not also learn Auto Mechanics, Construction, Neurosurgery, and Patent Law? And I’m sure you can become a Master Chef and a really good Gardener.

        Yes, it is true that you can learn a lot of things, and many fields involve many components that also need to be learned. BUT YOU CAN NOT MASTER EVERYTHING.

        There’s an old saying, “Jack of All Trades, but Master of None.” Employers generally are not looking for a PHP developer who also knows .NET and can also keep the company fleet tuned up. They’re looking for one or the other, and they want someone who has MASTERED that particular field.

        .NET and PHP are far enough apart as to merit completely separate fields of study. They are, respectively, the world of Microsoft products and Everything Else. They are separate and getting further apart with each new development.

        If you visit a dentist and see a recent Law Degree on his wall, RUN. Maybe you can use him to sue somebody, but he likely can’t fix your toothache with the same skill as someone who concentrated his efforts exclusively on Dentistry.

        Now, don’t get me wrong, there is nothing wrong with learning as much as you can. These days, you have to constantly learn new things, new techniques, new tools. All I’m saying is, when it comes time to become an EXPERT in something, you’re going to have to CHOOSE between one and the other.

        Are you going Microsoft? Or Everything Else? Pick one and master it, and the other falls into “familiar with”.

        • BY Joe Dempsey, Sr. says:

          NO! As a consultant with a variety of clients I am REQUIRED to be an EXPERT in ALL of the following: FORTRAN, C, C++, BBx Basic, Visual Basic, PHP/MySQL/Linux/Apache/HTML/CSS/JavaScript, Java EE, AND, .NET, C# and many others as well. I’ve been a Software Engineer for over 41 and after that much time, you realize that there is a common thread that runs through all the various software development languages and platforms. Once one understands the theory in depth, all the rest is just details. So after 41 years, even a schmuck like me can get good at it. Furthermore, I know several guys who can run rings around me. I’ve worked with these geniuses on various projects, ALL DIFFERENT! I hold a Master’s Degree in Electrical Engineering and have taught Digital Circuits at Drexel University and Computer Science and Computer Programming at the local Community College, many different courses such as C++, Java, and Data Structures. Still, I know some guys that can run rings around me. Still, I’m a Jack of Many Trades and a Master at most of them. And I’m not the only one!

          Bottom line: SPEAK FOR YOURSELF!

      • BY Shayne O says:

        “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.”

        I would not hire anyone who was lazy enough to only know one language.

        Look theres two types of programmer, engineers and technicians. A techician is someone who knows one language well enough and no concept of underlying computer science. Theres of a lot of them out there, and they never go beyond hacking out web pages or customizing wordpress instances.

        Then there are engineers. These are people who will pick up a new language in about a month, know 6 or 7 well and 2 or 3 with mastery. (I would say I know 3 languages at a mastery level and about 5 more enough to get by). These people can adapt to the job, know when the easy idea is not the best idea , understand database normalization, object oriented concepts AND functional pardgyms, understand pointer arithmetic, understand test driven development concepts, and general software lifecycle business process. and if necessary drop down to assembler to optimize a recalcitrant performance bottleneck and finally script up the necceary orchestration to ensure change management is not compromised by the constant wavefront of changes that comes out of Agile project management.

        Or you can just be a technician and scrape by on modifying wordpress installs.

        Yes the engineer approach requires either a degree and some experience , or simply a decade or so of experience without the degree, but if you just limit yourself to one language you’ll *never* be anything more than a technician, at the bottom of the IT pecking order.

        • BY UncaAlby says:

          This is likely why nobody is able to get a job anymore. There are too many employers with an attitude like yours where you expect your employees to be an expert in every technology under the sun, including the ones that some college freshman invented two years ago and suddenly is all the rage.

          I mean, have you *seen* some of these job postings? The list of “must haves” goes on for pages.

          Look, I’m good at what I do. Damned good. And I already know (and I’m good at) more programming languages, database systems, OS’s and development techniques than probably 80-90% of the recent graduates who have learned Python and Ruby forwards and backwards (and who will get jobs that I won’t). I won’t waste your time giving you a list, which wouldn’t prove anything anyway because you likely wouldn’t take my word for it. BUT NEVERTHELESS that doesn’t mean there isn’t a WORLD of languages and techniques I DO NOT KNOW. And I’ll NEVER know them, because the possibilities are too huge, and growing exponentially.

          And the only way to be EXPERT at something is to USE IT on a regular basis. There are only 24 hours in the day, and while you’re working at one technology, some other must either sit and wait or you give up sleep (good luck with that idea!)

          All I’m saying is, PICK SOMETHING and be EXPERT at that. Depending on the technology (e.g., web design) you may also need to be expert is several inter-dependent technologies. You can “learn” anything and everything, and fix your broken-down Volvo in your spare time. But you can NOT be EXPERT in EVERYTHING.

        • BY Joe Dempsey, Sr. says:

          @Shayne O., From one engineer to another: Thank You, sir! Just Thank you.

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>