On 04/15/2014 12:28 PM, John Bollinger wrote:
> 
> You are complaining about a problem partially of your own making: you break 
> up the Ruby a lot more than you need to do.  Obviously you *can* do it like 
> that, but why?

I find it's difficult to comprehend nested code intermixed with lines
that start with markup tags.

> Here's an alternative that I like a lot better:

I think this is arguably worse because it's visually very difficult to
line up the the start and end of code blocks.

> <%
>   if megaraid_device and megaraid_device != '' and 
>        @megaraid_adapters and @megaraid_adapters.to_i > 0
>      option_str = (megaraid_options ? ' ' + megaraid_options : '')
>      unless @megaraid_physical_drives_sata.nil?
>         @megaraid_physical_drives_sata.split(/,/).sort.each do |drive|
> -%>
> <%= megaraid_device %> -d sat+megaraid,<%= drive.to_i %><%= option_str %>
> <%
>         end
>     end
>     unless @megaraid_physical_drives_sas.nil?
>       @megaraid_physical_drives_sas.split(/,/).sort.each do |drive|
> -%> 
> <%= megaraid_device %> -d megaraid,<%= drive.to_i %><%= option_str %> 

This is still a nightmare to edit [without breaking whitespace/etc.].

> <%
>       end
>     end
>   end
> -%> 

This is an illustrative example of the issue I was describing.  It's a
"design smell", in my opinion.

-Josh

--

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/534DC0BA.4090500%40cpan.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to