I have seen this kind of questions asked over and over about (insert
language here).
I programmed (as a career) for almost 40 years. I did very little with
html. I did a lot of programming. Sometimes for the web (back end stuff,
not front end stuff).
Any general purpose language can be used for the web, usually with some
kind of web frameworks. But the language is built for and usually used for
anything but the web.
It all depends upon need. For instance, I built a mongo db database to
keep track of my movies and books. Ever gone to the store, and got a movie
or book, that when you got it home, you already had? I have many times, and
I got tired of it. So I wrote a databases for my movies and books, I add
books to it that I want to read (I sort by series and number of book in
that series - so I know which book I need next, and I list the movies I
have bought (> 500). I used ruby to add, delete, and modify my books and
movies. I used python (just another language, I could have used ruby, but
did that a long time ago), to webify the database, so when I go to the
store, I can see if I have it or not, or pick up the next book in the
series I am reading. Etc.
I have used ruby and python to program the raspberry pi. I used a $2 board
that takes signals to make a stepper motor work. I wrote it in python
first, then ruby to compare.
I like doing stuff, even in retirement.
So you ask, can I use (language) to do something besides the web? Of
course, you can! What do you want to do? Think about something you'd like
to automate, then do it.
Jerry
Jerry
--
Extra Ham Operator: K7AZJ
Registered Linux User: 275424
Raspberry Pi and Arduino developer
*The most exciting phrase to hear in science - the one that heralds new
discoveries - is not "Eureka!" but "That's funny...".*- Isaac. Asimov
*I*
*f you give someone a program, you will frustrate them for a day; if you
teach them how to program, you will frustrate them for a lifetime. *-
Anonymous
*If writing good code requires very little comments, then writing really
excellent code requires no comments at all!*- Ken Thompson
On Mon, Aug 10, 2015 at 7:05 AM, Dave Aronson < > ruby-talk.list.2.TRex@codosaur.us> wrote:
On Mon, Aug 10, 2015 at 4:46 AM, Boris <sata@mail.bg> wrote:
> Is Ruby useful for some jobs(projects) without rails? For which ones?
Yes indeed! Ruby came out in 1993 -- but Rails wasn't released until
2004. Meanwhile it had been used as a general scripting language, and
for all I know there may have been some other web frameworks for it
before Rails. Nowadays Ruby is also very popular in the DevOps field,
with tools like Chef and Puppet.
> Some folks say that ruby is so easy - most easy language to learn. Ok
it is
> but what do you say about some concepts as blocks and yield?
All languages have some concepts that are more advanced than others.
*Using* methods that accept blocks is quite natural. When you do
something like:
3.times do { puts "hello world" }
you are using a block (fed to Fixnum#times). No big deal; the main
gotcha is to remember that any variables defined within the block do
not carry their definitions over to the next iteration (if any).
*Writing* methods that accept blocks (using yield) is a more advanced
topic.
> I learned not a
> bit a html, css, jquery and js, rails and it seems that a JS is not so
> tough as ruby in some concepts. What is your opinion?
The basics of the language itself, no problem. Any idiot can learn JS
just by copying from other people's web pages, and a look at the web
will show that millions of idiots have indeed done so.
But enough to do anything significant? You'll probably need to use
asynchronous techniques and therefore keep track of what is "this"
(the current object) at all times. That's not JS's fault, but it
doesn't really do much to make that easy, or remember the need. Some
of that can be alleviated by using CoffeeScript, though many people
find significant indentation weird too.
Then there's the
weirdness of prototypal inheritance, but if you're not already used to
the "normal" way, that might not be so bad.
Even aside from strange concepts (which are often deliberate or even
good; see Scala or Erlang for great examples), there are the gotchas.
All languages have gotchas. I've even put together a collection of a
couple dozen of Ruby's, at http://bit.ly/RubyGotchas . But JS has
much worse and less-avoidable gotchas. Here's just one easily visible
sample. Try this in your browser's JS console:
[1,2,3,4,5,6,7,8,9,10].sort()
How often do *you* depend on an array of numbers being sorted
correctly, or other such simple operations that JS gets so terribly
wrong? Do you want to have to remember to adjust for this insanity
every time you do something so common and basic? See
Wat for more ways in which JS
often makes no sense at all. There are reasons why "JavaScript: The
Good Parts" is *so much* thinner, at a mere 176 pages, than
"JavaScript: The Definitive Guide", at 1096 pages. (And there are
reasons why I'm much more of a back-end dev than front-end.)
> One more question.
Please start new discussions for new questions. It helps ensure that
the subject matches the Subject, if you get what I mean.
> How to improve my ruby skills when I already read a few
> books
Practice practice practice. Pick an idea and do it. Pick an open
source project and contribute. Check out Code Katas
(http://codekata.com/\) and do them (that's one of the main things I
did early on).
-Dave
--
Dave Aronson, consulting software developer of Codosaur.us,
PullRequestRoulette.com, Blog.Codosaur.us, and Dare2XL.com.