Why should someone who's interested in a scripting language learn Ruby over Python...

Why should someone who's interested in a scripting language learn Ruby over Python? My buddies are obsessed with it but can't give me more than emotional points for it.

Attached: pyvsrb.png (495x204, 43K)

Other urls found in this thread:

quora.com/What-is-one-example-of-a-lack-of-orthogonality-in-the-design-of-C
twitter.com/NSFWRedditGif

learn perl and python and you can automate everything.

because python has shit notation. Negation has to be done with the word "not". An exclamation point doesn't work.
Mainly ruby and python are aiming for different things: ruby is to give you as much flexibility as possible as a programmer to find a solution as quickly as possible, and python is designed to solve a problem in the most straight-forward, easiest to understand way.

try haskell

Do you have any other example of python's shit notation in mind? Saying that language's notation is shit because it uses not instead of ! is quite silly.

Whitespace

You seem predisposed to Python. Every single thing about Python, Ruby does better and more, except for perhaps, if you enjoy the enforced whitespace...

Ruby has many features that many people haven't seen before, and thusly gets promptly dismissed. I say it's definitely worth trying to learn it for real, you'll enjoy it.

python is more popular, more libraries etc...
ruby is more beautiful
/thread

I'm definitely not predisposed, I ask because before I get into one I just wanted some outside opinions. My bad if it came off that way. I'm taking both into consideration and heavily leaning towards it at this point. Especially considering rails on top of it.

Is there any reason for learning bash when there's python? Only reason I can think of is that you can always assume that bash is installed

Handling external commands is much much more convenient in bash.

I've just started learning programming in my own time after I found out college is a sham

is it worth learning this over python?

If you have a hardon for that kind of thing, Ruby does a single paradigm rather well, whereas Python is a really half-assed attempt at implementing multiparadigm.

Ironically, this almost killed Ruby, since only multiparadigm languages, no matter how shitty they are implemented, can thrive.
Similar to general programming languages. There is always that use case where you need a real programming language, so DSLs better can be avoided (think regex, xpath) or they are on life support rather quick (think XSLT, that shitty DSL your scientific institute replaced with Python or R).

ruby is a fine language but the thing is python is a way better language simply because it's everywhere and everybody uses it

it's fine to learn both but if you are a programmer you should know python

yea not the perfect language but actually nothing is, python is good enough and it's fucking everywhere

You haven't had the pleasure of reading the shit ruby my coworkers write. Goddamnit Jonny stop committing your pry bindings and learn to use git. For what reason are you possibly using this gem for? Symbols, symbols everywhere, endless paint shedding about the readability of conditional statements.

I currently work in C# and was looking at these 2 for dicking around. Maybe some scraping and other bs. Thoughts?

Attached: bok.jpg (576x463, 40K)

They both do just fine, when dicking around with new technology(to me) I pick the one with the best supported library or documentation. Sometimes it's Ruby,sometimes it's Python.

>poor lambda/user function support
>whitespace handling (line continuations are ugly)
>no variable initialisation
python also breaks its "one way to do things" pretty often like with string formatting

i've never used ruby though so i can only say stuff about python and perl

program for bourne shell but dont program for bash; bash is really bloated and not suitable for scripting. other bourne shells (mksh is the one i use) have support for a lot of common bashisms but not everything

Ruby appeals to the brainlet because rubies and gems in general = riches

>Ruby appeals to the brainlet because rubies and gems in general = riches

>python doesn't have !
Patently fucking false. You can replace not with ! as much as you want. Have you ever even seen Python?
Code is unreadable without white space and Python enforces it. Literally nothing wrong with this.
What the fuck are you on? Anonymous functions and lambdas are supported perfectly in aPython, it's white space handling is fine and who gives a fuck about variable initialization? It's completely pointless in the language.

You guys are jokes who don't know shit. Everyone in this thread kys

>no variable initialisation
the most important point, but not a syntax issue

that said, Ruby lacks this as well.
At least, even shit tier garbage like Perl, JS and VBA have this opt-in.

> scripting language
Haskell compiles to an executable. OP is asking about languages that depend on a run-time environment (scripts)

Only advantage I can see over Python is that Ruby lets you use Rails. Even though Django is basically the same idea, Rails has a larger user base, a useful CLI, and a much better ORM. Plus you don't have to deal with the Python 2 vs Python 3 bullshit, although that's becoming less of an issue nowadays.

Python is still way better than Ruby for just about any other use case though.

just learn both brainlet, what the fuck

>I don't have a job so I just play around with random languages all day why do you have a job you cuck

this applies to the entire board when engaging in programming language wars. i'm guessing this is only a thing among beginners, there's no way professionals in the area that have been around for a while fight for trivial shit like this.

You can learn both in a week.

>brains too small to learn two simple programming languages to compare them.

>Anonymous functions and lambdas are supported perfectly
lambdas are expressions in python, not blocks. all the other decent languages i know about support multiple statements in anonymous functions

Ruby is much more object oriented since everything is a method. What do you prefer

a = []
len(a)


or

a = []
a.length

Or even worst:

[1,2,3,4].join("")


"".join([str(x) for x in [1,2,3,4]])


Also, everybody knows that Rails >>> Django and Gems >>> Pip

So is Python:
a.__len__()


>[1,2,3,4].join("")
implicit type conversions are cancer
and putting a string function into a list doesn't make much sense

Not him. But Haskell code can be run as a script.

Ruby has native support for functional-esque programming style while Python doesn't really like the functional programming style.
Ruby has more gimmicks under the hood (i.e. "call/cc").
Ruby is more consistent ("principle of least surprise").
Ruby is more elegant (you thow lambdas left and right without even noticing).
Ruby is top-down while python is bottom-up (Ruby: big objects with many methods; Python: wrap function arround functions arround functions arround functions..).
Ruby is grorious dai-nippon, Python is fucking belgium (enjoy your chocolate-beer, faggot).


Gems >>> Pip.

But Djano is more minimalisitc than Rails (this is a plus).
Rails is all fun and games for a small CRUD app. But god be with you if you do something really big and need to refactor..
>Uhm, did I put this into the modell? Or the Controller? No wait, I made a custom helper for this, didn't I..?

Dutch not Belgian
Tall Chads > Nip beta manlets

>a.__len__()
You always should avoid calling a magic method. Also, if you call __len__() you're never sure of what this abomination will return, since this method can be overridden by anything.

Also
> implicit type conversions are cancer

you're clearly a brainlet if you can't evaluate the type of a variable on compilation time when you're reading code, you probably never wrote a compiler either.

Also

> and putting a string function into a list doesn't make much sense

You're really dumb for this board, GTFO. I didn't put a string into a function, it's a method from an object instantiated from a class List. Of course it makes sense, it simply states that for that particular object list, I wanna join the elements, such that every element will be joined by no space, a string will be returned.

What the hell is wrong with that?

Attached: 220px-Matz.jpg (220x282, 18K)

desu the only reason to use Ruby over Python is if you're stuck at a place using Rails. Nobody and no company should actually choose Ruby over Python for anything new

>2018
>Using dynamic interpreted languages

> Rails is all fun and games for a small CRUD app. But god be with you if you do something really big and need to refactor..

Do you realize that Rails can be set up as an API Server for RESTFul applications and scales much much better than any of these frameworks today??

Also

>Uhm, did I put this into the modell? Or the Controller? No wait, I made a custom helper for this, didn't I..?

MVC is not the only architectural model on software engineering, you can always use MVVM, like a view being stored on the database like a JSON and being deployed on time directly at the interface.

You're moving the goal post.
It's still OOP. All len does is call the __len__ method.

>you're never sure of what this abomination will return, since this method can be overridden by anything.
That's rich coming from a Ruby "I

>Ruby is top-down while python is bottom-up (Ruby: big objects with many methods; Python: wrap function arround functions arround functions arround functions..).
That's no fucking problem kiddo, since most real applications use a two level cache that stores the most instantiated objects on memory.

>It's still OOP. All len does is call the __len__ method.
Yes, but what does __len__ will do? It's a mistery until it's executed, since it's evaluated at runtime.

> That's rich coming from a Ruby "I

Attached: maxresdefault.jpg (1280x720, 75K)

> Code is unreadable without white space and Python enforces it. Literally nothing wrong with this.

Until your code fails to run due to invisible characters (spaces vs tabs).

>Yes, but what does __len__ will do? It's a mistery until it's executed, since it's evaluated at runtime.
Of course it is. Ruby lists aren't static array either.
Making length an attribute is retarded since there are many data structures that don't store their length.

>Metaprogramming is one of the blessings that Ruby has finally made right after C++, Java and Python failed altogether.
What are you on about now? You complained about overriding len, the same thing you can do in Ruby.

You can compile Python to an executable.

>Making length an attribute is retarded since there are many data structures that don't store their length.
And it's no problem since you can check if the object you call a method have that method, i.e: you call foo.methods and a list of methods from that objects will be returned, if your method is there you call it, if not, just don't, and this is of course possible due to metaprogramming.

