Ask HN: How many programming languages/development frameworks are you currently using?
22 comments
At justin.tv I program pretty much every day in Python, Javascript, and haXe. Occasionally I do Ruby too. It does get confusing sometimes - it still takes me a couple of seconds to mentally switch gears between the different languages.
I am a mono-linguist: Common Lisp for everything, from the hand-optimized webserver (hunchentoot), to the parser scripts that feed the database, to the data-entry software that lets my affiliates/contractors feed the database, and the daemon that runs routinely analyzing the database tables and building in-memory caches of frequently used objects and doing scheduling for the queue, and the other daemon that does backup and reporting. Even the twilio voice menu for the phone is generated by a CL-WHO app :-P
Sometimes I go for so long not touching anything but Lisp, I end up writing weird stuff like "defstruct foo { int bar, char name};" whenever I need to wrap a C library to call out to :-P
[If any Lispers are reading this: I have this weird problem where I have a slime session running on screen for weeks, during which I write something in a temporary file, or inside another file, evaluate and edit it until it works .. but I forget it there! over time, the running application has little resemblance to the textual representations I have spread over several files, and it gets worse when I delete entire useless regions and refactor them. At least other languages have the decency to bondage-and-discipline me into naming my files and organizing the project hierarchy :-]
Sometimes I go for so long not touching anything but Lisp, I end up writing weird stuff like "defstruct foo { int bar, char name};" whenever I need to wrap a C library to call out to :-P
[If any Lispers are reading this: I have this weird problem where I have a slime session running on screen for weeks, during which I write something in a temporary file, or inside another file, evaluate and edit it until it works .. but I forget it there! over time, the running application has little resemblance to the textual representations I have spread over several files, and it gets worse when I delete entire useless regions and refactor them. At least other languages have the decency to bondage-and-discipline me into naming my files and organizing the project hierarchy :-]
This may seem really "out there", but I keep all the code of a package in one file. Not only does this reduce or eliminate asdf/defsystem maintenance, which I loathe doing, it also helps avoid the kind of habit you described. After all, the edits are all in one place.
To borrow a quote from the movie Highlander - "There can be only one (file)!"
To borrow a quote from the movie Highlander - "There can be only one (file)!"
the first thing I do with any new project is create a directory for it, the package.lisp file and the .asd. That much I do (though I should automate it, like weblocks does with defproject, hmmm)
but after that it's one file, until it gets too bloated and redundant, then i break it to two small redundant pieces.
Thought sometimes its too tempting to do everything in the repl: cramming a fat piece of code into one form and save the result as (setf foo *) if I like what I see :-D usually for experimentation with a new library I'm using for the first time.
but after that it's one file, until it gets too bloated and redundant, then i break it to two small redundant pieces.
Thought sometimes its too tempting to do everything in the repl: cramming a fat piece of code into one form and save the result as (setf foo *) if I like what I see :-D usually for experimentation with a new library I'm using for the first time.
One thing that could help is to put everything like that in one place - say, a file called scratch.lisp in the root of the source tree. While it's not an ideal place to store any code long-term, it lets you know what still needs to be filed.
I have a misc.lisp file that I religiously copy stuff to. But usually, things go to misc first but later migrate to component level "package-misc" type locations, usually at the top of the component's file (I add stuff to the bottom and prefer to have a screenful of my working code, with less relevant code a PgUp or two away -- so stuff at the top is defpackage, in-package, defvars, conditional compilation stuff then the misc tools.)
I had this problem (putting or forgetting semicolons) for a while, but it looks to be gone with experience. I constantly switch from Python to Javascript to C to Ruby.
Side: Python, Django, web.py, sqlalchemy, D, Javascript/jQuery, Erlang, Postgresql, Mysql, Sqlite, CouchDB, Mercurial, Git
Work: Perl, Bash, Python, PHP, Javascript/jQuery/in house stuff, ASP, Java/Jboss/Fast/JSP, ColdFusion, Soap, XML/XSL, Sql Server, Oracle, Mysql, Subversion
Huge lists on both sides, but there's a main difference: If something is broken over work, I have to fix. I don't exactly know Java or ColdFusion that much, but if the Java guy is away and something needs to be done, I know enough to poke around and consult Google.
On the Side: I don't exactly know all of D, Erlang and CouchDB, but I have fun coding small things on each language from time to time, doing stuff on Project Euler. I wouldn't accept a paying job which required Erlang, for example, but I made simple a distributed crawler just to see what the platform is capable of. I think I know enough of each to at least understand its strengths and weakness on a higher-level, to know when it could be used as a solution. When I want to do something more serious, I choose Python.
Anyway, to trim the lists a little, I would say Python on Side, and PHP on Work. These languages get 75% of my time.
Work: Perl, Bash, Python, PHP, Javascript/jQuery/in house stuff, ASP, Java/Jboss/Fast/JSP, ColdFusion, Soap, XML/XSL, Sql Server, Oracle, Mysql, Subversion
Huge lists on both sides, but there's a main difference: If something is broken over work, I have to fix. I don't exactly know Java or ColdFusion that much, but if the Java guy is away and something needs to be done, I know enough to poke around and consult Google.
On the Side: I don't exactly know all of D, Erlang and CouchDB, but I have fun coding small things on each language from time to time, doing stuff on Project Euler. I wouldn't accept a paying job which required Erlang, for example, but I made simple a distributed crawler just to see what the platform is capable of. I think I know enough of each to at least understand its strengths and weakness on a higher-level, to know when it could be used as a solution. When I want to do something more serious, I choose Python.
Anyway, to trim the lists a little, I would say Python on Side, and PHP on Work. These languages get 75% of my time.
Right now I regularly use PHP, perl, and lua.
I've been learning Common Lisp and Python for a while, though because my company uses those languages above, and because I haven't started any new projects yet for new languages, and because PHP has been my primary language for 5 years now, I think in PHP.
I have to broaden my horizons.
I've got some fun ideas for projects to tinker with that would use some other languages (recently bought books on Erlang, Haskell, Clojure, and Ruby). And though they likely wouldn't generate much if any revenue, it's worth doing something practical just to learn some new languages.
Back when I used to do PHP on my own, and VP ASP for my employer, I was regularly messing up if and loop syntaxes, and <? and <%, and either forgetting or adding semicolons.
I've been learning Common Lisp and Python for a while, though because my company uses those languages above, and because I haven't started any new projects yet for new languages, and because PHP has been my primary language for 5 years now, I think in PHP.
I have to broaden my horizons.
I've got some fun ideas for projects to tinker with that would use some other languages (recently bought books on Erlang, Haskell, Clojure, and Ruby). And though they likely wouldn't generate much if any revenue, it's worth doing something practical just to learn some new languages.
Back when I used to do PHP on my own, and VP ASP for my employer, I was regularly messing up if and loop syntaxes, and <? and <%, and either forgetting or adding semicolons.
When I write them down I'm surprised at how few I actually use on a daily basis. It boils down to (in order of decreasing frequency):
1. Matlab
2. C++
3. CMatlab? What is a HackerNews reader doing with Matlab?
(I ask because I also use Matlab all the time, but I am curious what others are using it for.)
(I ask because I also use Matlab all the time, but I am curious what others are using it for.)
Perl, Python, PHP, JavaScript
Movable Type, with Perl. Some Django, and non-Django stuff with Python. Hacking on Active Collab, written in PHP. Rely heavily on jQuery for JavaScript these days. Chicken Scheme for some random exploration now and again.
I've become pretty good at context switching between them all. I make mistakes sure, but I don't spend more than 5 seconds writing JavaScript in a .py file.
Movable Type, with Perl. Some Django, and non-Django stuff with Python. Hacking on Active Collab, written in PHP. Rely heavily on jQuery for JavaScript these days. Chicken Scheme for some random exploration now and again.
I've become pretty good at context switching between them all. I make mistakes sure, but I don't spend more than 5 seconds writing JavaScript in a .py file.
Too many :-|. Ruby, Java, C, Python, Scala, Javascript and when I can't avoid it, C++. If I get the chance then some Haskell, Clojure, or Common Lisp.
I have to switch languages a lot too, but I've found that I don't have a problem as long as I use each language regularly. It's when I haven't used a certain language for a few weeks / months that I confuse it with other languages.
edit: For the record, I frequently switch between Flex, Java, PHP/SQL, C, Lisp / Clojure, and a couple of other scripting/markup languages.
edit: For the record, I frequently switch between Flex, Java, PHP/SQL, C, Lisp / Clojure, and a couple of other scripting/markup languages.
Personal stuff tends to be in Clojure or Haskell lately. One project is currently using a little bit of Python to tie some things together, but that will probably go away. There's also some occasional Lua.
Various paid projects over the past year have used Ruby, Common Lisp, Javascript and PHP.
Emacs Lisp sees use for both on occasion, for a total of 9.
Various paid projects over the past year have used Ruby, Common Lisp, Javascript and PHP.
Emacs Lisp sees use for both on occasion, for a total of 9.
In my project I use Java for the server with a jQuery front end and at work it's Java on the server again with an AS3 front end, so 3 serious languages unless you count RDF, OWL, Jena Rules, SWRL rules in which case it's more like 7, if you want to push the envelope and add XML 8, so taking those not-really-languages appropriately, I'd say about 5.5 (:
A ridiculous amount. 12 in fact. I wrote a wiki entry over at stack overflow about this (http://stackoverflow.com/questions/510261/how-do-you-keep-al...)
I agree, it sometimes seems too much and I wish for some standardization.
I agree, it sometimes seems too much and I wish for some standardization.
The more you code in each language, the less severe a problem is. I find that as soon as you lay down a few lines of code in a certain language, your mind switches context to that language and the habits you picked up in that language come back fairly soon. Once you get in the swing of things, it should be straightforward.
During the day I use C#, VB.Net, Javascript and Python (also T-SQL, not sure if that really counts for your question though).
At night, I was working on some Smalltalk and Clojure; but a friend of mine has recently convinced me to give Groovy / Grails a go.
At night, I was working on some Smalltalk and Clojure; but a friend of mine has recently convinced me to give Groovy / Grails a go.
Java and ActionScript 3 (Flex) at work. Right now, Objective C, Python and JavaScript (jQuery) at home.
Yes, I do occasionally run into idiomatic problems as I switch languages, but it is better than coming home and doing Java. :)
Yes, I do occasionally run into idiomatic problems as I switch languages, but it is better than coming home and doing Java. :)
C#, VB6 (maintenance), and PHP.
My big stumbling block is foreach loops:
foreach (int i in myInts) { ... }
For Each i As Integer In myInts ... Next
foreach ($myInts as $i) { ... }
foreach (int i in myInts) { ... }
For Each i As Integer In myInts ... Next
foreach ($myInts as $i) { ... }
Common Lisp, Erlang, Javascript, and ... Objective C.
I am slowly adding Clojure to this mix.
The most dissonant cognitive shift is going from Lisp to Objective C.
I am slowly adding Clojure to this mix.
The most dissonant cognitive shift is going from Lisp to Objective C.
For work, ignoring side fun things:
Perl, Smalltalk, Ruby, SQL, bash, make, xhtml, css, Seaside
Dips into python and C from time to time
Perl, Smalltalk, Ruby, SQL, bash, make, xhtml, css, Seaside
Dips into python and C from time to time
Work: Python, PHP, Javascript, CSS, HTML, SQL; Django, Drupal, jQuery, CleverCSS
Play: LISP, SuperCollider, Max/MSP, Processing
Play: LISP, SuperCollider, Max/MSP, Processing
At Sponty: Python + Google App Engine + prototype.js
at consulting gig: Flex, Java, PHP and some Django.
Today and yesterday: PHP/CI, Flex, Javascript, Python/Django, C++, C#/XAML, bash scripting.
Fun!
Fun!
C++ at the day job, Java for hobby projects, and sometimes PHP for freelance projects.
I'm planning on developing apps on the IPhone and Android soon.
I get confused sometimes when programming (e.g. putting semicolons at the end of the statement (C#) when writing python code).
What's your experience with actively using different languages on a daily basis?