
Ask HN: Do you program in multiple languages in a day? - ratpik
Which ones? Opinions about productivity?
======
lxfontes
Go, Ruby, Bash, javascript, coffeescript

\- I try not to work with 2 languages at the same time

\- Try not to carry paradigms over wrt var names, module functions, deployment
options

\- Keep a single editor (vim) for all of them

\- I might need a few minutes to 'warm up', specially when dealing with go-
routines, threads or a magical change in syntax (ex: from Javascript to
Coffeescript)

\- Warm up gets harder if I don't touch certain language for a while. Ex:
Focusing on a single language for 1 - 2 days makes me extremely comfortable
with language X, but harder to switch to language Y

------
leephillips
I would be surprised if anyone said they only used one language. Even in the
olden times my typical day had Fortran, Python, Bash, and [La]TeX, + sometimes
C. And the variations on these, including various libraries that amount to
mini-languages in their own right. (This list doesn't include special purpose
languages for job submission, etc.) Later, I added HTML, javascript, CSS, and
SQL. Now I'm trying to add Clojure and Julia. Of course the cognitive burden
has an effect on productivity, but I think we do this because we find that
using languages well suited to the task gives us a net win.

EDIT: I see at least one example of someone who claims to use only javascript.
I don't even see how this is possible. Not even a shell language? How do you
deploy your javascript?

~~~
vorg
> one example of someone who claims to use only javascript. I don't even see
> how this is possible. How do you deploy your javascript?

Perhaps they hand it off to the next person in the work chain? Most larger IT
shops divide up their development and deployment staff along technology and
language lines - it makes recruitment easier for the managers who only need to
rattle off a list of languages in their job ads, and managers can better
control their staff by withholding access to technologies perceived as
desirable to work on.

Perhaps you ask this question because you work in the new-fangled _full-stack_
area where one person does everything. IMO the "DevOps" doctrine is a huge
step backwards for business integrity. The doctrine for IT shops previously
was to keep separate the people with access to the data and those with access
to the code, hence "Development" and "Operations" were two separate areas.
Creating "DevOps" people who can change both the data and the code in the name
of _full-stack_ processes opens the door up to large-scale fraud by workers of
their employers' data and even cash.

------
moron4hire
Definitely C# and JavaScript every day. The current state of one of my
projects doesn't need a lot of new SQL work right now, but that's been a
temporary lull while I reworked the UI. It's not uncommon to be doing all
three in one day.

I would say I'm "equally productive" in all three, in the sense that I am
comfortable in all of them, produce about the same quality of work for each,
and rarely get blocked on problems because of something I don't know in the
language. The volume of work in each is not the same, as they obviously are
necessary for different things and at different times.

On a pure volume basis, I have a number of side projects that are 100%
JavaScript (i.e. Node backend), so JavaScript is definitely the language I use
the most. But in terms of expressiveness, I find C# to be the friendlier
language over the long term, as my programming style has grown towards
exploiting static checking for refactoring. Increasingly, I find myself
prototyping things in JS, then translating portions to C#.

I would ultimately like to replace C# in my workflow, though. It's difficult,
as I don't like the Java tool ecosystem. I like progressively enhanceable
tools, stuff that one can do a very simple Hello World in without requiring a
package manager or project template initializer, and add components to as you
require more complexity in your projects. That's absolutely tied to how I
learn new languages by running side projects in them. I hate having things in
my project directory that I don't understand and thus can't stand the modern
trend of starting a beginner's tutorial with a language's own, custom package
manager's "init" command.

It depends on the language, but it's usually the same project: either Tetris
or a text adventure that eventually gets upgraded to be a MUD. I find it to be
a great way to learn languages: you get the basics of data structures and
control flow right up front, then you jump right into either graphics or
networking. Tetris was how I first learned C# (coming from Java), and MUDs
were how I first learned Racket and Node.

------
eddieroger
I don't as much as I used to, but for a stretch I was going between Ruby and
Objective-C daily. It was a lot to keep up with, and I ended up with a lot of
ObjC lines missing semicolons and Ruby strings prefixed with "@".

If I had to do it over again (alright, when), I'd try to segment the work
better. I was writing a service in Ruby (Sinatra) and consuming it from ObjC.
I should have planned better upfront so I wouldn't be hopping so frequently.
Like, I don't know, spec out my API instead of just writing it.

------
kristiandupont
As I am typing this I realize how times have changed: I use Javascript, but
only on the server. And then I am currently writing firmware in C++.

I find I typically mistype things 3 or 4 times per day, like var instead of
int for variables, bracket positioning or === which has gone from looking
completely weird to now looking correct, leaving me feeling that my
comparisons in C++ are sloppy. I usually catch it immediately and if there is
a productivity cost, it's so small that I don't notice it myself.

------
hypr_geek
Since a year ago upto a few months before, my day was split in half while
working on two projects. The first half had me working in C, bash and
HTML/CSS, Javascript for an embedded project and the latter half was Java
(Android), HTML/CSS and Javascript for a mobile/web project.

Nowadays, (moved on to another company) the first half is in Scala (Play),
HTML/CSS and Javascript for a web project and the second half in Java
(Android) for a mobile project.

It has been not been that difficult to manage switching between languages
unless the programming paradigm changes (Java <-> Scala), but even that you
get used to. The major goal is, in my opinion, to become so proficient with
the language(s) that you're working with, that it becomes second nature to
transform your thoughts to source code. Very much similar to learning a second
natural language. It's not really necessary to learn the ins and outs of each
language that you work with, but at least the stuff that would be required.

Some problems that I had,

* Realizing it takes time to get used to the context switch.

* Using different editors. I was doing C and bash coding in vi, but working and modifying Linux source in KDevelop, mostly due to changes in coding style like tabs vs spaces. Java(Android) coding was in Eclipse and HTML/CSS/Javascript was in Sublime Text.

* If you go off one lanugage for a couple of days, it takes some time to get back into it. Doing at least a few things daily keeps one in the flow.

* Static compilation helps a lot when we make mistakes after a context switch. Javascript and Bash proved to be a major pain for this (I did try out JsHint for Sublime, but it slowed the system down, so I went back to looking at errors in browser console).

------
pdovy
Most of the core stuff I work on is in C++, but I regularly transition over to
Python for automation tasks, data processing, testing, etc. As much as I like
C++, Python is much better for manipulating data IMO - the cost of the mental
context switch is way outweighed by how well the language lends itself to
certain tasks.

------
aethertap
I go between python, javascript, and c++ most weeks (not on the same project).
I'm doing a little rust on the side just to learn it, same with haskell. I had
a project in ocaml recently, but that probably won't happen again for a while.

I find the biggest hassle working with multiple languages is trying to keep
the libraries and data structure interfaces straight (i.e. push, extend,
unshift, push_back, cons, :, ::, ...). Once I get into the language mindset
the syntax itself doesn't seem to be much of a problem.

I think I'm probably the most productive in python, mostly due to the huge
ecosystem. I'm happiest when solving problems in haskell though, and
increasingly I like rust (really hoping for higher-kinded types, which would
put it in the running for my favorite).

------
groovy2shoes
Python, C, C++, some Lua, and a bit of Perl and Tcl. I find that I'm most
productive in Python or Lua. C and C++ slow me down quite a bit, partly due to
the languages themselves and partly due to fighting with our internal build
system (and the long build times associated with that).

At my previous job I got to use Racket quite a bit, and I was about as
productive there as I am in Python.

I'm a proponent of using the most appropriate language(s) for a particular
project, but sometimes the powers that be will demand something particular
(around here, they usually want C++ or Perl). We've got a static analysis
project slated to start next year, and I'm hoping to talk them into letting me
use OCaml. We'll see...

