Is Ruby's Decline In Popularity Permanent? (computerworld.com.au)
An anonymous reader quotes Computerworld:
Ruby has had a reputation as a user-friendly language for building web applications. But its slippage in this month's RedMonk Programming Language Rankings has raised questions about where exactly the language stands among developers these days. The twice-yearly RedMonk index ranked Ruby at eighth, the lowest position ever for the language. "Swift and now Kotlin are the obvious choices for native mobile development. Go, Rust, and others are clearer modern choices for infrastructure," said RedMonk analyst Stephen O'Grady. "The web, meanwhile, where Ruby really made its mark with Rails, is now an aggressively competitive and crowded field." Although O'Grady noted that Ruby remains "tremendously popular," participants on sites such as Hacker News and Quora have increasingly questioned whether Ruby is dying. In the Redmonk rankings, Ruby peaked at fourth place in 2013, reinforcing the perception it is in decline, if a slow one.
Perl and Ruby are dead. C, Java, C#, Python, and Javascript are humming along nicely. Not sure what your point was supposed to be.
Ruby is 20+ years old. I wouldn't call that a fad language. Heck, I'm old enough to remember when people said the same thing about C and Perl relative to FORTRAN, PL/I, and COBOL.
It's such a shame too because Ruby is nicer and more regular than Python. Everything Python tries to do Ruby does better.
:breed :name
For example:
# run some other program using the shell and get its stdout
# ruby:
out = `ls -al | foo -a -b | grep -i bar`
# python:
from subprocess import call
call(["ls", "-l"])
# string length, toString etc.
# ruby
puts '10'.to_i.to_s
# python
print (string (int ('10')))
# classes
# ruby
class Dog
# getters and setters implemented with one line if that's your style
attr_accessor
# constructor: notice no stupid __double_underscores__
def initialize(breed, name)
# Instance variables are denoted with the @ sigil
@breed = breed
@name = name
end
def bark
puts 'Ruff! Ruff!'
end
def display
# string interpolation like a civilized scripting language
# note that parenthesis are semi-optional in ruby
puts "I am of #{@breed} breed and my name is #{@name}"
end
end
# python
# note the repetitive and pedantic use of self everywhere
class Dog ():
# note the hacky __double_underscores__ necessary to prevent name collision for the class' constructor
def __init__ (self, breed, name):
self.breed = breed
self.name = name
def bark (self):
print ("Ruff! Ruff!")
def display (self):
# lack of proper string interpolation makes this clunky and tedious
print ("I am of {breed} breed and my name is {name}".format(breed=self.breed, name=self.name))