pretty new to programming; why Ruby?

Hi all. I'm Devin. Some may know me from my various accounts scattered
across Mastodon, or a Gemini capsule or two. I've gotten into Python in the
past, but I love Ruby's Gem package manager. Being able to just update
everything is just so simple that it makes me wonder about the language and
community that spawns such correct (to me) user interfaces. For those that
haven't interacted with me, I'm 27 years old, from the Southern United
States. I'm also completely blind, using computers through screen reading
programs, like NVDA on Windows and Orca on Linux. I use VS Code or Emacs
(with Emacspeak) for my coding/writing environment.

My knowledge of Python doesn't really extend past the basics of
programming. I understand variables, numbers, strings, floats, assigning
variables, operators (although I love Python's "and" "or" and "not" rather
than Ruby's symbols which are hard for me to keep in mind. I can do
if/else/elif(elseif)? statements, simple functions with returns, and arrays
(lists). I've even created a program for work: <
Nextcloud>

So, a few things I've found about Ruby:

* Why in the world do we need gets.chomp? Why can't gets just automatically
remove newline characters by default, like Python's input function does?
* Ruby has one of its goals being ease of reading, but isn't things like &&
instead of "and" a little against that? Especially the ones for or and not.

So, my main questions are: Why did you all choose Ruby? What attracts you
to the language? What makes it special to you, and what is enjoyable about
it to you?

Devin Prater
r.d.t.prater@gmail.com

Welcome !

For me, the Ruby philosophy of 'programmer happiness' is really powerful.
Most of the things I envision I can do pretty well and usually I learn a
thing or two in the process. My top things about Ruby then :

1. programmer happiness
2. flexibility of syntax
3. elegance and expressiveness coming from #2
4. "principle of least astonishment"

You can do a lot of hot-reloading as well with tools like Guard and Listen,
so you don't have to re-run your app when you change a file. Here's an
article with some more personal opinions, scroll down halfway for the Ruby
centric portion ...
https://seanfelipe.github.io/automation/languages/ruby/java/javascript/simplicity/2020/05/20/automation-ruby.html

Cheers and welcome !

ps. In the past couple days we've had a bit of a kerfuffle on the mailing
list, but hopefully that will calm down. So if you see some back-and-forth,
know that at least in my experience, it's the exception and not the norm.

···

On Fri, Oct 1, 2021 at 1:34 PM Devin Prater <r.d.t.prater@gmail.com> wrote:

Hi all. I'm Devin. Some may know me from my various accounts scattered
across Mastodon, or a Gemini capsule or two. I've gotten into Python in the
past, but I love Ruby's Gem package manager. Being able to just update
everything is just so simple that it makes me wonder about the language and
community that spawns such correct (to me) user interfaces. For those that
haven't interacted with me, I'm 27 years old, from the Southern United
States. I'm also completely blind, using computers through screen reading
programs, like NVDA on Windows and Orca on Linux. I use VS Code or Emacs
(with Emacspeak) for my coding/writing environment.

My knowledge of Python doesn't really extend past the basics of
programming. I understand variables, numbers, strings, floats, assigning
variables, operators (although I love Python's "and" "or" and "not" rather
than Ruby's symbols which are hard for me to keep in mind. I can do
if/else/elif(elseif)? statements, simple functions with returns, and arrays
(lists). I've even created a program for work: <
https://cloud.alassist.us/s/ERFN2LM9xWRH5KK&gt;

So, a few things I've found about Ruby:

* Why in the world do we need gets.chomp? Why can't gets just
automatically remove newline characters by default, like Python's input
function does?
* Ruby has one of its goals being ease of reading, but isn't things like
&& instead of "and" a little against that? Especially the ones for or and
not.

So, my main questions are: Why did you all choose Ruby? What attracts you
to the language? What makes it special to you, and what is enjoyable about
it to you?

Devin Prater
r.d.t.prater@gmail.com

So, a few things I've found about Ruby:

* Ruby has one of its goals being ease of reading, but isn't things like &&
instead of "and" a little against that? Especially the ones for or and not.

Avdi has some good explanations of why "and" and "or" are different
than "&&" and "||". In short "and" and "or" are control flow operators
inherited from Perl (they are not boolean logic operators). Quoting Avdi:

  In Perl, they were largely used to modify control flow, similar
  to the if and unless statement modifiers. A common Perl idiom is:

  do_something() or die "It didn't work!";

So, my main questions are: Why did you all choose Ruby? What attracts you
to the language? What makes it special to you, and what is enjoyable about
it to you?

I can't point to anything specific; it was pretty much love at first sight.

···

On 10/1/21, Devin Prater <r.d.t.prater@gmail.com> wrote:

The only thing different about "and" vs "&&" is order of precedence.
Because "and" has such low precedence, it can be used for control flow.

But if you know your precedence, they're perfectly valid boolean operators.

···

On Fri, Oct 1, 2021 at 2:04 PM Frank J. Cameron <fjc@fastmail.net> wrote:

On 10/1/21, Devin Prater <r.d.t.prater@gmail.com> wrote:
> So, a few things I've found about Ruby:
>
> * Ruby has one of its goals being ease of reading, but isn't things like
&&
> instead of "and" a little against that? Especially the ones for or and
not.

Avdi has some good explanations of why "and" and "or" are different
than "&&" and "||". In short "and" and "or" are control flow operators
inherited from Perl (they are not boolean logic operators). Quoting Avdi:

        In Perl, they were largely used to modify control flow, similar
        to the if and unless statement modifiers. A common Perl idiom is:

        do_something() or die "It didn't work!";

Using “and” and “or” in Ruby - avdi.codes

And/Or - Graceful.Dev
https://www.rubytapas.com/2013/08/15/episode-125-and-or/

> So, my main questions are: Why did you all choose Ruby? What attracts you
> to the language? What makes it special to you, and what is enjoyable
about
> it to you?

I can't point to anything specific; it was pretty much love at first sight.

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

--

This message (including any attachment to this message) is confidential
and may contain information that is privileged or otherwise legally
protected from disclosure. If you are not the intended recipient or if this
message has been addressed to you in error, please delete it without saving
it and separately notify the sender. Thank you.

You can drive a screw with a hammer but the next person to work on the
job may not understand what you were doing. :wink:

I did slightly butcher Avdi when I trimmed for quoting. He was not
saying they *can't* be used for boolean logic (which my sloppy editing
implies) but that they *should not* be used for boolean logic because
the different precedence is confusing.

···

On 10/1/21, Veez Remsik <mremsik@weedmaps.com> wrote:

Avdi has some good explanations of why "and" and "or" are different
than "&&" and "||". In short "and" and "or" are control flow operators
inherited from Perl (they are not boolean logic operators). Quoting

The only thing different about "and" vs "&&" is order of precedence.
Because "and" has such low precedence, it can be used for control flow.

But if you know your precedence, they're perfectly valid boolean operators.

Hi all. I'm Devin. Some may know me from my various accounts scattered
across Mastodon, or a Gemini capsule or two. I've gotten into Python in the
past, but I love Ruby's Gem package manager. Being able to just update
everything is just so simple that it makes me wonder about the language and
community that spawns such correct (to me) user interfaces. For those that
haven't interacted with me, I'm 27 years old, from the Southern United
States. I'm also completely blind, using computers through screen reading
programs, like NVDA on Windows and Orca on Linux. I use VS Code or Emacs
(with Emacspeak) for my coding/writing environment.

Welcome to Ruby!

So, a few things I've found about Ruby:

* Why in the world do we need gets.chomp? Why can't gets just
automatically remove newline characters by default, like Python's input
function does?

I can only offer the generic reason: it is more modular. In some cases a
program might have to know whether the line terminator is \r, \r\n or \n
because that e.g. gives you a hint to the platform that created it. Often
also, it does not matter if you extract text from a line with a regex. Matz
could certainly answer that much better.

Kind regards

robert

···

On Fri, Oct 1, 2021 at 7:34 PM Devin Prater <r.d.t.prater@gmail.com> wrote:

--
[guy, jim, charlie, sho].each {|him| remember.him do |as, often| as.you_can
- without end}
http://blog.rubybestpractices.com/

I tried to build my open-source project Glimmer
(GitHub - AndyObtiva/glimmer: DSL Framework consisting of a DSL Engine and a Data-Binding Library used in Glimmer DSL for SWT (JRuby Desktop Development GUI Framework), Glimmer DSL for Opal (Pure Ruby Web GUI), Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development GUI Library), Glimmer DSL for Tk (Ruby Tk Desktop Development GUI Library), Glimmer DSL for GTK (Ruby-GNOME Desktop Development GUI Library), Glimmer DSL for XML (& HTML), and Glimmer DSL for CSS) in Python originally, but then
soon gave up. It is only possible with all its niceties in Ruby (every
other language forces awful compromises). 'Nuff Said!

···

On Sat, Oct 2, 2021 at 6:32 AM Robert Klemme <shortcutter@googlemail.com> wrote:

On Fri, Oct 1, 2021 at 7:34 PM Devin Prater <r.d.t.prater@gmail.com> wrote:

Hi all. I'm Devin. Some may know me from my various accounts scattered across Mastodon, or a Gemini capsule or two. I've gotten into Python in the past, but I love Ruby's Gem package manager. Being able to just update everything is just so simple that it makes me wonder about the language and community that spawns such correct (to me) user interfaces. For those that haven't interacted with me, I'm 27 years old, from the Southern United States. I'm also completely blind, using computers through screen reading programs, like NVDA on Windows and Orca on Linux. I use VS Code or Emacs (with Emacspeak) for my coding/writing environment.

Welcome to Ruby!

So, a few things I've found about Ruby:

* Why in the world do we need gets.chomp? Why can't gets just automatically remove newline characters by default, like Python's input function does?

I can only offer the generic reason: it is more modular. In some cases a program might have to know whether the line terminator is \r, \r\n or \n because that e.g. gives you a hint to the platform that created it. Often also, it does not matter if you extract text from a line with a regex. Matz could certainly answer that much better.

Kind regards

robert

--
[guy, jim, charlie, sho].each {|him| remember.him do |as, often| as.you_can - without end}
http://blog.rubybestpractices.com/

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

--
Andy Maleh

LinkedIn: Andy Maleh - Lexop | LinkedIn
Blog: http://andymaleh.blogspot.com
GitHub: http://www.github.com/AndyObtiva
Phone: 438-835-5602