nodemodule
Hi, I’m having trouble deciding on whether to use Elixir as my main programming language for building web apps which usually won’t involve much of a need for concurrency.
I would prefer a language that is fun, productive, and that is easy to scale. Elixir seems to check all these boxes better than any other language out there but there’s just one thing that’s holding me back.
I would prefer to use an OOP language in order to further my OOP skills in case I want to land a job or build a team (both easier with OOP).
I’ve been learning Elixir for a few weeks now and it seems to be mostly functional from what I’ve learned but I’ve also read about how it’s (arguably) The Most Object-Oriented Language.
The object oriented nature of Elixir appears to mostly be related to the fact that all Elixir code runs inside of isolated processes which communicate via messages. So it appears to be functional on the dev side of things and OOP on the runtime (correct me if I’m wrong).
Should I be concerned about using a Functional language for most of my work? I read so many developers on Quora saying that OOP is the only way to go for building apps and that Functional programming is awful for real world applications. Perhaps they are confusing impure functional languages like Elixir and Clojure with a pure functional language like Haskell, not sure. Elixir does appear to be a lot more useful for building non-trivial web apps than other functional languages so I’m kind of confused as to what I should do.
The only other languages which are meeting my criteria are TypeScript, Go, and Python. I find Elixir to be more fun than those three but Python is harder to scale than Elixir from what I’ve heard.
What would you do in this situation?
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixir-ls
- #ai
- #elixirconf-us
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
Cochonours
I’ve not been using Elixir for a long enough time to have a thorough answer to your questions, but if the only other languages you are ready to use for web apps are Go and Python, then it’s a no brainer : use Elixir.
If you want more OOP and an nice yet enterprisey language, then I’d advise C#. I used to enjoy working with that for a big intranet website.
Eiji
Elixiris fully functional, but it’s possible to create aOOP-like API. For a good example check this library:Since it’s more like than actually
OOPit probably does not have any compiler optimizations which are typical forOOPlanguages. Of course there are also probably used other optimizations, but only for functional programming (Erlang/vm optimizations).In short
Elixiris based onErlangwhich usedBEAM(virtual machine). This allows to create your own processes (inBEAM) even if you have started app once. Processes inBEAMare much more lightweight than OS processes which means you one app can easily create thousands and even more processes (again inBEAMVM). Each process can store its data which can be modified, but …In
OOPlanguages you are working on exactly same data. InElixiryou are working on data copies. So when you change data you are actually getting its modified copy rather than modified data itself (it matters in memory). What process is doing is basically replacing old data with its modified copy.Of course such code would not work - it’s just to visualize how its working inside.
For more information take a look at:
Especially in
Advancedgroup you have some info about concurrency.nodemodule
Thanks for the reply. I just now edited my answer as I forgot to add TypeScript to the languages that meet my criteria. I actually have used C# a bit and I think it’s a great language but I wanted something a bit more light weight than Java and C#. Also, I would only want to use servers with Linux which cancels the idea of C# since .Net Core isn’t anywhere close to where it needs to be for me to consider using it yet.
nodemodule
I’ve seen that OOP library before and the associated talk he gave and I thought he was just trolling so I didn’t consider using it. It does look interesting though if only food for thought.
Also, thanks for sharing those actor model resources. They really helped me gain a deeper understanding of the Actor Model and how useful and awesome it is. I’m going to continue learning Elixir and I’ll try to learn more by building out an app. I don’t have any previous experience with a functional language so Elixir has been a bit of a puzzle to me but it’s quite interesting and fun and I’m starting to get how it all works.
Eiji
Well … it’s similar change like
WindowstoLinuxwith “weird console”. It’s definitely change of habits, but you would find it really easy to learn soon. Comparing to other languages you do not need to go around to solve specific problem, because lots of really helpful core functions and libraries. Also documentation looks best for me here. There is almost no magic here. EvenPhoenixwhich is considered to beframeworkis basically just typical library with some easy to understand meta-programming (__using__/1macro anduse …calls).I don’t believe that we have “trolls” in our community. To be honest
Elixircould look like onion …which then could be similar to ogres:
but … I don’t believe there are “trolls” here, because we have really nice and kind community (thanks to our forum supervisors).
For sure, by “trolls” I mean people which could confuse others about how Elixir is working. One time I tried to troll some people, but it was more just for 1st April (which at end I said about) and it was intended to force think why it gives error rather than confuse newbies.
sanswork
Short answer: If you enjoy it.
Longer answer: It doesn’t sound like you actually need any language specific features for what you’re doing so try each of your candidates for a bit and see which you enjoy most and go with that. If you’re specifically looking to learn something that will lead to a job then check local job ads to see what companies near you are using most and learn that.
peerreynders
Sounds like you’ve already made up your mind.
Thinking Outside the Synchronisation Quadrant - Kevlin Henney [ACCU 2017]
When you are only used to manipulating the flow of control and mutating values in place with statements then it can be a bit difficult to get into the mindset of transforming data and controlling the flow of data with expressions instead.
Whichever way you turn, know what you are getting into.
https://forum.elixirforum.com/t/elixir-from-java-guy-perspective/3373
adrianrl
.NET Core is cross-platform, I write ASP.NET Core apps on Arch Linux, just install dotnet, mono and MSBuild and you’re ready to go. It doesn’t have as good tooling as in Windows, but still enough for serious development.
Read a PHP forum and they’ll still say PHP is cool lol. /jk
Nowadays almost every programming language implements functional features like keywords or libraries that mimics some behaviors. I’d say functional programming is trending topic right now, as it makes code more concise, and helps the programmer by reducing side-effects.
Either Elixir or C# are really good options for web development.
Spoiler
PHP too, but don’t say it to anyone.
Cruz
Elixir is a great language for Web Development, and it would be my choice if everything else was equal. That said, it’s not an OO language, and try to use it like that will have you fighting against its strengths.
Have you thought about Ruby (and Rails)? It’s an object-oriented language with a syntax similar to Elixir. Actually, it’s really the other way around but that’s another story.
Ruby doesn’t scale as well as Elixir, but neither does Go or Phyton. A lot of Elixir developers (including its author) were Ruby developers first. The end result is that you can find lots of tutorials and examples that help you with the transition. Also, the new version of Ruby supposed to improve performance and scalability.
I understand Rails makes it a breeze to get a new app up and running. If you learn both languages, you could use Ruby for rapid prototyping, and Elixir for the real system. Or, even use Ruby in production until you really need to bring Elixir into the picture.
Whatever you decide to do, choose a language that you enjoy working with. Good luck
felideon
A web app, by nature, is highly concurrent. Sure, you may not need to write your own concurrent code in your application. But by using e.g. Phoenix you would be reaping the benefits of Elixir’s concurrency, whether you realize it at first or not.
I would echo this important point.