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
35
votes
8 answers

Comparing R to Matlab for Data Mining

Instead of starting to code in Matlab, I recently started learning R, mainly because it is open-source. I am currently working in data mining and machine learning field. I found many machine learning algorithms implemented in R, and I am still…
iinception
  • 1,945
  • 2
  • 21
  • 19
34
votes
5 answers

Groovy advantages over Jython or Jruby?

Why would I choose to use Groovy when I could use Jython or Jruby? Does the language provide any inherent advantages to make up for the fact that Jython and Jruby skills are applicable to their parent languages outside of the JVM? Keep in mind that…
James McMahon
  • 48,506
  • 64
  • 207
  • 283
34
votes
6 answers

What is the equivalent in PHP for Python's pass statement?

Do you know any PHP statement that works like Python's pass statement?
Jan Tojnar
  • 5,306
  • 3
  • 29
  • 49
32
votes
9 answers

Is Haskell a Lisp?

I've been reading The Haskell Road to Logic, Maths and Programming by Doets and Eijck 2004. It seems to be a well respected book, but I was struck when it claims that Haskell is a member of the Lisp family. Is this accurate? I would characterise…
Bob Bobson
  • 353
  • 3
  • 3
31
votes
3 answers

How does Clojure STM differ from Haskell STM?

I am trying to find the differences between what Clojure calls an STM and what is implemented in Haskell as STM. Taking the actual language semantic differences aside I am a little confused as Rich Hickey says in his speech that Clojure's…
yazz.com
  • 57,320
  • 66
  • 234
  • 385
31
votes
5 answers

Assign console.log value to a variable

How can I assign a JavaScript object to a variable which was printed using console.log? I am in Chrome console. With Ruby I would use test = _ to access the most recent item printed.
Dru
  • 9,632
  • 13
  • 49
  • 68
27
votes
8 answers

Jinja-like JS templating language

I really like django/jinja2 templating languages. Their syntax is extremely simple and yet is highly versatile. Is there anything similar to that in both syntax and capability in javascript, or if not both, at least in the capability. I looked at…
miki725
  • 27,207
  • 17
  • 105
  • 121
26
votes
3 answers

What's the Ruby equivalent of Python's defaultdict?

In Python, I can make a hash where each element has a default value when it's first referenced (also know as "autovivification"). Here's an example: from collections import defaultdict d = defaultdict(int) d["new_key"] += 1 print d Printing the…
Ollie Glass
  • 19,455
  • 21
  • 76
  • 107
26
votes
5 answers

Actionscript 3 vs Haxe: Which to chose for new Flash project?

I am in the planning stages of a new Flash game project and was wondering which language would be better to use? I already have a strong understanding of Actionscript 3, and have not worked with Haxe yet, but I have read the language reference docs…
Jason Miesionczek
  • 14,268
  • 17
  • 76
  • 108
25
votes
5 answers

Templating library in node.js similar to Jinja2 in Python?

What would be a node.js templating library that is similar to Jinja2 in Python?
bodacydo
  • 75,521
  • 93
  • 229
  • 319
24
votes
8 answers

Should I learn Haskell or F# if I already know OCaml?

I am wondering if I should continue to learn OCaml or switch to F# or Haskell. Here are the criteria I am most interested in: Longevity Which language will last longer? I don't want to learn something that might be abandoned in a couple years by…
Unknown
  • 45,913
  • 27
  • 138
  • 182
21
votes
4 answers

Powershell equivalent of python's if __name__ == '__main__':

I am really fond of python's capability to do things like this: if __name__ == '__main__': #setup testing code here #or setup a call a function with parameters and human format the output #etc... This is nice because I can treat a…
Mark Mascolino
  • 2,227
  • 1
  • 15
  • 19
19
votes
5 answers

Ada subtype equivalent in C++

Does C++ offer something similar to Ada's subtype to narrow a type? E.g.: type Weekday is (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday); subtype Working_Day is Weekday range Monday .. Friday;
sornbro
  • 243
  • 3
  • 12
19
votes
3 answers

Does python have an equivalent to Javascript's 'btoa'

I'm trying to find an exact equivalent to javascript's function 'btoa', as I want to encode a password as base64. It appears that there are many options however, as listed here: https://docs.python.org/3.4/library/base64.html Is there an exact…
chris
  • 1,869
  • 4
  • 29
  • 52
19
votes
3 answers

F# equivalent of `is` keyword in C#?

My first F# day. If I have this: let cat = Animal() Now how do I check at later stage if cat is Animal? In C# bool b = cat is Animal; In F#?
nawfal
  • 70,104
  • 56
  • 326
  • 368
1 2
3
8 9