Comment for partial line

Hi

Can someone confirm that Ruby only allows #tail of line commenting and
=begin
this
whole
block
commenting
=end

and not partial line commenting?

and if so, i request this be changed! its really annoying not being able
to do a partial line comment in rhtml

thanks

You can do HTML comments in RHTML you know. :wink:

–Jeremy

On 2/6/07, Xia __ [email protected] wrote:


http://www.jeremymcanally.com/

My free Ruby e-book:
http://www.humblelittlerubybook.com/book/

My blogs:

http://www.rubyinpractice.com/

Either,
or…

<% do_stuff; “comment on it”; do_more; “more comments” %>

but please, if you need to document a template… move that stuff into
the controller…

its more for bug tracking; to be able to remove functionality
temporarily to see what is broken, so more like

<% do_stuff; /* HIDE THE FOLLOWING FROM RUBY do_more; */ %>

too much logic being a rails form helper?

i dont want to turn this thread into a debate about programming design,
i just want to know if ruby offers a fairly simple syntax function which
is available in many languages.

On 2/7/07, Xia __ [email protected] wrote:

i dont want to turn this thread into a debate about programming design,
i just want to know if ruby offers a fairly simple syntax function which
is available in many languages.

no.

On Wednesday 07 February 2007 02:55, Xia __ wrote:

its more for bug tracking; to be able to remove functionality
temporarily to see what is broken, so more like

<% do_stuff; /* HIDE THE FOLLOWING FROM RUBY do_more; */ %>

that means that perhaps you have way too much logic in your template,
and you
should better move that logic into the controller. it isn’t just a
matter of
taste, it’s a matter of good design :).

HTH

Michael F. wrote:

On 2/7/07, Xia __ [email protected] wrote:

i dont want to turn this thread into a debate about programming design,
i just want to know if ruby offers a fairly simple syntax function which
is available in many languages.

no.

cool thanks michael.

i think there may be some argument for it to be supported in the case of
erb in rhtml; mostly due to common html markup style which is different
to ruby due to line spacing and inline elements in html

no comment…

On 2/7/07, Xia __ [email protected] wrote:

cool thanks michael.

i think there may be some argument for it to be supported in the case of
erb in rhtml; mostly due to common html markup style which is different
to ruby due to line spacing and inline elements in html

So you are really after a debate then :wink:

On Behalf Of Xia __:

i dont want to turn this thread into a debate about

programming design,

i just want to know if ruby offers a fairly simple syntax

function which is available in many languages.

the ff is just a kludge. i enclose them text inside single quotes, or %<

, or %<-- -->

irb(main):041:0> print "Hello, "; ‘this wont run; puts “NO!”’; print
“world\n”
Hello, world
=> nil
irb(main):042:0> print "Hello, "; %<this wont run; puts “NO!”>; print
“world\n”
Hello, world
=> nil
irb(main):046:0> print "Hello, "; %<–NONONO!–>; print “world.\n”
Hello, world.
=> nil

Hey, about an rcr, use “–” or “++” as inline commenters :))

But sincerely, i have a phobia of inline comments. I once had a bug that
took me a day (24hrs) to find because of a very slick inline comment i
inserted… arrghh… but that was then. Now, unit test/tdd/bdd/rspec/ioc
rocks. no fear :slight_smile:

kind regards -botp

Xia __ wrote:

no comment…

I thought that was the problem? :slight_smile: