Python or Ruby as an additional language


#1

This may be a long winded question, so please bear with me. I am asking this here, as this community is very friendly and from what I have seen very diverse.

I have been a Java developer working with Spring Web applications for the past few years (Before that Android). I fell in love with Elixir and started using it on the side. I decided knowing a scripting language may be useful so I checked out Python and Ruby. I preferred Python as I felt its paradigm was closer to C++ (Which I used prior to Java and love), and felt Ruby did not add anything that attracted me.

Anyway, despite my preference, I am constantly seeing opportunities for Elixir at places that previously used Ruby or still use Ruby/Rails and although I have used Rails, I find working with three languages the most my little mind can stretch, realistically. So, my question is therefore two fold - Do you think that we will see more python or java or php etc shops starting to adopt Elixir in the future or will Elixir be adopted primarily by Ruby shops for the forseable future? And also, given that my goal is to find work with Elixir - would Ruby be a necessity in getting employment, or python would have just the same effect?

I know people will say learn both/Drop Java - but I love Java, and also I like to keep my foot in the door of the enterprise world and Java allows me to do this :wink:
Thanks!

P.S. Notice I did not say if ruby is better than python etc, so please no language wars! :slight_smile:


#2

I wouldn’t suggest either Ruby or Python. I would go with a lower level language like C, Go, or Rust (my preferred).


#3

Rust is the most interesting I agree, however, I think by the time rust is commonly used - especially in any web specific capacity- Elixir will already have been adopted :slight_smile: Go just rubs me the wrong way for some reason…But I do see it being used in place of Node for small web services. I like C++, only use it for small command line things when I’m bored these days, but professionally I don’t see it used much in web start ups. (I know you said C but I prefer c++ personally).
Thanks!


#4

It’s not about learning something that’s going to turn mainstream fast. It’s about learning a new paradigm. Not only is it a low level compiled language, it has roots in ML. To take it a bit further, Rust is the goto when you want to call down into something native from Elixir as it provides memory guarantees that C can’t.

I just don’t see that learning python or ruby teaches you anything new that you haven’t already learned from Java.


#5

Both?

You can learn the basics of both of them easily enough. Learning Rails is beneficial just because of how many other languages have attempted to clone its methodology. That many Elixir shops come from Ruby is a bonus.

On the Python side, there are a lot of perks for math, statistics and machine learning.

I vote both. :slight_smile:


#6

I agree, you are probably right that rust will make me a better programmer. Maybe I shouldn’t be focusing on having ruby or python as if a company needed me to I could learn them quick enough to be productive quickly, as far as getting into companies that will be using Elixir, you think that learning Ruby to get a job that will transition to elixir is pointless?

Also, I watched a seminar on rustler which calls to rust from elixir which really seemed powerful.


#7

Yea maybe I was overthinking it, I really do not want to be an “expert” in either anyway. I suppose as long as I know them “enough” that should be fine. Thanks


#8

The similarity of Elixir with Ruby is only there on a superficial level (i.e. the syntax ‘at a glance’).
I’d say you might even be better off knowing Python, because Python already uses some more functional approaches to some of their ‘best practices’.

Also, the Zen of Python is a simple list of code writing rules that (intentionally or unintentionally?) Elixir and most of its common libraries seem to follow. :slight_smile:

As for Python vs Ruby: Python allows for about 3/4 of the (syntactic sugar-rich) manipulations that Ruby allows. Whether this means that ‘Ruby is more powerful’ or that ‘Python is more maintainable’ is a constant source of debate.

I wonder why you feel that Python is closer to C++ than Ruby in paradigm. Please elaborate :smiley: .

Learning an object-oriented (in the ‘everything is an object’ sense) language next to already knowing a class-oriented language (C++, Java) is definitely a great idea.

However, I have to agree with @jeramyRR that learning something radically different might expand your horizons more rigorously. If you already know C++ well, there’s no real need to learn C. But learning Rust definitely is a good idea.

Also, I’d like to share some love for Haskell here. If there’s a language that will restructure your programmatic thinking, it is Haskell :sunglasses: .


#9

Thanks for the reply!

When I say Python is closer to c++ in paradigm, it is a very superficial level - I Multi inheritance and not “Everything” is an object, whereas Ruby is built around being Pure OOP and Python is multiparadigm :slight_smile:

For growth I agree that Rust and Haskell seem like a good idea. Though haskell looks like I’ll have to knock off a summer to investigate :stuck_out_tongue_winking_eye:

But I was coming from the angle of getting employment that would lead to using Elixir, and I seem to see elixir jobs mostly coming from Ruby startups/shops that now occasionally use Elixir. And interestingly a lot of places that use python use Go…


#10

Also,

I had heard somewhere that Ruby compliments Java (although in reality I think Kotlin does), and Python compliments C++ so that probably was in my head when I put that.


#11

In Python, everything is an object just like in Ruby. All ‘multi-paradigm’ stuff is built on top of this base. It’s really nice that many OOP languages now include some functional aspects. It is definitely the case that Python embraces some functional aspects more than Ruby (having a delite form of for-comprehensions, for instance) but this is more by convention than by necessity.

Support for Multiple Inheritance definitely is one of the features that Python has which is missing from Ruby.

By the way: Objects are a poor man’s functions (and vice-versa).


#12

Did not know that! Great to know, thanks! :smile:


#13

Two of the most popular programming languages, especially first languages, are Ruby and Python. Ruby is used widely for websites such as Airbnb, Hulu, Kickstarter, and Github. Python is used for websites such as Google, YouTube, Spotify, and Quora.

Both languages came around in the mid-90s. Python actually predates Ruby by about four years. They both came around to address needs in the programming community, but the philosophies are different. They’re both object-oriented languages. They’re both dynamic. They both have a lot of different functionality. They’re very flexible languages.

You will often see in Ruby that there are multiple methods to solve the same problem and then in Python there’s only one approach. It’s a very philosophical difference. The thing that unites them is the goal to write clean, readable, concise code.

Check this link: https://www.coursereport.com/blog/ruby-vs-python-choosing-your-first-programming-language


#14

I don’t think this has been true since functional constructs were added to Python, except maybe solely on a philosophical level. van Rossum doesn’t like the functional aspects of Python, so he probably still considers there to be only one way to do things, but at this point there is realistically as many as in other languages.


#15

Glad to say I am happily using Elixir for work so no need to determine whether I should focus on python or ruby more, however, I ultimately favored ruby as the developer environment seemed a bit more modern and quick to get going (like I stated above, I came from java and if I wanted something as finicky as maven I would have stuck with java), and also spent a great deal of time with Kotlin and Clojure, both of which (particularly Clojure) I find superior to python and ruby - but to each there own. Thanks for everybody’s input.


#16

In my view van Rossum quarantined functional programming in functools.py so that at the very least it isn’t considered “canonical, core Python” (a slightly better fate to being forced into exile entirely).


#17

The sad truth is that while I think in general Python is better choice due to all the Data Science and AI/ML libs and the level of uptake, for now most Elixir jobs are in Ruby shops. If I had to pick 3 with long term view I’d say Elixir, Rust, Python (and JS/TS if web dev.)