Totally lost in learning Ruby

Hi Mike,
The first time I completed the book, then got stuck trying to understand
what, where and how to use some of the recommended programs, such as
YMAL, SQL etc. For example, beside practicing and following all he
written guide, there was no reference as to how to start assembling a
database.

In terms of why Ruby? I put sent out an email SOS to the Open Source
community, and it was unanimous that Ruby is the way to go. What do you
suggest.

In terms of usability. I eventually hope to market it with the intention
of providing for non-for-profit causes, such as a)micro-financing Third
World nations b) provide measurable answers to the improvement of US\any
secondary educational facilities. My experience has shown where private
consultants have been raping scarce financial resources from budgets,
and their decision have kept adding to, in my case(USA),low performance,
thus educational frustration.

So if you next question is why not pay someone to develop such a
program, the answer is: I don’t have the money, and secondly, in the
past some of my trusted colleagues with vast programming knowledge have
been a disappointment.

Therefore i figured that my best route would be to ask the Open Source
community for help.

On Sunday, January 23, 2011 10:24:37 am Phillip G. wrote:

On Sun, Jan 23, 2011 at 3:07 PM, Hilary B. [email protected]
wrote:

Thanks a $llion for responding. Based on your response, where do I
start? Is there a specific HTML guide?. What is CSS and which one or
version should I use? And I guess the same applies to HTTP and
JavaScript.

There’s dozens of HTML, CSS, and JavaScript guides out there, but a
good starting point to learn HTML, CSS and JavaScript is
w3schools.com.

Probably a good starting point.

Later on, though… For CSS, I seem to always end up on A List Apart
when I
have a particularly hard problem. For JavaScript, you’d eventually want
to
read Douglas Crockford’s stuff:

http://javascript.crockford.com/

I agree that w3schools is a good place to start, though.

  • CSS makes a site pretty.

More specifically, it makes a site look the way you want it to.

You don’t really need to learn HTTP (fortunately): If you decide on a
web-based solution, your webserver will take care of that. At most,
deal with error codes, of which you need to know 3:
404: Site not found.
500: Internal Server Error (a catch all, meaning that something in
your webserver went wrong).
200: The client request could be processed.

Those 3 are important to troubleshoot an application.

I think the main concepts here are what HTTP is, what a status code is,
what
HTTP headers are, and what an HTTP method is:

http://tomayko.com/writings/rest-to-my-wife

Once you have that, the details of how these things are actually
implemented
may not matter much – I have only rarely felt the need to speak HTTP
directly
– but it’s good to at least have some idea of what it is:

Also: Web servers, database servers, HTTP stuff etc. is more the
domain of a system administrator.

Probably. Hopefully. It may even be completely eliminated, depending on
what
you deploy to:

http://code.google.com/p/appengine-jruby/

Or of course, when you’re just starting out developing Rails, the
default
setup will give you a little SQLite database, and you can get by while
knowing
very little.

But, for example, I never felt I really needed to know how to set up a
database server, but ORMs are the leakiest of abstractions. If I was
building
something on top of a SQL database, I needed to know at least enough
about SQL
to have an intuition of which operations will be fast and which will be
slow,
how I should store my data based on what I need to do with it, and
occasionally there’s no getting around writing a manual SQL query to
optimize
something.

Well, you need two tools to develop Ruby applications: A texteditor,
and Ruby itself. Everything else is gravy. :wink:

I’d also cite Rubygems as a necessity, but yes, that’s about it.

For web stuff, it helps to have a number of browsers installed, to see
if your markup code and JavaScript work as you think they should.

In particular, probably Google Chrome or Firefox with Firebug, at least.
The
ability to right-click and “inspect element” is very helpful for
figuring
out what’s actually going on with a page.

However, if you can find a web designer, they’ll happily do that for
you, or grab a template for HTML and CSS off of a website, like
oswd.org or opensourcetemplates.org .

In my experience, web designers have been terrible with JavaScript and
only
tolerable with HTML and CSS.

Searching the web for “ Ruby library” usually helps, as
does taking a look at http://ruby-toolbox.com/

I also find a search on rubygems.org helps a lot.

While all of this seems like a lot, you can divide this with ease into
several steps:

  • Learn Ruby and Rails (or another web framework, like Sinatra)

Learn Ruby first.

I would also argue that some amount of HTML and CSS should come before
Rails,
for more or less the same reason that Ruby should come through Rails. I
don’t
agree with everything Joel says, but this part is important:

“The law of leaky abstractions means that whenever somebody comes up
with a
wizzy new code-generation tool that is supposed to make us all ever-so-
efficient, you hear a lot of people saying “learn how to do it manually
first,
then use the wizzy tool to save time.” Code generation tools which
pretend to
abstract out something, like all abstractions, leak, and the only way to
deal
with the leaks competently is to learn about how the abstractions work
and
what they are abstracting. So the abstractions save us time working, but
they
don’t save us time learning.”

Especially that last part. Rails saves you time working, but I don’t
think it
should be used to save you time learning. Otherwise, when stuff breaks
(and it
will), you’ll have a much harder time figuring out what’s actually
going on.

Hilary

Best of luck. If you haven’t programmed in anything else then I guess
Ruby is a perfectly reasonable choice.

I am building sites probably much of the same size as your target. I
have a team of six seasoned web developers, an agency that produces
styling, a DBA, UI designers, all sorts of infrastructure people who
build the environments, and others. It still takes many, many months to
produce a site. If it seems like a mountain to climb, that’s because it
is.

hi all
one point is being made here that open source means no owners
no-one really helps this person they all just chat and remark

there are no active groups or even updates
and no videos to learn from
the ruby wiki-books that is five years out of date
Ruby is struggling to keep afloat on its past fling
it was popular before jquery. extjs and perl on parrot vm
Ruby releases do not release an update for the old version
since you have to delete your old version
it means an ruby is always an 80 mb download
and then gems means redundancy
not many people use the new version
there are several ruby versions all limping along still in use from
years ago
as they don’t auto-update like addons in firefox
it seems inept to re-install a whole new ruby
just to get about 5 mb changes in a few ruby patches
interest appears to dwindle as there is no ready basic support
can anyone help this teacher with data bases there or just talk for
days?
why are many of the programs in ruby forge five years old and forgotten?
is ragel a good thing? Ruby is cool but is a great mess frankly.
is there support for data stores such as puppet?

Google search how to “think like a computer scientist”.

I don’t think the ruby version of the book is done so you may be stuck
with picking the java or python version of the book. actually there
might be a c version as well.

Read the whole thing. And do all the exercises. It’s pedagogical.

Take it upon yourself to the challenge of creating a bubble sort
algorithm… on paper =)

Look at common data structures and get to know them. Take the time to
know what object oriented programming paradigm shift in contrast to
procedural programming languages. Take the time to understand the flow
of data and memory work with computers and operating system.

Note that low level as well as high level programming is slow process
of learning and practice before your hit the level of “The Art of
Programming”.

As for using ruby in it’s native environment I also suggest that you
run FreeBSD UNIX or some variant of GNU/Linux but mind you that will
add to your learning curve as well. It is estimated a two year
learning curve for running and maintaining either one of those
operating systems. I imagine that statistic is now lowered on the
maintainability end now that we have over simplified tools in places.

Good luck to you and your project.

~

one point is being made here that open source means no owners
no-one really helps this person they all just chat and remark

there are no active groups or even updates
and no videos to learn from
the ruby wiki-books that is five years out of date
Ruby is struggling to keep afloat on its past fling […]

Goodness. If you feel like that what on earth are you doing on this
list?

The OP has thanked at least two posters here, so I for one assume that
we have said something at least marginally useful.

As for Ruby being “out of date” – what does that mean, exactly? Even
if it were true in some sense, Google the amount of Cobol still being
developed - being “out of date” is out of date…


“It’s not just a computer – it’s your ass.”
– Cal Keegan

tim o wrote in post #976990:

no-one really helps this person they all just chat and remark
can anyone help this teacher with data bases there or just talk for
days?

Hilary has not asked any specific questions yet.

On forums like this you can’t expect people to design a database schema
for an unspecified education application. You can’t answer questions
like ‘is there a compiler that matches the contents of a book?’

You have to ask very specific questions that don’t take the reader long
to understand.

It’s true that people on here are more interested in rather
sophisticated language issues but even so, for general questions, I
think this forum gives responses at least as considered as others I have
seen.

Is a Code editor the same as a text editor? Can they both be used for
Ruby as well as RubyNRails?. If this is so are: a) Notepad++,
b)Netbeans, and c)Ruby mine-code similar products that can be used for
Ruby as well as Ruby N Rails?

On Mon, Jan 24, 2011 at 12:23 PM, Mike S. [email protected]
wrote:

You have to ask very specific questions that don’t take the reader long
to understand.

It’s not only a question of how long it takes a reader to understand
the question but also how long the answer is going to be (how much
explanation and guidance is needed to answer a question). For someone
starting out without or with only few programming experience creating
a web application which is backed by a relational database amounts to
a herculean task. To climb that mountain there is a lot of learning
needed and a technical forum like this is certainly not the best
suited medium to provide this guidance. At least, so I’m guessing, it
will take considerably longer than meeting a mentor personally.

It’s true that people on here are more interested in rather
sophisticated language issues but even so, for general questions, I
think this forum gives responses at least as considered as others I have
seen.

+1

Kind regards

robert

On Wed, Feb 2, 2011 at 5:27 PM, Hilary B. [email protected]
wrote:

Is a Code editor the same as a text editor?

Yes and no. Both can be used to edit source code but an editor or IDE
with support for a particular language (and framework like Rails) can
make the work significantly easier and faster => more productive.

Can they both be used for
Ruby as well as RubyNRails?. If this is so are: a) Notepad++,
b)Netbeans, and c)Ruby mine-code similar products that can be used for
Ruby as well as Ruby N Rails?

In principle probably all of them can be used since they are all text
editors. Which of these is more productive for Ruby and Rails work I
cannot tell. Since you are starting and probably writing small
programs initially any of them should do. Actually an IDE with all
the whistles and bells can make it overly hard initially since it is
more difficult to learn.

Kind regards

robert

Code editors and text editors differ. Code editors depending on code to
be edited have additional capabilities like block indenting and
outlining capability among others. Netbeans isn’t an editor it’s an ide
integrated development environment and that’s a different kettle of fish
altogether. It is possible to use notepad to write code though and a
person new to a programming language will learn syntax faster and better
that way. When a person gets to the point where they’re asked to do
production assignments rather than development assignments, then it’s
time to research and select either a code editor; an integrated
development environment or both and learn those before going on into the
production assignments.

Based on the responses received I am leaned toward the following study
guide:

A) since I intend to use the internet as the major source of
communication, learning ruby through Rails may be my starting point. I
installed Ruby 1.8.7, Rails 3.0.3, with Sqlite3 (1.3.3 x86 -mingw32)

A1) Download Devkit for use as a Ruby source of reference

A2) use the Ruby Gem web asa source of Ruby support

B) before delving into Ruby or Rails, I will learn critical basics from
w3.schools.com, from which I will cover: HTML, CSS and JavaScript

C) purchase Ruby mine-code editor from RubyMine: The Ruby on Rails IDE by JetBrains,
using their 30 day free trial prom, to use while finally learning Ruby
through Rails

C1) get started to learn Ruby/Rails. By first taking a 15 minute
tour/intro from http://tryruby.org

C2) continue quest by
submerging into Rails through www.digitalmediaminute.com tutorials.

C3) start placing my then practiced scripts + other saved practiced
tools, into a database of choice so to start dev a project

D) hopefully at this point I will be able to clarify in my mind which
database source to use, what supporting instruments needed to be
attached, etc… to make a meaningful log-in program that will reflect
real time, with the ability to gather, configure and interpret data.

If my analysis seems naïve, please understand, and I think you do, my
enthusiasm for using the open Source community as a savior to my woes.

What do you think? I know that I have over simplified the whole nature
of programming, however at this stage I think I will be forgiven for
bypassing some unmentioned stage/application/procedure.

Hi Hilary,
I haven’t been following the thread, but I wonder why you would buy
an IDE? There are lots of really good free ones, and arguably using a
language/ toolkit agnostic one is better for your health. Also, any
reason you are going with Ruby 1.8.x vs Ruby 1.9.x - I don’t know a lot
about rails, but if you are coming to the language cold, you probably
don’t want to learn old idioms, only to have to unlearn them again
later?

Sam

Hilary B. [email protected] writes:

B) before delving into Ruby or Rails, I will learn critical basics from
w3.schools.com, from which I will cover: HTML, CSS and JavaScript

Ugh. W3Schools is a very poor reputation among pros who actually know
how to code. It’s riddled with errors & misinformation - one glaring
example of which is the name itself, since they have no relationship to
the W3C whatsoever.

Check out http://htmldog.com. The material there is far better.

sherm–

+1 for Vim

I’ve been using Vim for years and I never looked back. To be honest,
others may say the same for Emacs, I think.

Bottom line is: no need of buying an editor or IDE when there are
already free editors that are so close to perfection :slight_smile:

Fabio C.

web: http://www.h3rald.com
twitter: http://twitter.com/h3rald

I agree with Sam here Hilary.

There have been many holy wars on the internet since the beginning of
time on which text editor to use to write programs and scripts. (see:
Editor war - Wikipedia)

My suggestion is to take a day( or two) and learn vim, a clone of vi.
It is a fairly simple to learn editor which provides syntax
highlighting and completion for ruby as well as many plugins to aid
development for ruby on rails and give the editor ide-like
capabilities.

Historically vi was the first visual text editor and was written as an
alternative to ‘ed’ the UNIX line editor. vi in some form or another
is found on every unix and linux system. This is one reason you might
find it a preference for admins and programmers. You can get vim for
windows here: http://www.vim.org/

You can run the command ‘vimtutor’ which is packaged with it and run
though the tutorial.

vi(m) is a pretty venerable tool. Learning anything with it will stick
with you for the rest of your life with no cost outside of simply
learning it. If you really feel money should be exchanged the initial
author of the clone has charity he prefers:
http://www.vim.org/sponsor/

But as with anything and everything in the open source and free
software universe; take the time to learn the tools so you can be
productive with them when the time comes.

Once again good luck with your future programming and hacking.

~

Here is my confusion…take the simplistic case of using an Excel
spreadsheet. I will be abel to type, perform math task etc…if I wish
to save a document can be accessed from the File-Open menu, then what
was saved can nbe executed by playing with some commands. With
Ruby/Rails, would the IDE be the source where I would enter scripts?. If
this is so, how would I retrieve/execute/display the saved macro/script.
Is Vim the tool that will do all of this using Ruby/Rails?

On 2/2/2011 3:14 PM, Stu wrote:

My suggestion is to take a day( or two) and learn vim, a clone of vi.
It is a fairly simple to learn editor which provides syntax
highlighting and completion for ruby as well as many plugins to aid
development for ruby on rails and give the editor ide-like
capabilities.

I use vim every day for editing all manner of files on various
platforms. I like it so much that I really hate other text editors and
anything without vim key bindings. That said, I would never claim that
vim and vi are simple to learn by any stretch of the imagination.
They’re great tools, but they operate so differently from other editors
that the learning curve is steep (almost vertical for many people ;-).

Aside from that, yes, vim has tons of plugins available to provide all
manner of functionality on top of a rich built-in set of features. And
you can rest assured that either vim or vi are available for immediate
use on just about any Unix-like system you’ll ever encounter.

I would recommend that you give vim (or even better, gvim) a try, but
don’t spend too much time banging your head against it. Try something
else if vim frustrates you too much for now. You’re here to learn Ruby
after all, and it would be a shame for you to be chased off by an
editor. :slight_smile:

-Jeremy

vi follows more command line logic like: {command} {file}

so to create hello world in ruby you would open up a prompt (i’m
assuming this works in dos) and run:

% vim hello.rb

if no dos prompt is available to edit a file you simple press colon
and ‘e’ then tab will show your file list. if you need a new file
colon and ‘n’ and type name of the file (:n hello.rb)

As I mentioned there is a tutorial bundled with the editor. The
learning curve comes from what you may have become accustomed( or
conditioned) to with gui based editors. What harm is it to run through
the tutorial?

It was mentioned about gvim which may have “drop down menus” though
this is really a scaffold when you are new and should be considered
something to avoid unless you have to use it.

The reason to learn an editor such as vi is that you will discover
that you will be come more productive with it over time. It does not
expire or lose support for xyz language as well as I mentioned it on
just about every unix installation currently available. At one of your
peers machines or need to remote into some host? vi is there. no need
to carry your own editor with you.

Also note vi is not hard to learn. It’s just different than what your
accustomed to. In most cases it should take a couple minutes to learn
something, some hours of practice and reconditioning the muscle
memory, to gain a skill you can use for the rest of your life.

Hilary B. wrote in post #979218:

A) since I intend to use the internet as the major source of
communication, learning ruby through Rails may be my starting point.

Rails is a powerful package but I would think twice about getting
involved in it right now.

Ruby can be accessible but equally it can be very inscrutable to all but
very knowledgable and capable programmers eg most of the people on this
channel.

The problem with Rails is it is a whole new langusge to learn. It is
more like a DSL. If you are struggling with just Ruby, why climb another
mountain at the same time?

Start dabbling with Scite. Open IRB in another window, and a command
prompt for ri in a third window. Explore Ruby’s basic behaviours. Follow
a simple Ruby book. Ask a few questions and get comfortable with simple
things.

Yukihiro M. is said to have designed Ruby based on the Principle
of Least Surprise. When you read that, just remember he wrote the
language so it’s not exactly surprising that he doesn’t get surprised
about what he created.

I programmed in a number of older languages. You could pick them up in a
few weeks and have real applictions running in no time. Then with great
excitement I crossed over to Ruby-like languages with Visual C++. It was
a different world - an order of magnitude more baffling.

It’s fascinating to write a few lines of Ruby and load data into and out
of a database, script a web site or make the numbers on Excel move
magically of their own accord.

Building a credible web application is a whole different ball game.