Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Edit:

How do you manage individual tasks when working on multiple languages

In day to day task handling, how many different programming languages do you work with?

  • Do you make a mental shift when working on each language?
  • Do you Prioritize them and keep each task per language separately.
  • Do you code in stages based on progress of each task switching seamlessly between languages/IDE/Environment
  • Do you apply the same coding style/conventions on all the languages (not syntax)?

Related:

Is it normal for programmer to work on multiple projects simultaneously

share|improve this question

closed as not constructive by gnat, Dynamic, Ryathal, Jim G., Mark Trapp Sep 26 '12 at 1:54

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Making the mental shift is pretty easy. The main mental lapse I usually have is when I try to compare Strings with .equals in javascript. At least I always err that way rather than using == in java. –  WuHoUnited Apr 6 '11 at 12:02

16 Answers 16

up vote 23 down vote accepted

Today I've written Java, Python, C++, and SQL (if it counts). And I've been at work for less than 2 hours.

If you do this regularly, then the mental shift becomes negligible. It has nothing to do with multitasking. It's just like walking for a while, then driving a car, then driving a bike, then swimming. No problem, because they're sequential things.

Regardless, the point is to complete one task before moving to the next. I tend to define tasks in terms of a concrete functionality, fix, or such. Often that task is accomplished with only one language, but it may require several of them. For example, when working with JNI, you'll typically make changes to both the Java and native sides in parallel.

Some answers:

Do you code in stages based on progress on each task switching seamlessly between languages/IDE/Environment

It's important to be able to switch seamlessly between IDEs, editors, environments. Usually I keep them all open all the time.

Do you apply the same coding style /conventions on all the languages(Not syntax)?

If it's an interface over which two languages are talking, then yes - variable names and such must be similar. Otherwise, I try to apply the typical coding style of that language.

share|improve this answer
8  
sounds like amazing race –  Joset Apr 6 '11 at 9:06

I work with 2 languages: c# and python.

I use them both in the same project, but obviously for different tasks.

When I'm working on a task, I work on that task until it is in a complete state, or until I can't concentrate on it any more. This means, if I have to switch between languages, there is little to no cognitive dissonance as I'll have already come out of thinking in either language when I'm done with the last task.

Admittedly I will take a short break when I come out of a task, which probably helps a lot.

share|improve this answer

As few as possible. It generally involves 1. Python, plus 2. HTML templating, 3. HTML+CSS and sometimes 4. Javascript. Switching from Python to JS definitely requires a mental shift, also because I need to use different tools.

I add HTML+CSS as separate from HTML templating even though the might not be languages per se (or they might, depends on your religion), because it also requires a mental shift and usage of other tools, although not so bad as switching to Javascript. Fiddling with HTML+CSS from a design perspective, to make the page look like the requires mockup, is a different mindset from making HTML templates. But it's more orthogonal to Python than Javascript, which means I need to switch out my programming mindset for another one. :)

share|improve this answer

In my last job: Java, C++, C#, JavaScript and VBScript.

But thankfully, all of the above were in very different contexts (and across a few products) - so once you knew each codebase well enough, the mental switch to different contexts was actually quite easy and logical.

In truth, what bothered me more was interruption by client support issues. Internally switching to a task in another language was never a problem in itself.

share|improve this answer

I am often using six or more languages within one project. Most of them are usually specific to that project only.

Mental shift is only required if you're using a language that is not appropriate for a task. Otherwise it is natural to use the best fit. Different sets of languages are used for different stages of a project.

share|improve this answer

I use C (embedded), C++ (desktop), Python, Matlab and VHDL (a sort of hardware programming language) on a frequent basis, often all in the same day. In my environment, this sort of language dexterity is essential in my view.

I often can't get everything I need to on a particular project done in one language efficiently. For example, both embedded C and VHDL are pretty low-level, so I often use Python to parse their results (or even generate code).

Switching between them rapidly is not an issue after a while, it's like switching from a hammer to a screwdriver - right tool for the job.

share|improve this answer

3 languages currently: Javascript, Ruby and SQL

share|improve this answer
1  
-1 This is not really helpful to any one in anyway. –  Aditya P Apr 6 '11 at 10:52

Daily I use:

  1. HTML/CSS
  2. Javascript / JQuery
  3. VBScript / JScript
  4. PHP
  5. SQL
  6. C# / Asp.Net

I also use Python, Java and XML (does that count?) occasionally. My job involves editing various websites, which could be built in any web language (even had a Perl one once) and use wildly different paradigms/templates (procedural, MVC, OOP etc).

To answer the question - I mostly use Notepad++ as my IDE for the first 5 listed, then Visual Studio for Asp.Net.

It can be a pain switching quickly between each language - remembering whether or not you need semicolons at the end of lines, or whether if loops have braces or not. Switching from VBScript to JScript is the absolute worst for this - the files both end in .asp and look fairly similar at first glance, so it takes a while to work out why I'm getting errors.

share|improve this answer

There's a pattern forming here:

  • Front end: whatever runs on a browser (javascript, html and css)
  • Business Logic: any of the whole plethora of general-purpose languages
  • Backend: SQL
  • Build Script: Some scripting language

So for me its: javascript, HTML, and CSS, C#, Transact-SQL, and Windows Powershell.


Do you apply same coding style /conventions on all the languages(Not syntax)?

No, I make a point of programming according to the convention of the language. A simple example:

   // C#
   int MyFunction() 
   {
       return 0;
   }

   // Javascript
   function myFunction() {
      return 0;
   }

Employing visually different coding conventions helps me make the mental shift between languages. Conversely, if my code looked the same in each language, I'm going to make syntactical errors from forgetting which language I'm coding in.

share|improve this answer
1  
+1 Good answer.Its great you are able to maintain the language specific coding conventions and style. –  Aditya P Apr 6 '11 at 10:38

It really depends on how working is defined... I use C# for developing Microsoft Surface applications every day. Java I also use every day for my Android applications. But I try to educate myself and started using R, Ruby and Objective-C. Sometimes I also need some SQL and if you include script languages and other languages into your question then also JavaScipt, SPARQL and BeanShell.

Do you apply the same coding style /conventions on all the languages(Not syntax)?

I try to follow the coding conventions of each language but especially between Java and C# I have some difficulties because of the curly braces and the upper case method naming in C#:

public void test() {
   ...
}

vs.

public void Test()
{
   ...
}
share|improve this answer

I build web apps. So currently its:

  • XHTML
  • JavaScript
  • C# as part of the
  • ASP.Net Framework (this sort of is a language too)
  • T-SQL for database communication
  • English for communicating with humans.

Editors: Sublime Text (out of choice), Visual Studio 2010 (no other feasible choice when it comes to ASP.Net)

share|improve this answer

At my job I use Java, C, Python, Django, and small bits of PHP. I also worked on a really small project in Microsoft's C++.

I don't use all of them everyday, but some days I do use them all with no problem. On a typical day I only use one or two. The programming I do at home usually involves working with different technologies than I use at work like Qt or Ruby on Rails.

share|improve this answer

I write applications for ISP side of things, there is also a culture of "do what you are comfortable with", often written by a lot of network engineers who dabble in programming. I have to deal with on a weekly basis, programs that are quite well written, to the truly horrific. What I will often encounter, and work on...

  • Perl, Often quickie one-off scripts, or often used by people who only know (or like) Perl. More of the legacy stuff is written in Perl I find. Some of the worst stuff is written in Perl, not because the language is bad, but because it's easily misused by beginning programmers. I still use this myself for certain types of one-off programs. I rarely use it for anything larger.
  • PHP, Lots of this around, often a starter language for the dabblers. Some very well written programs, some schlock. For certain types of web applications, I'll chose PHP because I can get it to ground quicker.
  • Shell Scripting, Mostly use it for running other programs or tasks like reading logs.
  • Expect, still encounter this (and zealots who insist it is nirvana for executing commands on network devices). I work on it when I have to, but a baby kitten is killed somewhere in the world when I encounter one of those many thousands of lines long programs without a single function in sight, just one long iterative pasta farm.
  • C, Rarely used because of portability issues, but I will use it to perform specific tasks.
  • Java, I use this often because of extensive library support, and easy deployment. We have a very heterogeneous network, and a IT staff that has an agenda different than mine. With Java I can include libraries and not be concerned that IT has to "upgrade" something on the system I need to deploy the program. Most often this is my programming language of choice.

There are also other languages (.net, VB, Phyton, Rails, etc) out there in the company, but I haven't had to work on them...yet.

Edit, for the edit...

You do have to mentally shift when you work between languages. Most often what I'll lose track of is the syntax. I keep a collection of reference books at the ready. I'll find it takes about a half-hour to get back into the mindset of the other other language. The more obtuse the syntax for the language, the longer the shift. I find that shifting from doing Java to doing Perl probably takes the longest if I haven't touched Perl for a time. The more you do this, the easier it gets.

share|improve this answer

At the moment I'm writing Ruby, PHP, Java, C and JavaScript and will write for a minimum of 1 hour in each of these each day. The main problem is really a matter of finding the time as they are all for unrelated projects.

Mental Shift

My work style is such that I like to work for large periods of time. Unfortunately, this means if I only have a single thing on, when I encounter a mental block with a piece of code, it will take a me a long time to get over it. I don't find taking a break helps either. By having other projects, and in particular other languages, to switch to whenever I get stuck means by the time I get back to the original language, I immediately have a solution.

Therefore, yes there is a mental shift and I think it makes me much more productive.

Prioritizing Tasks

I use a task manager (gTasks for Android) and have a separate todo list for each project. If a project requires multiple languages then I don't separate them. This is usually because they will be strongly related in some way. For example, JavaScript and Ruby for doing some AJAX stuff. If the languages are technically for the same project but the project is so large that they are essentially unrelated then I will likely count them as separate projects.

Generally, my priority is "whichever list has the most tasks" but I will always switch if I get stuck on a problem.

Coding Conventions

Its a bit of a mix:

  • If the project is developed with others then obviously I will conform to whatever conventions have been decided on for that project.
  • If the project is personal then I like my code to look consistent with the dominant style in the community/standard library for a given language. I find it hard to read Java code if all of the users functions are in snake_case, for example. Equally, camelCase methods in Ruby look weird and out of place.
  • For conventions which aren't made obvious from simply using a language, such as indentation, I will tend to adopt my own standards and use them in all languages I use. In the case of indentation, I always use 2 spaces. For brace style, I always use what Wikipedia is currently deciding to call the Compact Control Readability Style.

Aside: The biggest challenge for me is actually switching between style languages. It is very difficult to be racing along when coding SASS alongside Ruby and then having to switch back to CSS for everything else. To a lesser extent, I have the same problem with HAML/HTML and JSON/XML.

share|improve this answer

As indicated by SK-logic the mental shift should not be a problem if you use well-choosen domain specific languages. But often you cannot choose the language, so it sometimes takes a moment to switch. In my experience the difficulty is more in switching syntax than in switching programming style. The only annoying shift that I always experience is the comment style shift: If I just open a file to quickly change a line of code, it often goes:

#  what
// the
;  f***
%  is
-- the one-line comment character or sequence?
share|improve this answer

Daily basis:

  • C#
  • Progress (OpenEdge)
  • Java
share|improve this answer
2  
How exactly does that help others? Have you read the topic besides the title before posting? for instance ... How do you manage individual tasks when working on multiple languages –  Aditya P Apr 14 '11 at 6:31
1  
@AdityaGameProgrammer Why dont you update the title then? Otherwise its misleading if it doesnt match your actual question –  rmx Apr 14 '11 at 15:07
1  
This is really a comment, not an answer to the question. You can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. –  Matthieu Aug 21 '12 at 12:36

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