[prev in list] [next in list] [prev in thread] [next in thread] 

List:       webkit-dev
Subject:    Re: [webkit-dev] Proposal for a new way to handle porting #ifdefs
From:       Peter Kasting <pkasting () google ! com>
Date:       2009-05-25 5:51:55
Message-ID: d62cf1d10905242251gbe273e6pb8aad67804c7602a () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Sun, May 24, 2009 at 10:08 PM, Maciej Stachowiak <mjs@apple.com> wrote:

> I don't think it should be discounted. It might be helpful to clarify why
> you think ifdefs are a bad solution.
>

Generally they make it more difficult to read the code (which is what I
spend 99% of the time doing) without really making it easier to find what's
in the build (which I only spend 1% of the time doing anyway).  The reason
for this latter is because there's a lot of files that look like they're
included but I actually don't care about, while if you go the "#include
foo_bar_gtk.cc" route to handle port-specific implementations, it can make
it harder for your IDE to determine that foo_bar_gtk.cc is an important file
(e.g. by doing "open foo_bar_gtk.cc" in its command line).  (This depends on
the IDE, of course.)

I would prefer to optimize for reading the code for my port, which generally
means as few #ifdefs as possible, and pushing as much logic into the build
system as possible (by including or not including various files).  It
implies things like preferring per-port subclasses to port-specific members
in the parent class, preferring to not include files rather than #ifdef
their contents away... basically, the opposite of all the decisions WebKit
looks to have taken :D

I don't think this is a big deal for most things, and I think the cases
where it is a big deal have been dealt with well when they've come up in the
past (from what I've seen as a third party -- usually Darin Fisher or
someone else on the team is running into them), so don't take this as a
disgruntled complaint against the current system.  It's just my preference.

Now, the thing I _would_ like to change is to switch from pathless #includes
to ones with relative paths -- but that's a totally different thread.

PK

[Attachment #5 (text/html)]

<div class="gmail_quote">On Sun, May 24, 2009 at 10:08 PM, Maciej Stachowiak <span \
dir="ltr">&lt;<a href="mailto:mjs@apple.com">mjs@apple.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex;"> <div style="word-wrap:break-word"><div>I don&#39;t \
think it should be discounted. It might be helpful to clarify why you think ifdefs \
are a bad solution.</div><div></div></div></blockquote><div><br></div><div>Generally \
they make it more difficult to read the code (which is what I spend 99% of the time \
doing) without really making it easier to find what&#39;s in the build (which I only \
spend 1% of the time doing anyway).  The reason for this latter is because \
there&#39;s a lot of files that look like they&#39;re included but I actually \
don&#39;t care about, while if you go the &quot;#include foo_bar_gtk.cc&quot; route \
to handle port-specific implementations, it can make it harder for your IDE to \
determine that foo_bar_gtk.cc is an important file (e.g. by doing &quot;open \
foo_bar_gtk.cc&quot; in its command line).  (This depends on the IDE, of \
course.)</div> <div><br></div><div>I would prefer to optimize for reading the code \
for my port, which generally means as few #ifdefs as possible, and pushing as much \
logic into the build system as possible (by including or not including various \
files).  It implies things like preferring per-port subclasses to port-specific \
members in the parent class, preferring to not include files rather than #ifdef their \
contents away... basically, the opposite of all the decisions WebKit looks to have \
taken :D</div> <div><br></div><div>I don&#39;t think this is a big deal for most \
things, and I think the cases where it is a big deal have been dealt with well when \
they&#39;ve come up in the past (from what I&#39;ve seen as a third party -- usually \
Darin Fisher or someone else on the team is running into them), so don&#39;t take \
this as a disgruntled complaint against the current system.  It&#39;s just my \
preference.</div> <div><br></div><div>Now, the thing I _would_ like to change is to \
switch from pathless #includes to ones with relative paths -- but that&#39;s a \
totally different thread.</div><div><br></div><div>PK</div></div>



_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic