Forum: Ruby Start from the start - Ruby or ruby on rails

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
233a8644ab9b34e21845fd1f9bc06825?d=identicon&s=25 unknown (Guest)
on 2006-02-07 18:57
(Received via mailing list)
I'm looking to start developing a simple task management application
with a web interface.Three views - User/Admin/Status. No database yet
as i think that would be overkill. I intend to store the data in xml
files for the moment.

My question - i am pretty new to development. I have been working as a
qa engineer for some time and have good unix skills but have only ever
really played with java/perl with no great success. Have had enough of
wishing for applications or features. I'm going to write my own.

I would appreciate any pointers the group could offer. For starters i
am unsure if i should develop in vanilla ruby or implement ruby on
rails if it is to be a web application. My initial thoughts are that
learning ruby will be enough for a start but that i may have to use
some MVC model??

I have hosting with dreamhost which supports ruby.

 I am currently expanding the spec and a simple UI which i can post
when complete if people think that would be useful. Its based loosely
on basecamphq but more aligned to the organisation i work for and i
would hope to make it very portable.

Many thanks for your time,
Eain
70c8da82d09d3866222976ab8978133c?d=identicon&s=25 Daniel Nugent (Guest)
on 2006-02-07 19:28
(Received via mailing list)
I'd say your best bet would be to start with a couple of Ruby
tutorials to get a hang of the idioms (blocks being one of the most
important ones) that make Ruby easy to use and maybe try writing a few
small programs in Ruby (preferablly ones that you'd actually use) and
then jump into Rails.

Even as a beginner you shouldn't have too much trouble using Rails,
but you definitley benefit from understanding where and how its power
and flexibility come from.

Chris Pine's tutorial is supposed to be very good even for people
who've never programmed before (I haven't read it personally):
http://pine.fm/LearnToProgram/

I personally learned Ruby from the Pickaxe v2, which I found to be the
best book on a programming language that I've ever read (version 1 is
available online: http://ruby-doc.org/docs/ProgrammingRuby/

If you're up for something a bit more difficult, strange, and
wonderful, you should give _why's poignant guide a try (it's got
cartoon foxes!): http://ruby-doc.org/docs/ProgrammingRuby/

As for Rails, I personally couldn't get much out of most of the online
documents on it.  I got the Agile Web Development book and that
cleared up a lot for me.  In any case here's a list of Rails tutorials
and documentation, youre mileage may vary:
http://www.rubyonrails.org/docs
9539774fe19b5268e39ee6cf3ca19b71?d=identicon&s=25 Jules Jacobs (Guest)
on 2006-02-07 19:38
(Received via mailing list)
I think you meant this one:
http://www.poignantguide.net/ruby/

Use Rails, and not vanilla Ruby. It will save you a lot of time.

Please do yourself a favor, and use a database, and no XML files.
Databases are where Rails shines, it will be much easier than a XML
files.

If you are willing to buy a book, I recommend "Programming Ruby - The
Pragmatic Programmer's Guide v2"

but you can also use (the slightly outdated) v1: http://
www.rubycentral.com/book/

For a book on Rails:
"Agile Web Development with Rails"
70c8da82d09d3866222976ab8978133c?d=identicon&s=25 Daniel Nugent (Guest)
on 2006-02-07 19:54
(Received via mailing list)
Yep, I copy/pasted the wrong link.
661ea30d6fca64e64e84fde2940b4aa7?d=identicon&s=25 Konrad Roziewski (Guest)
on 2006-02-07 22:34
(Received via mailing list)
I completely agree with Jules: try Rails from the start and learn Ruby
as you go. When you encounter some ruby "feature" you don't know,
google for it and see what it does. That way you'll be happy to have
your app quickly and you'll learn exactly those parts of ruby you need.

And for God's sake: forget about XML! ;)
233a8644ab9b34e21845fd1f9bc06825?d=identicon&s=25 unknown (Guest)
on 2006-02-08 10:54
(Received via mailing list)
Thanks to everybody for the recommendations. I had a lot of the links
lined up and ready to read , will jump into rails straight away. I am
still a little reluctant to start off my first real project with a
Database back end.I'm concerned that the design and management of the
database could add a serious jump in my already steep learning curve.

If anybody has the time would the be kind enough to outline the pro's
of using a database agains the cons of xml.

My initial thoughts when choosing xml was that it is easily
manipulated, can be easily accessed by other applications and that if
in the future i did want to go to a database it would lend itself to
migration?
C62c63cb6aa088a5b2c01570e288943d?d=identicon&s=25 Huw Collingbourne (Guest)
on 2006-02-08 11:34
(Received via mailing list)
<eain.jones@gmail.com> wrote in message
news:1139392354.132788.204000@o13g2000cwo.googlegroups.com...
> Thanks to everybody for the recommendations. I had a lot of the links
> lined up and ready to read , will jump into rails straight away. I am
> still a little reluctant to start off my first real project with a
> Database back end.I'm concerned that the design and management of the
> database could add a serious jump in my already steep learning curve.
>

You may be interested to know that we shall shortly (within the next
month
or so) be starting a 'Programming Ruby' series on the Bitwise Magazine
site
www.bitwisemag.com . It is our intention to concentrate purely on the
Ruby
language for the first few months, only moving on to Rails (and a few
other
things) at a later stage. My own view is that while Rails may have, to
large
extent, generated a great deal of recent interest in Ruby, it is all too
easy to become seduced by the special features of Rails for creating
powerful applications with relatively little programming with the
consequence that this may 'hide' the features of Ruby itself. We
therefore
decided that a logical approach for our coverage would be to concentrate
entirely on the Ruby language initially and only move into graphical and
web
application development at a later stage.

best wishes
Huw Collingbourne
================================
 Bitwise Magazine
     www.bitwisemag.com
 Dark Neon Ltd.
================================
E29eaefee1709918198c8a4f55c42667?d=identicon&s=25 anne001 (Guest)
on 2006-02-08 12:40
(Received via mailing list)
I started with a small ruby project, and I am glad I did, this way I
only have to master
the web server ideas on my first rail project.
9539774fe19b5268e39ee6cf3ca19b71?d=identicon&s=25 Jules Jacobs (Guest)
on 2006-02-08 17:01
(Received via mailing list)
Pro XML: ehh, you can access it with programming languages that don't
support your database (no libraries).

Pro DB:
- Much easier
- Faster access
- Rails has much better support for this
- All tutorials focus on databases
- ...

XML might be much easier than a database in perl/java, but it really
isn't in Ruby.

On Wednesday, February 08, 2006, at 6:53 PM,  wrote:
>manipulated, can be easily accessed by other applications and that if
>in the future i did want to go to a database it would lend itself to
>migration?
>
>


Jules
4299e35bacef054df40583da2d51edea?d=identicon&s=25 James Gray (bbazzarrakk)
on 2006-02-08 18:17
(Received via mailing list)
On Feb 8, 2006, at 3:53 AM, eain.jones@gmail.com wrote:

> I'm concerned that the design and management of the
> database could add a serious jump in my already steep learning curve.

I'll take the road less traveled and recommend you stick with your
first instinct which was not to use Rails.  I know most people say
it's so easy to learn and it is, for a web development framework.
However, the key there is that there is more to learn.

Plus, Rails sits on top of Ruby, so starting at the top means you
might be a little fuzzy down the road about what is a Railsism and
what is actually part of the language.  I think it's much easier to
go in the other direction, after you have a solid foundation in the
language, though I'm probably in the minority with this line of thought.

Your needs sounded very modest, so you should be able to easily get
something going with the language itself and the help of one or two
standard libraries.  Here are my recommendations:

1.  Use CGI or WEBrick servlets to handle the logic.  These are very
low-tech compared to Rails, but trivial to get going.

2.  Give YAML a shot, before you resort to using XML.  I'm just
saying that because I think you will be surprised by how much easier
it is in Ruby.  You will likely be able to save all your data with a
single line of code and load it with another line.  It very painless.

3.  Ask us any questions you run into along the way.  :)

Good luck with your project, however you decide to approach it.

James Edward Gray II
40823088cec28c3224ff4c46ced1beda?d=identicon&s=25 Seth Thomas Rasmussen (Guest)
on 2006-02-08 21:03
(Received via mailing list)
Hi James,

> I'll take the road less traveled and recommend you stick with your
> first instinct which was not to use Rails.  I know most people say
> it's so easy to learn and it is, for a web development framework.
> However, the key there is that there is more to learn.
>
> Plus, Rails sits on top of Ruby, so starting at the top means you
> might be a little fuzzy down the road about what is a Railsism and
> what is actually part of the language.  I think it's much easier to
> go in the other direction, after you have a solid foundation in the
> language, though I'm probably in the minority with this line of thought.

I hope not, as I feel the same way, and this seems very rational.
Personally, I read Pickaxe Dos before writing a single line of Ruby,
much less Rails, and I feel it was very beneficial going into Rails. I
believe it has provided for less frustration with a great many details,
and enabled me to think smarter about how to do and even extend Rails
as I keep on learning.
233a8644ab9b34e21845fd1f9bc06825?d=identicon&s=25 unknown (Guest)
on 2006-02-08 22:38
(Received via mailing list)
James and Seth,

Thanks for your words of encouragement. Sage indeed. I'm going to start
with ruby and work my way up. YAML seems to be exactly what i am
looking for. I had not run across it before.I also like the look of
webrick. I really want to keep things as simple as possible. Its a lot
to take in but exciting.

I'm finishing up my simple design and will post it here soon so folks
can take a look if they have the time or inclination. I must reiterate,
I am new to development so mistakes will be made, bugs will be logged
and hands will be wrung, just go easy.

With regard to the design, for a web application i understand MVC
pattern is very popular, we use it a lot where i work. For my
application i'm trying to figure out where everything lives. This is
proving to me a challenge.

Thanks,
Eain
E29eaefee1709918198c8a4f55c42667?d=identicon&s=25 anne001 (Guest)
on 2006-02-08 22:48
(Received via mailing list)
rails tutorials are very glitzy but they are scary as you may not
understand any of it
this tutorial is low key, but it explains things pretty well - I have
not finished it
http://www.troubleshooters.com/codecorn/ruby/rails...
4299e35bacef054df40583da2d51edea?d=identicon&s=25 James Gray (bbazzarrakk)
on 2006-02-08 22:53
(Received via mailing list)
On Feb 8, 2006, at 3:38 PM, eain.jones@gmail.com wrote:

> I am new to development so mistakes will be made, bugs will be logged
> and hands will be wrung, just go easy.

No problem, you're learning fast now and we will be here when you
need a hand.  ;)

Welcome to Ruby!

James Edward Gray II
6c3044d356f70993fa377a7b1706ca1e?d=identicon&s=25 Alain FELER (Guest)
on 2006-02-09 22:18
(Received via mailing list)
XML, Yaml, database : before choosing, maybe you would like to have a
look at Kirbybase :
http://www.netpromi.com/files/kirbybaserubymanual.html
It has many very nice features :
- no installation (written in ruby) : put kirbybase.rb in
c:\ruby\lib\ruby\site_ruby and that's all
- no database language to learn : everything is done with ruby syntax
- no administration tools required : the data is in plain text files
- no hundreds of page to read : the complete doc is 77k
- offers nearly the power of a "real" database system : indexes, lookup
tables, one-to-many links, multi-fields sort, enough data types (String,
Integer, Float, Boolean, Time, Date, DateTime, Memo, Blob, and YAML.)
- fast enough
- free
AF
430ea1cba106cc65b7687d66e9df4f06?d=identicon&s=25 David Vallner (Guest)
on 2006-02-09 23:01
(Received via mailing list)
Hate to spoil a perfectly good sales pitch, but if the app is supposed
to be
in Rails and simple / formulaic enough, it doesn't really matter what
the
underlying query language is.

Is there a usable Rails adapter for KirbyBase? ACID transactions (for DB
schema changes if nothing else)?

And with the good and bad of it, SQL is -the- standard RDBMS query
language,
so that would restrict KirbyBase to small / personal projects where
you're
sure you'll never change DB backends.

Also, why would someone that already knows SQL choose KirbyBase over
SQLite?
The latter installs very easily too.

David Vallner

PS: No, I'm not trying to flame KirbyBase, or sales pitches. Just if
you're
going to do a sales pitch for whatever you like, make it less mindless
and
put it into context.

DÅ?a Å tvrtok 09 Február 2006 22:18 Alain FELER napísal:
233a8644ab9b34e21845fd1f9bc06825?d=identicon&s=25 unknown (Guest)
on 2006-02-09 23:18
(Received via mailing list)
Thanks Alain, Kirbybase does look like a very nice solution. It has
given me some food for thought. I keep asking myself what a database
gives me over XML or yaml for a simple application like mine that will
only ever contain name value pairs or a basic extension of this format.


I'd like a little info on what i will gain by using a DB. At the moment
i see it as a lot of overhead and maybe a step to far.

Although the more i look at kirbybase the more i do like some of the
features and its simplicity.
E34b5cae57e0dd170114dba444e37852?d=identicon&s=25 Logan Capaldo (Guest)
on 2006-02-09 23:26
(Received via mailing list)
On Feb 9, 2006, at 5:01 PM, David Vallner wrote:

> Hate to spoil a perfectly good sales pitch, but if the app is
> supposed to be
> in Rails and simple / formulaic enough, it doesn't really matter
> what the
> underlying query language is.
>
> Is there a usable Rails adapter for KirbyBase? ACID transactions
> (for DB
> schema changes if nothing else)?
>

Well if he's considering not using Rails at all it doesn't matter if
there's an ActiveRecord adapter for it (although I've written an AR
ripoff for KB, there's an Og adater for it, and I know someone is
working on a ActiveRecord adapter for KB). I don't believe KB is
ACID, although I could be wrong

> And with the good and bad of it, SQL is -the- standard RDBMS query
> language,
> so that would restrict KirbyBase to small / personal projects where
> you're
> sure you'll never change DB backends.
>

Not true, KirbyBases' format is easily parseable and editable by hand
as well. It also accessible from Python.

> Also, why would someone that already knows SQL choose KirbyBase
> over SQLite?
> The latter installs very easily too.
>

Well kirbybase is precisely 1 file of ruby sourcecode. Doesn't get
much easier than that, especially if you need to deploy elsewhere.
Cb48ca5059faf7409a5ab3745a964696?d=identicon&s=25 unknown (Guest)
on 2006-02-09 23:32
(Received via mailing list)
On Fri, 10 Feb 2006 eain.jones@gmail.com wrote:

> Thanks Alain, Kirbybase does look like a very nice solution. It has given me
> some food for thought. I keep asking myself what a database gives me over
> XML or yaml for a simple application like mine that will only ever contain
> name value pairs or a basic extension of this format.
>
> I'd like a little info on what i will gain by using a DB. At the moment i
> see it as a lot of overhead and maybe a step to far.
>

   - concurrency

       a web enabled program means multiple users accessing the data
source at
       once.  unless you are willing for one user to block all others
while a
       lock is held you will corrupt the data store

   - atomicity

       transactions allow you to bundle changes into all or none
operations

   - consistency

       only valid data may be wrttien.  validation data in your
application is
       fine.  until another app accesses the data and hoses it.
validate in
       the db.

   - isolation

       if something from db
         then modify db

     works for multiple process at once.  each sees a view of the db
that makes
     it appear as if it's the only process accessing it.

   - durability

       power failures, disk failures, etc are far less likely to corrupt
your
       data.  especially since you'll have the option of hot backups

   - standards

       sql helps keep data logic out of your code.  for instance,
thousands of
       reporting tools and applications will just 'work' with your data.

   - effort.  if your are talking rails it like about 1000000% times
easier to
     use a db than not.

   - scalability.  if your application is good you may want to add a
feature
     or users.  a db makes that possible.


some applications can definitely make use of yaml, bdb, pstore, fsdb,
kirbybase, etc.  but web aps push their limitations for sure.

regards.

-a
175e47c3d060e2635df0da9df0148580?d=identicon&s=25 Assaph Mehr (Guest)
on 2006-02-10 00:08
(Received via mailing list)
Hi David,

> Is there a usable Rails adapter for KirbyBase? ACID transactions (for DB
> schema changes if nothing else)?

http://rubyforge.org/projects/ackbar - about to be released this weekend
:-)

> And with the good and bad of it, SQL is -the- standard RDBMS query language,
> so that would restrict KirbyBase to small / personal projects where you're
> sure you'll never change DB backends.
>
> Also, why would someone that already knows SQL choose KirbyBase over SQLite?
> The latter installs very easily too.

Sometime that is excatly why you need it: small, personal projects...
which are shrink wrapped to distribute to other users. For me that is
exactly what I need. A no hussle installation which works across
multiple platforms ('gem install app' which picks up the dbms).
No, it's not ACID. No, it doesn't support AR 100%. Yes, I will have
overhead to make sure my app works both on KB and on SQLite. But for
the end user who couldn't care less about the backend as long as it
works - the no third party to install works great. The plain-text data
format is also great - your data is always available to you, even if
my app or the database suddenly become problematic.

Of course, any *real* webapp might need need a *real* database. I'm
just talking about the less real, "works for me" class of applications
:-)

HTH,
Assaph
430ea1cba106cc65b7687d66e9df4f06?d=identicon&s=25 David Vallner (Guest)
on 2006-02-10 01:56
(Received via mailing list)
DÅ?a Å tvrtok 09 Február 2006 23:26 Logan Capaldo napísal:
> On Feb 9, 2006, at 5:01 PM, David Vallner wrote:
> > And with the good and bad of it, SQL is -the- standard RDBMS query
> > language,
> > so that would restrict KirbyBase to small / personal projects where
> > you're
> > sure you'll never change DB backends.
>
> Not true, KirbyBases' format is easily parseable and editable by hand
> as well. It also accessible from Python.
>

I said switching DB -backends-, not what I access it with. I can to some
extent drop one SQL DBMS in place of another without changing the code
accessing it. I can't for example use KB to prototype an application and
then
switch over to Postgres for scalability without rewriting my DB query
code.

This is of course not an issue when using an ORM layer, and use of SQL
doesn't
quite save you from having to do DB migration - even if dumping the
schema
and data as SQL statements might help. Sounds like a potentially useful
feature for KB, is it already present? If not, it sounds arguably
somewhat
easier to implement than a KB query-to-SQL compiler.

> > Also, why would someone that already knows SQL choose KirbyBase
> > over SQLite?
> > The latter installs very easily too.
>
> Well kirbybase is precisely 1 file of ruby sourcecode. Doesn't get
> much easier than that, especially if you need to deploy elsewhere.
>

SQLite is one DLL, and one gem installation. I've walked managers
through
that. More complicated, yes, but I can't imagine a deployment scenario
where
on would pose significantly more problems than the other. Well, except
atomically packaging the application as a gem.

David Vallner
430ea1cba106cc65b7687d66e9df4f06?d=identicon&s=25 David Vallner (Guest)
on 2006-02-10 02:07
(Received via mailing list)
DÅ?a Piatok 10 Február 2006 00:08 Assaph Mehr napísal:
> Of course, any *real* webapp might need need a *real* database. I'm
> just talking about the less real, "works for me" class of applications

Well, that's the main problem with concurrency bugs. You don't know
where they
might occur (e.g. they might theoretically occur anywhere) until they
do, and
they're usually also very obscure bugs. The other way I had to SSH over
to a
friend and do the SQLite delete column hack, and I was damn glad to have
the
table locked while doing it and ROLLBACK at my fingertips - ever so
slightly
a more elegant solution than taking the whole application offline and
then
hacking at the file. Although very possibly subject to taste and the
desire
to do things "right" for acquired meanings of the world more than
anything
else.

Of course, for "works for me", it's probably Very Good (tm), as well as
for
people that don't know SQL or find it excruciatingly painful to work
with the
language or SQL shells.

David Vallner
1dfb026cfdfe73c7171c653da29c134d?d=identicon&s=25 Al Gordon (Guest)
on 2006-02-10 18:03
(Received via mailing list)
On 2/9/06, Alain FELER <alain.feler@wanadoo.fr> wrote:
> Integer, Float, Boolean, Time, Date, DateTime, Memo, Blob, and YAML.)
> - fast enough
> - free
> AF

I dig that this recommendation for kirby was written in yaml. ;)

---

  -- AL --
This topic is locked and can not be replied to.