--001517447e3a57ed5d04c0026ee5
Content-Type: text/plain; charset=ISO-8859-1
On 14 May 2012 18:17, Marc Heiler <lists / ruby-forum.com> wrote:
> > What should I make to show off metaprogramming?
>
> The first thing is to laugh into the face of anyone who is
> "metaprogramming".
>
I have to disagree with this. The whole of Rails is built around
metaprogramming. The reading of a database schema and creation of methods
at runtime, the use of method_missing throughout. Without those things,
Rails would be a totally different framework.
I agree that a lot of the time there are simple ways to do things, but good
metaprogramming makes beautiful, powerful and DRY code.
For the OP, I'd recommend reading
http://pragprog.com/book/ppmetr/metaprogramming-ruby and then just using
the techniques in the applications that you build. If you want to build
something specific then the Struct challenge mentioned previously looks
good fun.
Jeremy Walker
>
> Metaprogramming is a fashion run that is hopefully soon dying out.
>
> It is synonymous to admit that whoever is using "meta" to solve
> any given problem in Ruby there is:
>
> (a) no better solution (which would be sad, ruby is such a great
> language)
> (b) an ego boost to show off how to solve problems in convoluted and
> ugly ways
> (c) the bane of KEEPING THINGS SIMPLE, in an ever rising complexity for
> marginal gains
>
> I don't say that "metaprogramming" has no valid use cases. For example,
> I tend to use a config object for my projects, which allows one to call
> any method on it, and that object tries to make sense of it when
> possible.
>
> But that is really nothing "meta" I can see here.
>
> Meta is the new Agile - buzzwords with no values that will die soon.
>
> --
> Posted via http://www.ruby-forum.com/.
>
>
--001517447e3a57ed5d04c0026ee5
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<br><br><div class="gmail_quote">On 14 May 2012 18:17, Marc Heiler <span dir="ltr">&lt;<a href="mailto:lists / ruby-forum.com" target="_blank">lists / ruby-forum.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
&gt; What should I make to show off metaprogramming?<br>
<br>
The first thing is to laugh into the face of anyone who is<br>
&quot;metaprogramming&quot;.<br></blockquote><div><br></div><div>I have to disagree with this. The whole of Rails is built around metaprogramming. Theeading of a database schema and creation of methods at runtime, the use of method_missing throughout. Without those things, Rails would be a totallyifferent framework.</div>
<div><br></div><div>I agree that a lot of the time there are simple ways too things, but good metaprogramming makes beautiful, powerful and DRY code.</div><div><br></div><div>For the OP, I&#39;d recommend readinga href="http://pragprog.com/book/ppmetr/metaprogramming-ruby">http://pragprog.com/book/ppmetr/metaprogramming-ruby</a> and then just using the techniques in the applications that you build. If you want to build something specifichen the Struct challenge mentioned previously looks good fun.</div>
<div><br></div><div>Jeremy Walker</div><div>/div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Metaprogramming is a fashion run that is hopefully soon dying out.<br>
<br>
It is synonymous to admit that whoever is using &quot;meta&quot; to solve<br>
any given problem in Ruby there is:<br>
<br>
(a) no better solution (which would be sad, ruby is such a great<br>
language)<br>
(b) an ego boost to show off how to solve problems in convoluted and<br>
ugly ways<br>
(c) the bane of KEEPING THINGS SIMPLE, in an ever rising complexity for<br>
marginal gains<br>
<br>
I don&#39;t say that &quot;metaprogramming&quot; has no valid use cases. For example,<br>
I tend to use a config object for my projects, which allows one to call<br>
any method on it, and that object tries to make sense of it when<br>
possible.<br>
<br>
But that is really nothing &quot;meta&quot; I can see here.<br>
<br>
Meta is the new Agile - buzzwords with no values that will die soon.<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
Posted via <a href="http://www.ruby-forum.com/" target="_blank">http://www.ruby-forum.com/</a>.<br>
<br>
</div></div></blockquote></div><br>
--001517447e3a57ed5d04c0026ee5--