Thursday, September 29, 2011

[Rails] Re: First time with Ruby - how to print "Hello World!" via web-server

-- -- wrote in post #1024115:
> How can I not be a programmer and know PHP? It depends on the definition
> of "being a programmer". IMO, a programmer is someone who:
> 1. Knows many programming languages and often uses them because... he's
> programming... a lot (probably for a living) ;)
> 2. Would never ask the questions I asked ;)

I hope you realize I was mostly kidding about that. I know what you
meant, it just seemed funny to me that you first said "I'm not a
programmer" then said "I know PHP quite well" -- paraphrased.

> Now, would you still consider me a programmer? I wouldn't ;)

I consider a person to be a programmer once they write their first
program. Even if that happens to be: puts "Hello World". Everything
beyond that is the person's level of experience as a programmer.

You have shown interest in programming, and you have written at least
some PHP code. Congrats, you are a programmer. I don't see that there is
some "magical" level of experience where suddenly a person transforms
into a programmer. I've been programming for a really long time and I
still learn something new on a nearly daily basis.

-- from a separate followup post by the OP
> I can put a PHP file with <?php Print "Hello World!"; ?> in it to the
> public_html folder - works. Where to put which file to make it work with
> Ruby - still no clue.

Okay, here is a REALLY important point you're not taking into
consideration. The reason that snippet of PHP works, in what appears to
be some magical transparent way, is that there is a complex and
sophisticated module, written in C, that was included into the web
server (Apache, IIS, or whatever) by your shared hosting provider. This
"special" module knows how to interpret the <?php> tags and transform
them into plain old HTML before delivering the response to the client
web browser.

Rails by contrast takes a different approach. In a Rails application
there may be a small module (in the case of something like Phusion
Passenger) or simply some web server configuration that is responsible
for directing requests to the application from the web server.

The point I'm making here is that the vast majority of the work that
would be performed by the PHP web server module is actually deferred to
the Rails application itself. Hence the Rails routing system that
directs requests to the proper Rails controller classes, which in turn
are responsible for rending eRB templates into HTML and delivering the
response to the client browser.

You're trying to directly compare two completely different approaches to
web applications where such a direct comparison simply isn't possible.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment