Interesting survey: Do programming languages change the way you think?

Link to survey: tiny.cc/programthemind

I found this thorugh this tweet:

1 Like

I dare someone to truly learn LISP or OCaml and then claim that their way of thinking did not change, not even just about codeā€¦ ^.^

2 Likes

In what way do they change the way you think?

Well for Lispā€™y languages the macro system causes you to think about not only about the code, but also about simplifying it and making it more readable, to make a DSEL for your problem rather than just handling the problem. :slight_smile:

For OCaml and other strong HM typed languages is that you learn about how to structure data First. In dynamic languages, including elixir, many people do not always have in mind in what form their data is and it causes a lot of bugs because of it (which dialyzer can catch ā€˜someā€™ of the issues of). Where if you program the ā€˜typesā€™ first you figure out how your data should be, then writing functions becomes writing simple transforms to transform data from one form into another, instead of in dynamically typed languages where you are thinking more about operations and less about data.

3 Likes

I have always found that databases frame how I think about data more than anything else.

Elixir and Erlang have entirely changed how I think about server side development though. Everything else just feels like doing it wrong now.

3 Likes

SQL has changed my mind, for sure. After for loops selecting data, and even after very modern Clipper, it was a game changer. Since Iā€™ve found SQL, I donā€™t have to think ā€œhow to retrieve my dataā€ anymore, but ā€œwhat I want to getā€.

Then it was heitml and PHP/FI. Since this, my brain does not think about HTML as a static thingy.

Then, Ruby has convinced me to think objective. It was not my first OO language, but it was Ruby who convinced me to think in OO.

Then, SML. My brain switched from OO, and it was a damn good switch.

Geez, Iā€™m old :wink:

5 Likes

Iā€™m not sure if this counts, but Elixir has made me change the way I think about myself.

Prior to coming to Elixir, I never thought of myself as a ā€˜Rails Developerā€™ (despite learning/reading quite a bit about Ruby and Rails) - I always thought of myself as more of a ā€˜Rails Userā€™ because it never really felt like I was architecting software; more like just putting blocks together. (Thatā€™s probably a little harsh but you know what I mean - and Iā€™m not knocking it, as a nube that was incredibly empowering.)

With Elixir I feel different, and although I havenā€™t actually made any Elixir apps yet, I think when I do, I will feel more like a software developer or a systems architect - because youā€™re not just putting your app together, but thinking about processes, when to spawn them, how they interact with each other, how data is passed between them, how state is dealt with etc; you have to think about and design the system as a whole.

I also love the way Elixir - and PragDave in particular - have shaped the way I think about software development - with making easy good principles and practises such as the Single Responsibility Principle, Microservices and the Replaceable Component Architecture. I know Iā€™ve said it before, but I really do think that Elixir making these things not just possible but ā€˜easyā€™ is going to be a huge selling point in the near future :003:

5 Likes

I wonder if thatā€™s not a symptom of Elixir being new to you. Maybe after more experience youā€™ll feel like youā€™re putting blocks together again? Only this time the blocks will be different (processes, genservers, etc) instead of requests, responses, middleware, etc. and thatā€™s a good thing, it means you underetand the components very well already and donā€™t get too caught up in the details.

3 Likes

Iā€™ll have to get back to you on that :lol:

2 Likes

I wouldnā€™t say that Elixir changes the way I think. The BEAM model of computation has always felt like the right thing to do for web applications. I just didnā€™t know it was possible. The stateless nature of the applications (request goes in, response comes out) pushed by most web frameworks Iā€™ve tried was a limitation I was quite happy to get rid of.

I think Iā€™ve written this already somewhere, but back when I used python, I had stateful ideas I wanted to try which again and again proved to be impossible inside the frameworks. I tried most of them (Django, Flask, Pyramid, Web2py, etc.), and not a single one of them allowed me to do what I want.

The workflow would be: 1) have an idea, 2) fail to implement the idea, and 3) read extensively about the idea 4) read a post by Armin Ronecher that advocated for running a nodejs server in parallel with the python app for websockets and praising the python frameworkā€™s limitations as a good thing (Iā€™m not kidding, although I canā€™t find the blog post now) 5) quit in frustration.

With Phoenix, it is: 1) think of an idea, 2) read the docs and 3) implement the idea. Goto next idea.

I understand that the BEAM is a one-trick-pony, but itā€™s great for orchestration and for moving data between processes (no nodejs server running besides my app! Yay!).

In conclusion, I donā€™t think Elixir has changed my mind significantly, but instead it seems to adapt to the way Iā€™ve always thought things should be done.

5 Likes

I mean, the BEAM and some goodies built on the BEAM like Phoenix channels and Phoenixā€™s PubSub system allow for much more exciting possibilities than what you can get with single threaded languages like Python (and I think Ruby too? Iā€™ve never used Rubyā€¦).

In no time you find yourself trying to implement real time notifications or collaborative editing and reading papers about Operational Transformation and CRDTs which are new and cool and experimental, but once someone builds a good library on top of the BEAM for that, itā€™s just a nee component you can plug into xD

(Offtopic: anyone here interested in real-time collaboration wants to port ShareDB into Elixir + Phoenix? The core is a couple of JS files on the backend and for the frontend one can build on top of Phonix channels)

4 Likes