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
18
votes
6 answers

Implementing python slice notation

I'm trying to reimplement python slice notation in another language (php) and looking for a snippet (in any language or pseudocode) that would mimic the python logic. That is, given a list and a triple (start, stop, step) or a part thereof,…
georg
  • 211,518
  • 52
  • 313
  • 390
17
votes
7 answers

Java-like Collections in PHP

I'm learning PHP5 (last time I checked PHP was in PHP4 days) and I'm glad to see that PHP5 OO is more Java-alike than the PHP4 one but there's still an issue that makes me feel quite unconfortable because of my Java background : ARRAYS. I'm reading…
cort
  • 1,088
  • 1
  • 11
  • 20
16
votes
2 answers

What are the differences between the type inference of Scala and C++11?

I'm curious what the differences between the type inference of Scala and C++11 are. In which situations do I have to specify the types in one language but not in the other? One difference seems to be the return type of functions which always have to…
Frank S. Thomas
  • 4,725
  • 2
  • 28
  • 47
15
votes
9 answers

What is the overall design philosophy of php?

I recently had my first encounter with PHP (5) through a Drupal application for a client. There was certainly nothing difficult about the experience (documentation is good for instance), but I never had a moment where I thought, "that's really…
guns
  • 10,550
  • 3
  • 39
  • 36
13
votes
1 answer

How to pass two parameter values to couchdb views?

I want to reproduce this SQL in CouchDB views. SELECT name,department FROM Persons where id = ? and group_id = ? ; How do I write a view and query view in CouchDB for this SQL?
Ajay
  • 151
  • 1
  • 1
  • 6
13
votes
2 answers

Type classes in Scala

Having a background in Haskell I am currently trying to get familiar with Scala. I encountered some problems trying to translate a small, extensible expression language from Haskell into Scala. The underlying issue of writing a data type that is…
FloDo
  • 215
  • 1
  • 9
13
votes
2 answers

Global scope for user snippet in Atom.io editor

I would like to transform some snippets that I wrote for the Sublime Text 3 editor to the atom.io editor. Since I have a "license" snippet that is valid for any type of file (any file extension) then in the licence.sublime-snippet file I did'n…
13
votes
3 answers

PHP equivalent of Python's `str.format` method?

Is there an equivalent of Python str.format in PHP? In Python: "my {} {} cat".format("red", "fat") All I see I can do in PHP natively is by naming the entries and using str_replace: str_replace(array('{attr1}', '{attr2}'), array('red', 'fat'), 'my…
jeromej
  • 10,508
  • 2
  • 43
  • 62
12
votes
5 answers

What does Mirah offer over JRuby,Groovy and Scala?

What does Mirah language offer over JRuby,Groovy and Scala?
Chiron
  • 20,081
  • 17
  • 81
  • 133
11
votes
4 answers

What is the ruby equivalent of python's getattr

I am new to rails and trying to do a little refactoring (putting a partial renderer that lists titles in app/views/shared ) The renderer shows the dates along with the titles. However different users of the renderer use different dates. Part way…
Hamish Downer
  • 16,603
  • 16
  • 90
  • 84
11
votes
2 answers

AWS equivalent to Azure Logic Apps

Is there an AWS equivalent to Azure Logic Apps? Furthermore I would like to know if someone has experiences regarding a migration of Azure Integration Services into AWS and if a comparison between Azure and AWS regarding the integration stack…
11
votes
2 answers

What is the difference between the const qualifier in C and the const qualifier in C++?

I´ve found a comment of user R..: C and C++ are not the same language. In particular, C const has nothing to do with C++ const. I know, that one difference between the const qualifier in C and the const qualifier in C++ is its default linkage. An…
11
votes
6 answers

Iterate a format string over a list

In Lisp, you can have something like this: (setf my-stuff '(1 2 "Foo" 34 42 "Ni" 12 14 "Blue")) (format t "~{~d ~r ~s~%~}" my-stuff) What would be the most Pythonic way to iterate over that same list? The first thing that comes to mind is: mystuff…
Wayne Werner
  • 49,299
  • 29
  • 200
  • 290
10
votes
4 answers

What is the difference between Java's equals() and C++'s operator ==?

In a question regarding the use of typeid is C++, I suggested it could be used to compare types in objects comparison. I haven't seen it done much, but I had Java's equals in mind. Looking into Java a bit more, this seems to be the case: Some say…
Eran
  • 21,632
  • 6
  • 56
  • 89
10
votes
4 answers

Is it possible to emulate Scala's traits in Python?

I want to create lightweight interfaces with methods that I can plug into classes. Here is an short example in Scala: class DB { def find(id: String) = ... } trait Transformation extends DB { def transform(obj: String): String override def…
rafalotufo
  • 3,862
  • 4
  • 25
  • 28
1 2 3
8 9