SpringFlowers AutumnMoon
2009-May-24 20:33 UTC
do you think we should make <%= # comment %> not cause error
the code <% # some code %> will not cause any error, but the code <%= # some code %> will cause an error. the argument is that the second statement is like output << and so it is an error. But I think since puts "hello" and puts both can run and cause no error, why not make <%= # some code %> not cause any error too? If we have a language / platform that will cause an error when we just comment out code, it is a big issue in the long term, since usually when we comment out something, we won''t easily cause a problem and may have a hard time finding what the cause is. for sure, we can change it to <% # some code %> but we lose the note there that we were going to output the content. When we uncomment the code, we don''t know for sure whether it should be <% %> or <%= %> and is prone to mistake again. -- Posted via http://www.ruby-forum.com/.
Roderick van Domburg
2009-May-24 20:35 UTC
Re: do you think we should make <%= # comment %> not cause e
Report it at http://rails.uservoice.com, I''d +1 it! -- Roderick van Domburg http://www.nedforce.com -- Posted via http://www.ruby-forum.com/.
Colin Law
2009-May-24 20:43 UTC
Re: do you think we should make <%= # comment %> not cause error
I believe that <% #... %> is not a valid erb comment (no space is allowed after %). See https://rails.lighthouseapp.com/projects/8994/tickets/1580-whitespace-bug-in-erb-comments-in-rails-222. You have to read through the comments to get to the conclusion. Colin 2009/5/24 SpringFlowers AutumnMoon <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>> > the code > > <% # some code %> > > will not cause any error, but the code > > <%= # some code %> > > will cause an error. > > the argument is that the second statement is like > > output << > > and so it is an error. > > But I think since > > puts "hello" > > and > > puts > > both can run and cause no error, why not make > > <%= # some code %> > > not cause any error too? If we have a language / platform that will > cause an error when we just comment out code, it is a big issue in the > long term, since usually when we comment out something, we won''t easily > cause a problem and may have a hard time finding what the cause is. > > for sure, we can change it to > > <% # some code %> > > but we lose the note there that we were going to output the content. > When we uncomment the code, we don''t know for sure whether it should be > <% %> or <%= %> and is prone to mistake again. > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Colin Law
2009-May-24 20:57 UTC
Re: do you think we should make <%= # comment %> not cause error
In addition I meant to say that according to the ticket link, <%=# and <%= # are also not valid erb comments. Colin 2009/5/24 Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>> I believe that <% #... %> is not a valid erb comment (no space is allowed > after %). See > https://rails.lighthouseapp.com/projects/8994/tickets/1580-whitespace-bug-in-erb-comments-in-rails-222. > You have to read through the comments to get to the conclusion. > > Colin > > 2009/5/24 SpringFlowers AutumnMoon <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > > >> the code >> >> <% # some code %> >> >> will not cause any error, but the code >> >> <%= # some code %> >> >> will cause an error. >> >> the argument is that the second statement is like >> >> output << >> >> and so it is an error. >> >> But I think since >> >> puts "hello" >> >> and >> >> puts >> >> both can run and cause no error, why not make >> >> <%= # some code %> >> >> not cause any error too? If we have a language / platform that will >> cause an error when we just comment out code, it is a big issue in the >> long term, since usually when we comment out something, we won''t easily >> cause a problem and may have a hard time finding what the cause is. >> >> for sure, we can change it to >> >> <% # some code %> >> >> but we lose the note there that we were going to output the content. >> When we uncomment the code, we don''t know for sure whether it should be >> <% %> or <%= %> and is prone to mistake again. >> -- >> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Salil Gaikwad
2009-May-27 05:19 UTC
Re: do you think we should make <%= # comment %> not cause error
Colin Law wrote:> In addition I meant to say that according to the ticket link, <%=# and > <%= # > are also not valid erb comments. > Colin > > 2009/5/24 Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>I Commented code in erb in following ways <%# This is Comment %> <%# This is Comment %> <%#= This is Comment %> <%#This is Comment %> -- Posted via http://www.ruby-forum.com/.
Salil Gaikwad wrote:> I Commented code in erb in following ways > > <%# This is Comment %> > > <%# > This is Comment > %> > > <%#= This is Comment %> > > <%#> This is Comment > %>i see. that''s smart. then we don''t need <%= #comment %> to work. but if it can, i think it might be good. -- Posted via http://www.ruby-forum.com/.