------
BruceM
Every day is pretty much a mix of Dylan
([http://opendylan.org/](http://opendylan.org/)), some Python, some JavaScript
and either C or C++. Occasionally shell scripts.

My productivity in any of them is usually pretty decent, but it depends more
on what I'm doing. In Dylan, I'm often hacking on the compiler or the runtime,
so that's harder and slower going than doing some web services in Python, or
Javascript for some visualization / UI. C++ varies from fairly easy work to
modifying the standard C++ library to add instrumentation hooks, so again, the
productivity varies.

------
gintsmurans
Web developers do it daily if we assume that html, css and javascript is also
programming. As for me, I do html, css, javascript, php, python, objective-c.
Not all days are the same but these ones overlaps very often.

~~~
joslin01
HTML and CSS are markup languages. So they are a different "language", but are
not considered to be programming languages.

~~~
gintsmurans
Yeah, as I said, if we assume. Still a lot of web developers write javascript
besides backend programming.

------
fuzzythinker
Nimrod (for cpu heavy things), Moonscript (for lapis), Livescript (for web),
and occasionally python and javascript, which used to be my main languages.

I'm now only using python for simple scripts. The one thing that kept me away
from python (among few others) is modifying functions do not return values,
which makes code unnecessary verbose and wastes my time in debugging since I
always forget about that. I'm hoping someone will create a "coffeescript" for
python since the python ecosystem has pretty much everything from web to
machine learning.

------
mercurial
Professionally: Java, Perl, Javascript, PHP On the side: Python, OCaml

Productivity: Java feels more solid than the scripting languages, but is
extremely verbose. Python is the easiest dynamic language I've worked with, it
strikes a good balance between speed of development and consistency. Codebases
in dynamic languages don't scale too well, though especially when your
refactoring tools are "sed" and "mv". OCaml is exceptional in terms of error-
checking at compile time, readability, speed and small LOCs.

------
restlessmedia
Coming from an agency background to more application focussed it's not unusual
to cover most, if not all of the following in a single day; C#, html, css,
javascript (client), sql.

------
cema
I think many will say _Javascript and something else_.

Working in any web stack, you are likely to use Javascript (almost) on a daily
basis. And much less likely to use Javascript or Javascript-based technology
on the back end.

I think I would also add SQL, for the "not no-SQL" backing store. This is a
funny beast: a programming language which (arguably) has not originally been
intended to be used as a programming language, but often is.

(I use C# for the middle tier, but it could be anything depending on the
stack.)

~~~
johan_larson
Oh yeah. Java and JS right here. Probably a common choice. Or "choice".

------
BrianEatWorld
Recently, I have been splitting time between Clojurescript, Python and
HTML/CSS. I am not sure if its actually true, but I certainly feel more
productive in Clojurescript. I think its because, when paired with the right
IDE, you can move a lot of code, really quickly.

At home, I experiment with IBM 370/390 assembly. However, since I have yet to
figure out how to run anything even using an emulator, I think it would be
more counter-productive than productive.

------
sharmanaetor
PHP, JavaScript, Java

Setting up a Java project takes excruciatingly long but after that, it's worth
it. Having code logically organized saves time in the long run. PHP and
JavaScript give you short term productivity gains but after a while, there is
a feeling of being lost in the woods.

I have to say that since I've started working on AngularJS apps though,
JavaScript seems much more pleasant.

------
wastedhours
PHP for normal work stuff and then Ruby for custom Rails apps which speed up
my workflow (in fact, I once used a Rails app to output the PHP code for me to
paste, was a glorious day).

I developed my dev skills more in RoR than PHP, so tend to feel more at home
there, so switching isn't as natural as it could be (partly because it's
mainly flat PHP, MVC feels more intuitive).

~~~
slindz
You might find Yii useful. It's a PHP framework that behaves a lot like RoR in
terms of generators and site function (MVC)

------
anacrolix
Go and bash. Occasional Python, C, C++, and Javascript.

Python and bash are the most productive, but quickly become troublesome as
program size grows, at which point I switch to Go. C and C++ are necessary to
interact with system, third-party libraries, and extreme performance on
occasion. Javascript is just an unfortunate necessity for the web.

------
WoodenChair
A single day might span Objective-C, C, Swift, Dart, Python, JavaScript, and
even PHP... usually just a pick of two of those. I do think it's more
productive to be heavily immersed in no more than one or two day-to-day
because otherwise I start to confuse APIs/syntax from one with another.

------
prse
I regularly work on Ruby/Java/Javascript/css/sql, backend: mysql -
C#/javascript/css/sql backend:oracle,sql-server.Switching between languages
isn’t issue but when i switch between ORM’s and Patterns, I have to read about
certain things I am trying to achieve.

------
tbrownaw
C# (GUI with WinForms)

SQL and PL/SQL

Java (server-side stuff that uses the db)

Perl (server-side stuff that doesn't use the db)

Unix shell script (ksh93; server-side stuff that mostly just calls other
things)

They're each suited for different things, and I think my productivity is
better than if I tried to do everything in a single language.

------
klintcho
Usually Javascript (Node), but also Java. However I'm most productive in
Python, for all and everything, from whipping up a small Flask REST service to
doing some data crunching using Pandas. Unfortunately for me, where I work
Node is the language of choice.

------
jyothepro
Swift, Objective C, PHP

\- Most of my time is spent on Objective C, Swift and PHP for side projects.

\- Sometimes I use Objective C in Swift, PHP in Objective C, not super
annoying as the IDE marks these as errors

\- Productivity is not awesome but its a cost that I have to pay to work on
more than one language.

------
jsmeaton
I regularly switch between C#, Python/Django, some bash, and some straight up
SQL. I'm fairly comfortable with them all - so the productivity is pretty much
the same as switching between multiple projects in the same language.

------
adenner
I sometimes go between C#, C++, Java and php / Javascript. Much like being
multilingual in the language you speak it just takes a little practice. It
does hurt trying to remember the special features of each.

------
rbanffy
Yes, mostly PHP and JavaScript, with Python on separate products. Python is
much more productive, front-end JavaScript is very easy to debug. PHP is a
nightmare that can be mitigated with a lot discipline.

------
RonenTsamir
ActionScript - (Client ) Application C# - Unity - (Client ) Application Java -
(Server) google cloude JavaScript - the host.

if I stack with C# Stile it's OK but if I do same Objective C or PHP. it's
.... ;-(

------
ushi
Today it was Ruby, Go and JavaScript. I feel productiv in all of them.
Sometimes some C, Shell and Python. Python is becoming a pain, because i use
it so rarely, that i have to look up everything.

------
numo16
VBScript (classic ASP), SQL, C#, Javascript, Powershell

Most productive when working in the SQL/C#/JS parts of our stack and then need
a warm-up period whenever I delve into the VBScript areas.

------
amatxn
Ruby, Java, Javascript, HTML, CSS, occasionally C#, VB.Net, PHP, Python,
Scala.

I'm much more productive in Ruby or even C#, just able to get more done and
happier developing in those languages too.

------
themoonbus
Python, JavaScript (backend and frontend web dev respectively). I like to
focus on one for a chunk of time (before lunch / after lunch), but sometimes
that isn't possible.

------
zedr
Yes, mostly Python on the backend, JavaScript on the frontend, and some shell
scripting (Bash).

At home, I dabble in m68k (Amiga) assembly and C.

On the bus, Racket (don't ask me why).

------
Igglyboo
Java and Python. I also have to do javascript in most of my projects but
that's almost a given for this day and age.

Go/Node in my free time(hobby projects).

------
ragebol
C++, Python and a bit of Prolog. All running on ROS, so also some message
definitions and a bunch of bash to make our lives easier

------
sejje
Python, Ruby, Javascript, PHP (HTML, CSS) in a typical day.

Then some Clojure exercises lately, but I'm not actually building anything.
Yet.

------
tptacek
Not counting Javascript, I flip between Ruby & Golang pretty regularly, and
before Golang it would have been Ruby & C.

------
diverightin63
PHP, C#, VB.NET, Python, JavaScript, Microsoft SQL, MySQL, HTML, CSS.
Switching between them doesn't slow me down.

~~~
eps
Programming in HTML and CSS sounds awesome.

~~~
diverightin63
Touche.

------
antjanus
I often go between PHP and Javascript (Node + Angular). :) I used to juggle a
bit more than that too!

------
christiangenco
Anyone doing frontend web development will have at least three: html, css, and
javascript.

More experienced developers will add a preprocessor for each of those: slim
(or haml, jade, erb, etc.), scss (or less, sass, etc.), and coffeescript.
You're writing in the preprocessor, but debugging in the language it compiles
to, so we're at at least six.

Now if you're programming a webapp with an actual backend, you'll need to use
some middleware:either Ruby on Rails (my personal favorite), Python's django,
Cake PHP (or whatever the cool kids on PHP are using these days), C#'s .NET,
or Perl's dancer. The reason Node.js was a big deal was that it let you save a
language here: you could re-use your javascript skills on the backend. The
framework is so dramatically different, though, that I'd still count it as
another language.

Now we're at seven.

Presumably you'll be interacting with some kind of API that uses either JSON
or XML, so we'll call it eight.

Maybe your ORM (object-relational mapper) isn't quite robust enough to handle
a query you need to make to your database, so you have to dip a bit into SQL
(or Mongo, Redis, or whatever popular database you happen to be liking right
now). You could potentially skirt this by using a service like Firebase that
will let you keep your javascript and json skills for your database, but I'm
still counting this as nine.

If you're just an app developer, and you either work on some kind of team that
has other people that like to do this next part, or you're rich and can afford
heroku, then you can stop here. Otherwise we've got a few more.

To deploy your app you've got to know how to log into your server and install
your app dependencies, so you've got to learn bash (and a lot of other _nix
tools, like ssh, scp, tmux, and vim, but those aren 't really _languages _).
Ten, easy.

One of the things you have to install is a web server like Apache or nginx.
The config files of these things are a language unto themselves: they're both
_kind of* XML-ey, but not really. I'm counting this as eleven even though it's
usually something people just pick up by changing variables of, and nobody's
actually writing in the stuff.

So a minimum of eleven. Personally, I also take notes in Markdown, jump
between projects that are using different preprocessors and backends, and get
myself into more trouble than I should on the server side. On a given day I
think it's fair to say this could hit twenty.

And that, ladies and gentlemen, is how I almost always won the "who knows the
most programming languages" dick-swinging contests in high school and college.

~~~
derengel
I thought we were talking about "programming" languages only.

~~~
thaumaturgy
For purposes of this conversation, css should certainly be considered a
programming language. It might not have all of the standard logical
conventions of programming languages (although you can now write FizzBuzz in
css...), but being good at css requires a nearly encyclopedic knowledge of css
rules, behavior, and interactions.

I'm shit at css, but I do just enough of it to have a serious respect for the
people who know it well, and I wouldn't refuse to call what they do
programming.

------
ttty
Just JavaScript, day and night, client and server... No need for other stuff
except for CSS.

~~~
rabbyte
That's like being the Soylent of programmers. Try a banana every once in a
while at least!

------
mcmillion
Rails, Laravel, vanilla PHP, daily.

If I had it my way, it would just be Rails. Much more productive.

------
seivan
Ruby, Swift, Objective-C and CoffeeScript. But usually separated between
projects.

------
davidw
Ruby and Erlang, these days. Plus a bit of other things like SQL and
Javascript.

------
jheriko
regularly switch between C, C++, Java and Objective-C

necessary for cross platform development

C++ for the win. its annoying apple and google break the universality of C/C++
by forcing you to use tools built on top of C/C++ :P

------
lowglow
PHP/Ruby/JS, previously, PHP/JS/Python/C/C++

------
dataminded
Python, Javascript and SQL pretty regularly with some BASH here and there

------
pkinsky
Scala, with a regular smattering of SQL and Haskell for side projects.

------
oweiler
It's often a combination of Bash, Java, Groovy and JavaScript.

------
krob
PHP, Javascript(does angularjs count?), Markup(html, css)

------
janantala
Javascript (Node + Angular), Objective-C, Java (Android)

------
kgc
Javascript, Objective-C, Java, Ruby

------
jeena
C++, Qml, bash at work.

JavaScript, Python at home.

------
hemerly
c for firmware development, java for android and python for prototyping and
automation.

------
nyddle
Perl by day, Python by night.

------
valevk
VBA,

SQL,

Golang,

Bash

(sadly in this order of frequency)

~~~
BrianEatWorld
For what do you use so much VBA on a daily basis? My only experience with it
was writing Excel macros back when I worked with data.

~~~
valevk
Pretty much what you say. Automating data maniplation/transformation, and also
providing a simpler way for non-tech employees to enter data into Excel (Open
Excel shhet -> Form pops up -> there is one Textfield in a form -> enter value
-> value is placed where is should be placed in the sheet)

It's not necessatily on a daily basis, but mostly it's VBA.

------
danielhunt
Web tier: PHP, JavaScript, HTML, CSS

App tier: Java

Backend: Oracle

<3 my job

------
chandrew
PHP, JS, HTML, CSS

------
benzesandbetter
python and javascript, most days.

------
joshdance
php, javascript, html, sql

------
antocv
Productivity depends on your previous experience and the domain you're in.

Sometimes Im way more productive in Bash than in Python, sometimes its other
way around, and sometimes Im most productive in Java.

You cant do web development with Bash so I guess me or anyone else would be
infinietley more inproductive trying to use that for web dev.

Similary just some stuff you cant do in your favourite language.

Choose wisely and you'll be productive.

~~~
kcorbitt
> You cant do web development with Bash

Well, actually...
[http://www.yolinux.com/TUTORIALS/BashShellCgi.html](http://www.yolinux.com/TUTORIALS/BashShellCgi.html)

~~~
antocv
Well yeah, I knew that, but seriously.

If you gonna go that road, then use netcat echo and loops for a web server
too.

