28

I have been writing quite a lot of PHP for nearly two years. Now I am doing .NET (mainly c#) development. However, sometimes I go back and do some php.

My main question is, is it wise for me to continue doing this or should I continue development in C#? Would this harm me in the long run (mind you my main goal is not to be a jack o all trades) or is it a good practice to be doing?

yoozer8
  • 693
  • 1
  • 8
  • 20
Lamin Sanneh
  • 3,975
  • 3
  • 19
  • 19
  • 30
    better to be a jack of all trades than a one trick pony – scrwtp Aug 08 '12 at 10:32
  • 1
    @scrwtp. Is that the case even if the one trick pony is much more proficient in his one trick than the jack of all trades is in each of his trades? Just a friendly question. – Lamin Sanneh Aug 08 '12 at 10:47
  • 27
    It will certainly harm you if you limit yourself to just two languages. Get more different tools into your toolbox. – SK-logic Aug 08 '12 at 11:01
  • 4
    You ask this question as if your were you totally free to choose between C# and PHP - is that really the case? – Doc Brown Aug 08 '12 at 12:29
  • @Doc brown...I am sorry but I do not understand your question? – Lamin Sanneh Aug 08 '12 at 13:24
  • @LaminSanneh What Doc Brown is getting at is he presentation of your question makes it seem that you have the choice to *exclusively* choose one or the other where most people are required to trudge through multiple languages to accomplish a certain task. – Chad Harrison Aug 08 '12 at 13:58
  • @LaminSanneh: most of the projects I work on have already a certain code base in a given language, and even when I start a new project, I am seldom completely free in choosing the language. So, where should be any "wisdom" in doing only C# programming in the future and refusing to do anything else? The company I work for would not be very happy with that, I guess. Is your situation so very different that a question like "shall I do only development in language XYZ in the future" makes any sense for you? – Doc Brown Aug 08 '12 at 14:10
  • 10
    Knowing all the dirty details of one language is no doubt very useful. But when you work with multiple languages, you will at some point down the road find yourself designing parts of the program in a certain way, regardless of what language you are currently working in. This is a kind of programmer nirvana, where the language becomes secondary and the application is what matters. That is a great place to be, because it means you have potential as a programmer even in the future, when people are working in some new fancy Z++ language. –  Aug 08 '12 at 14:11
  • 2
    Just two? Many programmers regularly work in a number of languages. Knowing several gives you a larger set of tools to draw from. – Caleb Aug 08 '12 at 14:20
  • 1
    @scrwtp: [Tony the Pony](https://msmvps.com/blogs/jon_skeet/archive/2009/11/02/omg-ponies-aka-humanity-epic-fail.aspx) would argue otherwise. – Justin ᚅᚔᚈᚄᚒᚔ Aug 08 '12 at 15:31
  • 2
    Why would someone ask if knowing/using more than one thing is a detrimental practice (specially if *said* thing requires substantial intellectual effort)? – luis.espinal Aug 08 '12 at 17:52
  • Learning two languages is nothing. In any given day, I will program in Ruby/Ruby on Rails, C++, C#, and Lisp. Knowing multiple languages is great, and most programmers know four or five. – Orcris Aug 08 '12 at 18:17

15 Answers15

75

Using two languages at the same time is nothing. It’s not uncommon for programmers to use several different languages every day. Different tasks and different technologies require different languages.

Just today, I’ve already used four or five different languages, and that’s interesting because I haven’d done any programming so far. All I’ve done is work on a presentation.

As a good programmer it’s essentially required that you know your way around in several languages, and the only way of attaining (and then preserving) reasonable fluency is by using those languages.

Konrad Rudolph
  • 13,059
  • 4
  • 55
  • 75
  • 4
    I'm not sure how anyone could be an effective programmer at all without using at least 3 languages on a regular basis. – Brian Knoblauch Aug 08 '12 at 15:12
  • 1
    @Brian - those three languages being your primary spoken/written language, your primary programming language, and SQL and/or HTML? – KeithS Aug 08 '12 at 15:26
  • 2
    @KeithS Only if you're making super plain pages on the client side, and never touch XML records on the server side. CSS and Javascript count as their own languages, as do XPath and XSLT and XQuery. – Tacroy Aug 08 '12 at 15:59
  • True all. However I'm a WinForms programmer ATM, not web, so my two main non-spoken languages are C# and SQL, with a touch of XML here and there. I'd still call myself an effective programmer even though 90% of my day is spent in one language, as would my applications' users. – KeithS Aug 08 '12 at 16:39
  • Agreed...today alone has been Java, Coldfusion, Javascript, SQL, html, ruby, and haml. Programmers are linguists of a different tongue and we have to be. – Rig Aug 08 '12 at 17:15
  • Most people only consider something a "Programming language" if it can be used for programming things (ie. is Turing Complete). HTML, XML, Regex, CSS, XPath/XSLT/XQuery are not considered programming languages; neither is the tiny subset of SQL used by most developers. – BlueRaja - Danny Pflughoeft Aug 08 '12 at 17:26
  • 2
    Anything that contains "Most people" or "most developers" should be followed with a citation of sorts. Otherwise, it is subjective. Almost every developer I've met (and myself included) considers SQL a programming language, and Turing completness is not a necessary factor for a programming language (think DSLs, which are typically designed to **NOT** be turing complete.) HTML and XML are obviously not programming languages (though you can have XML-based domain-specific languages). Regexs are not programming languages, but programmable/configurable automatons are. – luis.espinal Aug 08 '12 at 17:50
  • @luis.espinal: It's pretty common knowledge. [Here's a source](http://programmers.stackexchange.com/questions/28098/). – BlueRaja - Danny Pflughoeft Aug 08 '12 at 17:58
  • 2
    That is not a source. That's a link to a discussion (discussions are not, by themselves, sources), and it is one that is only focused on CSS and HTML. It doesn't address the "turing complete" test (I suggest you read Martin Fowler's work on the subject of DSLs), nor whether SQL is a programming language (which it is, here is an actual source: http://en.wikipedia.org/wiki/SQL, or this http://www.amazon.com/SQL-Programming-Language-Kirk-Scott/dp/0763766747/). Either you are not reading my post fully, or you think a link to stackexchange is a source (which is not.) – luis.espinal Aug 08 '12 at 18:08
  • 1
    @luis.espinal: Did you read the top answer? *(which is definitely "a source" for any claim of "most programmers think"...)* – BlueRaja - Danny Pflughoeft Aug 08 '12 at 19:09
  • @BlueRaja-DannyPflughoeft That's why I specifically said *languages*, not **programming languages** :) The important factor is being able to easily switch syntactical contexts, not whether or not a particular context describes a Turing complete language. – Tacroy Aug 08 '12 at 19:28
  • @Tacroy: But the question is specifically about programming languages. OP most likely already knows HTML/CSS/Javascript/SQL if he does web-development in PHP; but he's not asking about that. He's asking if learning another **programming language** would be a good idea. – BlueRaja - Danny Pflughoeft Aug 08 '12 at 20:25
37

is it a good practice to be doing?

It is an excellent practice. Moreover, I would recommend expanding your list of languages regularly by trying out a new one.

Languages and technologies go in and out of favor very quickly, in a matter of a few years. For example, Objective C took off with an amazing strength after being nearly dead for two and a half decades - an eternity by the standards of this industry!

It does not matter much that you are planning to "not be a jack o all trades": if you are planning to remain in the industry long enough, it is very safe to assume that you would have to switch your technology stack at least once throughout your career. Using multiple languages now keeps you prepared to switch on a reasonably short notice.

Sergey Kalinichenko
  • 17,393
  • 4
  • 57
  • 73
14

Would this harm me in the long run (mind you my main goal is not to be a jack o all trades) or is it a good practice to be doing?

Knowing two or more languages would never harm you. Knowing your languages very shallow (without understanding inner-workings) may harm you.

My personally preference was always mastering one object-oriented programming language first. This would provide you in depth learning of all programming concepts, and ease to learn next one once there is a need.

is it a good practice to be doing?

Absolutely yes!

I would suggest definitely to learn more than one and practice them by building some applications. Meanwhile, you may also plan to learn some scripting languages (jQuery, KnockoutJs, etc.) and libraries if you are doing or planning to do web-development.

Yusubov
  • 21,328
  • 6
  • 45
  • 71
  • 1
    I don't think think, learning OOP will teach you many concepts from functional programming, for one, JavaScripts scoping rules are very different from the other popular OOP languages such as C#, etc there are many other concepts out there. – phant0m Aug 08 '12 at 16:56
  • I strongly agree. However, jQuery and KnockoutJs are NO scripting languages. And I wouldn't recommend "learning jQuery" without fundamental JavaScript knowledge. – Bruno Schäpper Aug 09 '12 at 05:40
  • you can't learn jQuery without learning JavaScript in the process because jQuery is not a language, it's a library written in a language. – ILikeTacos Sep 18 '13 at 20:02
5

It shouldn't harm you in the long run, being proficient in a number of languages makes you a well-rounded developer. Using "the right tool to do the right job" is the ultimate goal and being versed in different languages helps you achieve that as you know what else is out there and can make a well informed decision about what platform/framework/language to use to get something done.

Deco
  • 2,466
  • 18
  • 28
  • Thanks for the answer but I was wondering whether the frequent shifting wont harm my learning process or prolong it or does that just depend on the person's ability? – Lamin Sanneh Aug 08 '12 at 10:36
  • @LaminSanneh Learning another language doesn't make you worse at the first one. It's not an RPG and you don't have a set number of "programming skill" points that you can assign to each language. At worst, it takes away time that you would have devoted to another language. But languages are just a way of expressing your ideas, and learning new languages gives you new, fresh perspectives and ideas that you can apply to the ones you already know. Sure, you won't know the syntax of every language off-hand, but who cares about that? It's a quick Google search away – Jay Aug 08 '12 at 18:30
5

Over the course of your career, you will have to learn new languages and new technologies; the industry simply requires it. On my first professional assignment, I had to deliver code written in Ada, C, and Fortran, along with some SQL and shell scripts. I've had to switch from C++ to Java and back again in the last couple of years. I've written shell scripts in csh, bash, and perl.

Taking time to learn different languages, especially if they're in different domains (OO, functional, logical, etc.) will help you in several ways. It will keep your brain sharp. It will help you separate concepts from implementation (e.g., hashes and maps aren't just data types in a particular language). It will give you a better idea of what tools are appropriate for a given problem (for example, I wouldn't build a Web site in C, nor would I write a device driver in Haskell). It may make it easier for you to find a job ("Hey, he already knows Intercal1, we don't have to train him!"). It will give you an idea of what challenges face language designers. It may inspire you to create your own programming language.

At the very least, it will keep you from being bored.


1. Joke. Don't try to learn Intercal.

John Bode
  • 10,826
  • 1
  • 31
  • 43
4

People retiring this year started their careers before C was created. It's safe to say you might switch programming languages once or twice in your career. You don't want to work for employers who don't understand that.

When you're new, context switching between two languages is a lot more difficult, so you'll be more productive if you work at least 4-8 hours in one language before switching. Later you'll be able to switch instantly without a loss in productivity. In other words, using two languages will eventually become a strength instead of slowing you down.

Karl Bielefeldt
  • 146,727
  • 38
  • 279
  • 479
2

There is an upside and a downside to this.

Here's the upside...

As others mentioned, being able to learn new and work with many languages and programming tools is almost essential to having a long career in programming. Things change over the years, tools/languages come and go. Sure, there are some people who're content to be programming in the same mainframe COBOL they used in the 1980's but this is a relatively rare situation. Most programmers end up changing tools/languages several times over the course of their career. Sometimes you may get hired because you do know some older technology or know all of languages a company is working with.

The downside is...

Some employers will see you as a "jack of all trades, master of none" and reject your application without giving you a chance. They're looking for a narrow expert in a specific area, not simply a good, well rounded, programmer. Sometimes you may get cut off by HR because you don't have "5 years of continuous experience in [X]". You may be able to avoid this by tailoring your resume to fit the job but this may not help you in a technical interview.

To me, the upside is much better but you do need to be aware that a minority of organizations view it as a negative.

jfrankcarr
  • 5,082
  • 2
  • 19
  • 25
  • +1, Moreover, I'm positive there's a correlation between this minority of organizations and bad programming and ineffectiveness. – K.Steff Aug 08 '12 at 13:37
  • 2
    That negative is cancelled out though by employers who think the exact opposite. I have a say in hiring decisions where I work, and I'd be very hard to convince to okay hiring someone who had only one programming language under their belt. **Maybe** for a junior position, but certainly not for a senior developer. – Jon Hanna Aug 08 '12 at 13:50
  • @JonHanna - The main problem is that the development team may never even get to interview the prospective developer since they get screened out by HR, sometimes by an automated program. This is, of course, a more common issue in larger organizations. It's important to make sure your HR people aren't screening out the best candidates based on arbitrary criteria. – jfrankcarr Aug 08 '12 at 14:18
  • +1 for pointing out the _cons_. Where I'm from, the number of companies retaining that "jack of all trades, master of none" view is not that small. – lsoliveira Aug 08 '12 at 14:35
  • Yeah, but we could turn that around to any good quality; there could always be an idiot in HR who thinks its a bad quality. Ultimately though, if HR in an organisation are idiots, they're going to be making bad hires, and while being hired there might be better than the unemployment line, you're going to look for a new job immediately and find work somewhere else. – Jon Hanna Aug 08 '12 at 16:03
  • @JonHanna - Sadly, I see a lot of job listings like the "5+ years of NET 4.0 or higher" one I got in my email today. HR, or the headhunter company, is going to screen out a lot of qualified people that way. It's important to make sure gatekeepers don't do this. – jfrankcarr Aug 08 '12 at 17:42
  • You're looking at it the wrong way around. When I see someone looking for 5+ years of experience in a framework version that's been around for 2 years, it's *I* who filter *them* out. If its through a recruitment company though, it could be that the company is okay, recruitment companies just can't stop themselves from saying stupid things. – Jon Hanna Aug 08 '12 at 20:35
  • I've been in a position to help evaluate people and yeah, no exposure to other languages was a negative for anybody who'd been at it for a few years. @Jon Hanna, the hard-sales-variety of recruiters know nothing but I don't think they set the years experience bullet points typically. They see it the same way they view all other sales-type jobs and would rather have a larger pool of leads to work with. – Erik Reppen Aug 08 '12 at 23:27
  • Also, there is no downside to alienating the downside employer. People who think like that are always looking to filter a pile when they should be matching according to their needs. It's neither smart nor competent. Bullet dodged. – Erik Reppen Aug 08 '12 at 23:33
2

When you were doing PHP development did you write javascript or SQL? In your C# development you could still be using both of those. It isn't quite so cut and dry as using one programming language.

If you are happy doing it, don't worry about it. If you don't want to be doing both (or either) then you have a problem.

Sign
  • 2,643
  • 19
  • 22
2

Learning a new programming language will teach you things about programming that you can apply to the languages you already know. You should definitely consider at least playing with some other languages, even if you don't use them professionally, rather than just having so few.

Ideally, one that's very different in approach to those you already know.

Jon Hanna
  • 2,115
  • 12
  • 15
2

No, there is nothing wrong with learning multiple languages and using them all fairly often. In my day-to-day I can encounter Ruby, PHP, JavaScript, CoffeeScript, Python and occasionally C. I know all of these languages fairly well and going from one to another just flips a switch in my brain. Sure I miss features of some languages when I go to another but you'll get over that.

I try to always have a language I'm learning in-depth and then another one as an "up and coming". This way you always have a clear educational goal and then something on the horizon. Right now Ruby is my main language and I'm experimenting with Go. I'll probably never get a job as a Go developer but learning a new language has made be a better developer.

When I interview a developer I always like to see a few different languages on their resume. If a developer on has "C/C++" or "PHP and Javascript" on their resume they look a lot less interesting than someone who has a firm grasp of 4 or 5 languages. Make sure you feel comfortable in any language you list, anything on your resume is fair game in the interview!

In short: Using multiple languages regularly is a sign of a good developer who cares about their craft. Keep coding!

binarycleric
  • 225
  • 1
  • 4
  • I would say if developer says "C/C++" in a resume, I would want that to be the only language(s) there. But with other, fool-proof languages, the more the better. – Coder Aug 09 '12 at 01:57
2

When looking at resumes we usually look for somebody that knows multiple languages. Also, as a person's experience increases the number of languages they have used should increase too.

In our environment we often have to tackle new and interesting problems and we are looking for people that are willing to jump in and solve those problems, whether they need to learn a new language or not. The problem might be in code running on a Windows desktop, a Windows server, a Linux server or in a browser.

Knowing multiple languages is a sign of somebody with a good attitude toward their craft. They want to always learn new things so they do. A lack of knowing a number of languages is a sign to me that a person only does the bare minimum and is not interested in learning.

Sarel Botha
  • 287
  • 1
  • 5
2

It has always been the case for people to program using more than one language. When people were using Assembly, they have to lean a new Assembly language every time they changed architectures.

When people where doing COBOL or Fortran, they also typically did RPG and/or JCL.

In Unix, people would work with C, sed, awk, shell script and just about everything in the Unix kitchen sink (almost every command line tool in Unix is its own, very specialzided DSL.)

In DOS, people would be programming in Turbo Pascal or C in addition to batch scripts. Later when Windows came, it was VB or something like PowerBuilder coupled with SQL and possibly batch installation scripts.

Nowadays, it is a de-facto that people "work" with more than two languages any given day (and by "work" I mean do actual day-to-day coding or have working knowledge). Java or C# or VB mixed with JavaScript and SQL at the very least. Then other languages come into play for batch/job scripting and the like. Then, for each language, you have a framework that itself implements an internal DSL, a mini-language in its own right.

So, it is not just beneficial to work with more than one language, but it is necessary. There is no way to build a modern, complex system with a single language (and by "build" I don't mean just code some crap that compiles, but to build something with a decent design.)

Heck, I'll go out of a limb and say that I would expect kids in college to be proficient in two or more languages if they are serious about being in this profession.

So, regarding your question:

My main question is, is it wise for me to continue doing this or should I continue development in C#? Would this harm me in the long run (mind you my main goal is not to be a jack o all trades) or is it a good practice to be doing?

So, short answer, no, using or switching between languages won't give you the cooties. Knowing more than one language won't make you a jack of all trades, and there is no way for a developer to become an expert by being unable to use more than one language.

luis.espinal
  • 2,560
  • 1
  • 20
  • 17
1

The more you have to compare to in reference to your primary language(s), the better you'll understand the design tradeoffs that went into making it particularly strong or weak at certain things and take advantage/compensate for those things. Master at least one but don't worry about being a jack of many others. That only looks good.

It's better to ask how resumes with only one language listed from "senior" developers look. The answer to that question is: "Not very interested in what they do for a living."

Erik Reppen
  • 6,243
  • 31
  • 34
0

Two languages may help you or not - that depends. It will not harm you, that's for sure. Many devs tend to think that using something else apart from the 'main language' is pure waste of time but I strongly disagree. Learning another language (and using it) is a pure benefit: it gives you a different perspective on how to solve problems. It may happen that you will start using one of the languages for particular tasks at all times (as it happened to me after I had a chance to learn and use Python).

0

In this situation you're not asking about switching from JAVA to C# and back all the time, instead you're going with C# and PHP which really isn't a big deal.

Suppose you wanted to do some WEB based stuff where you're using a WAMP stack (Windows/Apache/MySQL/PHP) and C#. You use the C# to write some SOAP based services and then use PHP to consume them.

This seems totally acceptable to me.

Anyway, knowing more than one language is good. The more you know the better. PHP/C#/Java/Python/javascript libraries[JQuery for instance]. Be useful to as many people as you can.

ist_lion
  • 3,422
  • 1
  • 22
  • 23