Another possibly neat comparison:

Original: https://github.com/roundcube/roundcubemail/blob/master/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php#L206
Cleanup: https://github.com/daviddeutsch/roundcubemail/blob/37167c5ce1c00cb4f42b7f59a9ff56b81b3cd874/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php#L219

The code may be /slightly/ less DRY, but, I find, a lot more readable.

I must also say that so far, I find very few yoda conditions! ;-)


On Sat, Aug 31, 2013 at 12:54 PM, David Deutsch <skoremail@gmail.com> wrote:
Hi Alec,

Alright, will contain myself ;-)

As for my comments: It's not really so much about what I like or dislike - I was just trying to discuss the matter. Feel free to follow up ;-)

-David


On Sat, Aug 31, 2013 at 7:37 AM, A.L.E.C <alec@alec.pl> wrote:
On 08/31/2013 02:17 AM, David Deutsch wrote:
> This is the first time that I'm considering breaking something up into
> separate methods. There's a 600 line if/elseif construct in there. I mean
> come /on/.

Yes. This code is quite big because of the nature of filters. We can
split it to separate methods, but please, do not do this now. Focus on
code style and simple fixes.

Also, I see you didn't like some of my comments on your code style. I
propose to wait for Thomas. I think he might have taste similar to mine.

--
Aleksander 'A.L.E.C' Machniak
LAN Management System Developer [http://lms.org.pl]
Roundcube Webmail Developer  [http://roundcube.net]
---------------------------------------------------
PGP: 19359DC1 @@ GG: 2275252 @@ WWW: http://alec.pl
_______________________________________________
Roundcube Development discussion mailing list
dev@lists.roundcube.net
http://lists.roundcube.net/mailman/listinfo/dev