>What are you on about now? You complained about overriding len, the same thing you can do in Ruby.

I wasn't complaining about overriding len(), I was complaining about the lack of orthogonality on Python as a programming language, i.e: a paradigm is adopted but a lot of exceptions exist for some cases, Python have a lot of little rules to follow with a lot of exceptions from theirs to the point they are itself useless. If you're confused about orthogonality, check this example of lack of orthogonality at Quora:

quora.com/What-is-one-example-of-a-lack-of-orthogonality-in-the-design-of-C

>And it's no problem since you can check if the object you call a method have that method
You're missing the point. I still want a length method for such data structures. Making it a method allows for it be clear and consistent across all such data structures.
>and a list of methods from that objects will be returned
You can do the same in Python.

>I wasn't complaining about overriding len(),
Now you're just straight up lying.
You literally were complaining about "this method can be overridden by anything."

I have always used python. Python 2 is what i prefer. It makes more sense to me. Tho I have barely touched Ruby to be perfectly honest.

> You're missing the point. I still want a length method for such data structures. Making it a method allows for it be clear and consistent across all such data structures.

oh really, what is the meaning of length in a Enumerable in Ruby since it has no garantee of having length (i.e: it can be infinite)?

> You can do the same in Python.
Sure, in a very clumsy way. What's your point tough?

> You literally were complaining about "this method can be overridden by anything."

Mfw user can't even interpret a text.

Try Ruby, it's an awesome experience, specially with the syntactic sugar thing.

Ruby has the cleanest syntax ever. Even the names of built-in methods are well picked and intuitive to read. Thats in sharp contrast to all of Python's built in underscore methods which look like shit. And when you add a (needless) explicit self parameter for all method/functions and a colon at every line break you really have to wonder what Guido was smoking when he designed Python. Object scoping is a lot tighter in Ruby which means there is always one way to do something compared to Python where you have to look up the 'pythonic' way as Python really has no unified object design.

I wish someone would make a fork of Ruby that had whitespace delimiting syntax, maybe someone could make an editor plugin that hides end delimiters, then Ruby would be exceedingly clean to look at.

Pip is an aboslute shit show compared to Ruby gems Just Werks.

>Making length an attribute
Length is a method, there is no such thing as an attribute in Ruby.

My nigga

>oh really, what is the meaning of length in a Enumerable in Ruby since it has no garantee of having length (i.e: it can be infinite)?
What does that have to do with anything?

>Sure, in a very clumsy way.
What's clumsy about it?
>What's your point tough?
What's yours?

>Mfw user can't even interpret a text.
>no face
Please tell me how to interpret it in a way that makes you not look like a retard.

Then what's that other guy on about?

Ruby is a meme with a few gimmicky features

Python however is pretty much the standard scripting language everyone uses. Libraries for everything, decent language, etc. Everyone should know Python.

>ruby is to give you as much flexibility as possible as a programmer to find a solution as quickly as possible, and python is designed to solve a problem in the most straight-forward, easiest to understand way.

Seems like an interesting to sum it up. I'll stick with python and django, rails is to hard to debug

>Django
It does not generate a scafold for you like rails does. And why the fuck do I have to make a folder for my html and css myself, django should know that will be used, its a fucking web project after all.

>X is a meme language
>just use what everyone else uses
every programming thread

> What does that have to do with anything?
He said at that he wanted a method length that made sense for every data structure in the book. Which simply doesn't make sense at all. The Enumerable example corroborates my argument at .> What's clumsy about it?

Because dir() returns not only the methods but a bunch of other things like variables and functions at the target scope. Ruby have a clear distinction for this kind of stuff.

>What's your point tough?

Ruby is much more orthogonal than Python, and also does OOP and FP better.


> Please tell me how to interpret it in a way that makes you not look like a retard.

I can't cure your down syndrome


>Then what's that other guy on about?
He doesn't know what he is talking about.

if anyone would like to email me about this discussion after the thread gets archived, here's my email:

[email protected]

Ruby: Japan, anime, elegance, art, poetry, artisan
Python: armpit sweat, fat nerds, neckbeard, (((science)))

Your pick OP!

>he wanted a method length that made sense for every data structure in the book
"all _such_ data structures"

>Because dir() returns not only the methods but a bunch of other things like variables and functions at the target scope
So what? The name is enough in this case.

>Ruby is much more orthogonal than Python, and also does OOP and FP better.
Because it bloats up objects more with rarely useful methods?

>I can't cure your down syndrome
You could just admit that you're full of shit.