11

This is a rather philosphical / theoretical question.

I am interested in the question, how language (in this case programming languages) and thoughts (= solutions of problems) are connected.

I want to know, whether the programming language influences the solutions, I can come up with.

For example:

I program something in Haskell (functional) and in Java (OOP). Do the general solutions differ fundamentally or are they - aside from syntactic sugar - the same? Do I not just use different algorithms and a different software design, but do I fundamentally change my whole point of view, my concept and my view of the software, depending on the paradigm I am starting from?

(Note: "I" stands for a generic programmer)

I know, that this question is pretty hard to answer, but I find it very interesting, so I wanted to know, whether somebody has (and might share) a opinion about this.

apfelbox
  • 237
  • 1
  • 6
  • I somebody knows about papers or research in this area, I would be happy, if you could share some links. – apfelbox Mar 09 '13 at 12:43
  • 2
    I'm sorry I don't really understand your question. Are you asking about possible relations between the "thought process" (what goes on in someone's mind when coming up with a solution) and the "code process" (how that solution is described in a program)? (i.e. whether these two things influence themselves?) Or something completely different? – Mat Mar 09 '13 at 12:54
  • maybe this is of use: http://www.cs.utexas.edu/~wcook/anatomy/anatomy.pdf – User Mar 09 '13 at 13:52
  • @Mat yes. My interest is in finding a possibly answer to the question: does the programming language (and the used paradigm) influence the solutions, I can come up with. And if so, how. – apfelbox Mar 09 '13 at 14:01
  • Seems like a more philosphical question, than a "here is your code example" one. Maybe that's why the two downvotes.. – apfelbox Mar 09 '13 at 14:02
  • 2
    Well I didn't vote either way, but your question is really hard to understand as stated. And it sounds really philosophical. With your previous comment, generalizing, I guess it would be "do the tools you have available influence the way you think/solve problems?", which is an interesting question, but I'm not sure it's a question that fits this site well. Could you please [edit] your question to make it clearer? – Mat Mar 09 '13 at 14:11
  • @Mat I edited the question and tried my best. I wasn't sure, where to ask this question (which part of stackexchange or even a completely different site), but I tried my luck here, for now. – apfelbox Mar 09 '13 at 21:35
  • I think this is an interesting question, and I personally believe that programmers are susceptible to the stronger form of the Sapir-Whorf Hypothesis (includes short section on programming languages). Unfortunately, I'm not aware of much research in the area (but I would welcome some links, too). Perhaps you'd get a better response in the programming section on a discussion forum like reddit. – molbdnilo Mar 09 '13 at 21:55
  • Rephrase the question so it focuses entirely on your example (functional vs OO). I think that might do the trick for a valid question – Martin Wickman Mar 10 '13 at 09:35
  • Probably the biggest difference in thought/design process influenced by a language or paradigm is bottom-up vs. top-down design. – SK-logic Mar 11 '13 at 09:31

2 Answers2

12

Without getting into the Sapir-Whorf Hypothesis, I will make the claim that the language, framework and tools (collectively, your programming ecosystem) profoundly influences and shapes the way you think, in terms of writing software.

It's not hard to see why this is true. Consider a typical line-of-business application. Traditionally, we would have written SQL statements to retrieve data out of a database and produce a report. But then ORM's came along, and now we can retrieve data into collections of objects. Eventually, someone pointed out "Well, why do we even need SQL at all," and the NoSQL movement was born.

How do these different paradigms affect the way programmers think? Well, in SQL, if you want to relate two tables of information together, you perform a JOIN. The NoSQL guy has to loop through his collections to find pairs that match. The SQL guy thinks in terms of sets and joins. The NoSQL guy thinks in terms of collections and loops.

In terms of the programming language itself, your programming experience (and the way you think) will be strongly influenced by:

  • what facilities the language offers,
  • at what level of conceptual abstraction the language is (i.e. is it low-level or high-level),
  • what paradigms the language offers (i.e. Functional, Imperative, Object-Oriented), and
  • what kind of assumptions the language designers make (e.g. many ways to do a thing vs. the One True Way).

Eric Raymond sums it up eloquently when he speaks of the benefits of learning Lisp:

Lisp is worth learning for the profound enlightenment experience you will have when you finally get it; that experience will make you a better programmer for the rest of your days, even if you never actually use Lisp itself a lot.

For more about how language influences the way we think, see here:
http://scienceblogs.com/cognitivedaily/2005/05/13/does-our-language-affect-our-t/

Robert Harvey
  • 199,517
  • The Wikipedia article on the Sapir-Whorf Hypothesis mentions applications to programming languages. – chrisaycock Mar 09 '13 at 23:49
  • 1
    There is also the c2.com article/discussion on the SapirWhorfHypothesis which touches on programming... and links to ProgrammingLanguagesShapeThoughts –  Mar 10 '13 at 02:39
  • Ah you almost had my up vote, + 1 for Sapir Wharf -1 for conflating NoSQL and imperative programming. Collections may be essential for NoSQL but loops aren't. MS LINQ and similar abstractions work perfectly fine with NoSQL. Another +1 for mentioning Lisp – AndreasScheinert Mar 11 '13 at 09:43
  • 2
    @AndreasScheinert: How does one do a join with NoSQL? Does it perform well under the hood? – Robert Harvey Mar 11 '13 at 14:07
  • @Robert Harvey the returned collection may be heterogenous. Do you mean internally in the NoSQL system or how the client driver is implemented? – AndreasScheinert Mar 11 '13 at 20:30
  • 2
    @AndreasScheinert: That's a perfect example of the difference in thinking. If I have a table of customers in a SQL database, they're not going to be heterogenous. – Robert Harvey Mar 11 '13 at 20:43
  • This matches quite good, with what I was thinking. Thank you for the insight! – apfelbox Mar 13 '13 at 08:46
  • @AndreasScheinert it's funny because MS LINQ works by - in the absence of a suitable join mechanism - doing a loop – user253751 Mar 17 '23 at 15:40
  • @user253751: It's all loops under the hood. The point of programming languages and tools like Linq is to provide abstractions over other abstractions, which is what Linq does. – Robert Harvey Mar 17 '23 at 17:57
  • @RobertHarvey in the context of this question, "loops" refers to implementing a join the obvious way on the client side of the database connection. – user253751 Mar 18 '23 at 22:20