Questions tagged [language-comparisons]

Questions comparing two or more programming or markup languages against each other.

Usage guidance

Questions and answers on Stackoverflow are generally intended to discuss specific features with one or more repeatable and unambiguous solutions.

Consequently, the language-comparisons tag is intended to cover cases where:

  • two or more languages implement the same or substantially similar functionality
  • the functionality comparison is capable of unambiguous identification and resolution
  • such resolution does not require extended discussion or rely solely on subjective personal opinions or personal preference
124 questions
676
votes
6 answers

Scala vs. Groovy vs. Clojure

Can someone please explain the major differences between Scala, Groovy and Clojure. I know each of these compiles to run on the JVM but I'd like a simple comparison between them.
James Fassett
  • 40,306
  • 11
  • 38
  • 43
517
votes
24 answers

XSLT equivalent for JSON

Is there an XSLT equivalent for JSON? Something to allow me to do transformations on JSON like XSLT does to XML.
luvieere
  • 37,065
  • 18
  • 127
  • 179
363
votes
9 answers

Is there a Python equivalent to Ruby's string interpolation?

Ruby example: name = "Spongebob Squarepants" puts "Who lives in a Pineapple under the sea? \n#{name}." The successful Python string concatenation is seemingly verbose to me.
Caste
  • 3,633
  • 2
  • 15
  • 5
287
votes
5 answers

What are the differences between Perl, Python, AWK and sed?

What are the main differences among them? And in which typical scenarios is it better to use each language?
Khaled Al Hourani
  • 3,277
  • 3
  • 20
  • 17
206
votes
13 answers

C# vs Java Enum (for those new to C#)

I've been programming in Java for a while and just got thrown onto a project that's written entirely in C#. I'm trying to come up to speed in C#, and noticed enums used in several places in my new project, but at first glance, C#'s enums seem to be…
Ogre Psalm33
  • 21,366
  • 16
  • 74
  • 92
204
votes
8 answers

Is there a virtual environment for node.js?

I've searched the wiki modules page, but I can't find anything similar to virtualenv (python) or rvm. Anyone here separates node.js in their own env? I really don't like to install npm system-wide.
Frangossauro
  • 4,446
  • 4
  • 23
  • 15
144
votes
2 answers

What is the Bash equivalent of Python's pass statement

Is there a Bash equivalent to the Python's pass statement?
skeept
  • 12,077
  • 7
  • 41
  • 52
135
votes
5 answers

What are the primary differences between Haskell and F#?

I've searched on the Internet for comparisons between F# and Haskell but haven't found anything really definitive. What are the primary differences and why would I want to choose one over the other?
ljs
  • 37,275
  • 36
  • 106
  • 124
104
votes
8 answers

Haskell, Lisp, and verbosity

For those of you experienced in both Haskell and some flavor of Lisp, I'm curious how "pleasant" (to use a horrid term) it is to write code in Haskell vs. Lisp. Some background: I'm learning Haskell now, having earlier worked with Scheme and CL (and…
J Cooper
  • 16,891
  • 12
  • 65
  • 110
87
votes
4 answers

Does PHP have an equivalent to Python's list comprehension syntax?

Python has syntactically sweet list comprehensions: S = [x**2 for x in range(10)] print S; [0, 1, 4, 9, 16, 25, 36, 49, 64, 81] In PHP I would need to do some looping: $output = array(); $Nums = range(0,9); foreach ($Nums as $num) { $out[] =…
83
votes
9 answers

Python: Assign Value if None Exists

I am a RoR programmer new to Python. I am trying to find the syntax that will allow me to set a variable to a specific value only if it wasn't previously assigned. Basically I want: # only if var1 has not been previously assigned var1 = 4
Spencer
  • 21,348
  • 34
  • 85
  • 121
83
votes
5 answers

Is there a Python equivalent to Ruby symbols?

Is there a Python equivalent to Ruby symbols? If so then what is it? If not then are we stuck with using strings as our keys in dictionaries only?
pylonicon
79
votes
4 answers

What is C# equivalent of in C++?

I have defined a class myComplex. I need to map it to integers. In C++ I would have created a map as map first; How to do such thing in C#?
Abhash Kumar Singh
  • 1,157
  • 2
  • 12
  • 22
73
votes
8 answers

Is everything an object in Python like Ruby?

I read on another Stack Overflow question that Python was just like Ruby, as it relates to "everything's an object," and everything in Python was an object, just like Ruby. Is this true? Is everything an object in Python like Ruby? How are the two…
johnny
  • 19,272
  • 52
  • 157
  • 259
73
votes
3 answers

Ruby equivalent for Python's "try"?

I'm trying to convert some Python code into Ruby. Is there an equivalent in Ruby to the try statement in Python?
thatonegirlo
  • 893
  • 1
  • 6
  • 10
1
2 3
8 9