What's the best coding language and why is it Ruby on Rails?

What's the best coding language and why is it Ruby on Rails?

Other urls found in this thread:

en.wikipedia.org/wiki/Strong_and_weak_typing#Variation_across_programming_languages
twitter.com/NSFWRedditGif

Ruby? If you are female, beginner and shitlord. Sure.

Let me answer your question with another question. Are you high?

Tha's not even a language, that's a framework. Ruby is the language.

Ruby is elegant unlike python. If you use any language with significant whitespace you are a faggot and python also doesn't have a real ternary operator which you probably dont deserve anyway. Enjoy your pep8 cucks.

It is λ-calculus.
Proving that λ-calculus is best coding language is trivial and left as exercise for reader.

...

...

Python has a real ternary operator. It just has a more friendly syntax. It's equally powerful.

Syntax matters, but it's not the most important language quality. What else makes Ruby more elegant?

...

- implicit returns
- no muh whitespace
- no muh one shitty way to do everything
- it's a superior Japanese language
- Rails is more popular than Django
- Elixir is based on Ruby and is superior to both Python and Ruby

assembly

Python's whitespace and Ruby's implicit return are syntax, being Japanese is irrelevant, the popularity of a particular framework doesn't make a language better or worse, and Elixir is based on Erlang, not Ruby.

Which leaves the "one way to do it" complaint. How is having many ways to do things elegant?

Syntax is the main form in which elegance manifests itself in a language. It is a superior Japanese forged language, folded thousands of times from the finest bits. Elixir's syntax is based on Ruby. It runs on the Erlang VM.

How is having freedoms stripped from you elegant?

C'mon, now you're just getting lazy.

bro!

It speaks volumes that only python dumbfucks fell for this thread

No, just dynamically typed. You know the difference, right?

Asking "what's the best programming language" is like asking "what's the best method of cleaning." you don't vacuum your car and wax your rug. Similarly you don't write an os in Python and design a gui in C.

If languages were cleaners, what would they be like?

C: One guy comes and scrubs everything furiously with a brush by hand as fast as he can but misses spots all over the place then trips and breaks your pottery. You kick him out of your house without payment.

Python: A van of 3rd world cleaners comes to your door. Gets the job done cheaply but takes a while to finish. You feel guilty for not doing any of the work yourself but it's so cheap that you can't resist.

Java: A team of 20 pajeets with 24/7 tech support. They manage a way to rig you a cleaning system out of mismatched PVC piping, nozzles, and a pump. It seems to work at first but after a while your apartment begins to reek of curry. You call tech support and they send out a technician, but even after 20 times, they were still unable to detect the problem. You never manage to get the smell out.

Ruby: Refuses to begin cleaning unless acknowledged by xyr correct pronouns. Posts to twitter about how they're a professional cleaner. Doesn't actually know how to clean and has never even touched a rag or mop.

Swift: A group of 4-5 faggots comes through your door, shits all over your carpet, then leaves.

A group of guys come in dragging some complex cleaning tools behind them. One of them takes the vacuum cleaner, extends it with a public static hose class, which is extended by the nozzle class. While he's busy fiddling with the attachments he forgets to plug it in, and an Oracle representative comes over to sue you for stealing their tech.

See above, but the cleaners are wearing fake moustaches. They actually turn the vacuum on and do a decent job, but they can only clean square rooms. An Oracle representative comes over to sue you for stealing their tech.

A group of guys come in, and they insist they're the best cleaners ever. While you're giving them instructions they keep trash talking the competition, and reminding you of how good they are. While you're away they realize they're in way over their heads, so they call in friends who call in friends to clean up. You get back and everything is clean, and the guys insist they did all the work.

One eccentric looking guy meets you and tells you he'll be able to get it done just fine. You come back later and everything is clean, but nobody knows what just happened.

You answer the door and this angry looking cleaner is there. He yells a greeting at you, and bellows how he knows how to do his job. He starts to clean but notices that your kitchen is misaligned, which causes him to have a nervous breakdown.

You tell him your kitchen counter is 2 meters long. He starts cleaning, but it turns out your counter is actually 1.9 meters long. He hits the wall and busts right through it, and complains he ran out of counter to clean.

He insists the mop is shit and reimplements it in Rust. He doesn't even clean, he just sits around telling you about how amazing this mop is, and how the C guy would never make something of this quality

The C guy comes back, but this time with friends. They rig up complicated equipment around your house to protect you from coming into contact with the C guy. However, they end up bringing in so much specialized equipment that you realize the house can clean itself. You wonder why the C guy bothered to show up at all.

A mathematician shows up at your house, promising to clean your house in a simple, logical, and fast manner. He divides your house in half, and cleans one half. He then subdivides the dirty half, and cleans half of that. He does this continually until the planck limit is reached, at which point he complains that they don't make houses like they used to.

A timid nerd shows up at your door. You're pretty certain that he doesn't know the first thing about cleaning houses. He does, however, know people who do know how to clean. He calls all of his friends to your house and gives them specific instructions on how to proceed. It works pretty well until it turns out that one of his friends doesn't have permission to enter the bathroom to clean it. He then goes home, but leaves all his friends in your living room.

Sure thing, buddy.

more like

that's not what strongly typed means you fucking redditor

That's still just dynamically typed.

The cleaning guy comes over, calls his friend who calls his friend who also calls his friend, and they clean your house inside out in reverse order. Then they realize they could just promise each other to clean one part of the house and do it much more efficiently.

A fat cleaner with a huge backpack comes into your house. He builds a factory with tools from his backpack that produces factories that produce the cleaning tools necessary. By the time all the tools are ready it's evening and the cleaner just trashes everything without asking.

The cleaner comes in the house, checks all your rooms, and just when he's about to start cleaning he realizes your carpet is of the wrong type and leaves.

You tell the cleaner your address, but the cleaner doesn't know what address is so he complains about not being able to find "address".
You tell the cleaner what to do, but he just parrots back what you said because you didn't say "

Even if the basic arithmetic/string operations are strongly typed, the language encourages weak typing of objects and their methods/functions. That's a pretty big deal for OO language. Just because it is possible to have strict type checking inside the functions doesn't mean that it's strongly typed language - just like C isn't OO language, even though you can write OO stuff in it.
[spoiler]>inb4 "some rubyfag blogposter's definition of strong typing, that was made up so that ruby matches it, proves me right"
Yeah right, and "black people can't be racist" too?[/spoiler]

A crazed coke head rails a line and starts scrubbing at every little piece of dirt with a toothpick. He finishes in a retardedly short amount of time.

You asked him to clean up your house, but cleaning your house would mean that he has to go inside. So he decides to demolish your house and build new, shittier version, of your house instead.

He does ok job and he makes sure that nothing breaks during the cleaning, but to get him to start you must agree to hire 'diverse' team of progressive, rainbow haired, marxist, transexual feminists who will shit on you for being white and/or male and/or not cucked enough while he does the cleaning.

If a Ruby function is written to work with a number and you pass it a string containing a number it'll probably generate an error because you use the "number" to do something you can't do with strings, won't it?

Javascript would implicitly convert it and wouldn't generate an error.

The page you took that definition from even calls Ruby a strongly typed language, and notes that it doesn't have static typing.
en.wikipedia.org/wiki/Strong_and_weak_typing#Variation_across_programming_languages

But I might just be assigning the objects variables and stuff. Then the program throws an exception in completely different place and I'll have no idea where the mistake happened. Again, if Ruby wasn't OO, you could dismiss it, but it is and typing of the object side of Ruby is just weak. If you want to write object oriented piece of code, fucking php(7) makes it easier and more intuitive to write it in a type-safe manner. You can call it shitty typing, if it calms your autism, I guess.

A group of cleaners claiming to be experts begin sweeping everything, including the carpets, counters, and ceiling. When you ask why they use the same tool for everything instead of a vacuum for the carpets, a sponge for the counters and so on, zey throw a fit about discrimination and storm off. The floors they were appearing to clean correctly didn't even get finished.
Despite nothing being finished or done correctly, you're billed for twice the work they should have done.

You don't know what typesafe means, or what strongly typed means.

retard

What would the Assembly cleaners be like?

...

What about C compilers?

You write a C program to clean your house. The compiler misinterprets you and sets your house on fire.

You tell the cleaner that you'll make him some coffee, but he tries to drink it before you've told him where it is. He then shits all over your floor and justifies it by saying you caused him to dereference a null pointer which is undefined behavior.

>language having property foo means all code in language has to have property foo
But that's wrong, you fucking retard. C is not OO, but some C code is. C is typesafe, but if you hide everything behind void pointers and reimplement stdlib functions to also use void pointers, your code won't be very typesafe - it would be stupid, but the point is that it can be done.
And if php makes it easier to write typesafe OO code than your language does, it's probably and a good indication that your language isn't very typesafe.

Doesn't most stuff just segfault when that happens nowadays?

That depends. Optimizers can do really ingenious things by assuming undefined behavior never happens, since if it does happen whatever the code they produced happens to do follows the standard.

The problem is not that it might try to use memory it isn't allowed to use, the problem is that it might do something else altogether.

Let's say you have a static function pointer (initialized to NULL) and a set() function which sets that function pointer to something useful. In the main function you would call set() and then call the function pointer.

If you forget to call set() the compiler may reason that since the pointer can only be NULL or the value set by set(), calling the function pointer before set() would be undefined behavior, and the function pointer will be called no matter what, so it might as well just apply set()'s effect at compile-time. The result is that you don't call set() but your program works anyway - until someone uses a different compiler, or a different optimization level, or a different version of your compiler, and it misses that particular optimization or handles it differently.

Even some seemingly much more innocent things are undefined, like the value of signed integer overflow.

I'm pretty sure it always involves some variant of feces.

nice double-dubs
On the other hand, he did not invent the null reference. The original implementation of Lisp used memory address 0 for NIL, and lists are terminated with NIL.
The undefined reference, on the other hand, that is probably the kind of thing that was introduced and which causes many more problems

php is not typesafe, Josh

No, but the code can be. How fucking dense are you? Language X =/= code in language X.

Can you please explain how that is possible?

Amateur.

They bring tons of cleaning equipment, but when then try to use them, it house ends up in a mess worse than before. An old dude yells at them and tell the cleaners to only use the "good tools". The house gets surprisingly clear and tidy after that.

You either is the nicest guy around being rewarded for your niceness, or a fucking topper.

I guess Null means that you can somewhat enforce types (specially after PHP 7).

function doSomething(int $a, string $b) : bool{ $x = (float) getValueFromSomewhere(); $c = (string) $a; return $c == $b;}

You can ensure that the parameters and return type are the correct type with type hinting, and that both $x and $c are initialized with their proper types, even if the language itself doesn't require that. Same thing with JS's overloading of the + operator; you can ensure that two variables are correctly added by using parseInt() on each, or concatenated by calling toString() on each.

It's ugly, but theoretically it can be done.