[Kde-bindings] PerlQt constructor syntax

Jonathan Yu frequency at cpan.org
Tue Jun 2 13:11:56 UTC 2009


Hi:

Unfortunately, maintaining the existing API isn't something we can do,
because the current API wasn't considered for forward compatibility.
If we keep the existing API as-is, we will be breaking Perl best
practices. (For example, see the discussion about the whole Blah->new
versus Blah(...) constructors)

The existing API is seriously broken and should be considered deprecated.

What we might be able to do is provide a separate compatability API
that will emulate the old style. However, maintaining the earlier API
is bad for CPAN in general and will confuse people familiar with Perl
coding.

Definitely, we are trying to work with Ashley Winters to get the
namespace transferred to us; however until such a time as we hear back
from him, we cannot release anything under the Qt namespace on CPAN
(the PAUSE Indexer will simply mark the release as UNAUTHORIZED and
people will be unable to install it without typing the full path to
the file, ie, F/FR/FREQUENCY/Qt-4.tar.gz)

The Qt4 API is still awhile away from completion. Consider this
advance notice that there are significant changes afoot, and while we
understand that some people may have applications that use the Qt3
API, it's not a reason to freeze the API as-is. Consider what would
happen if HTML was frozen at the version 1.0 style to maintain
compatibility with older parsers. At some point, change needs to
happen, no matter how painful it is (we'll try to make this as
painless as possible; but given the amount of time that has elapsed
between Ashley's Qt modules and the current version, it's unlikely
even Qt itself has a similar enough API for us to maintain
compatibility that far back. Qt3, however, might be okay)

Definitely, though, users of previous versions of software are always
a consideration. We will try our best to provide a clean upgrade path
and I would encourage you to proffer your input there. I'm happy to
try to accommodate your needs, but I feel we have to balance that with
the current generally accepted best practices of CPAN/Perl modules,
not to mention the progress we have made in computer science itself
over the past decade or so.

Here is what I am thinking about as of right now, which should give
you a decent upgrade path. The previous code being something like:

use Qt;
my $button = Qt::PushButton();
.. etc

You would get something like:
Use Qt4::Compat;
my $button = Qt::PushButton();
.. etc

Thus, the only line of code you'd need to change, is to load the Qt4
Compatibility API rather than the Qt3 stuff. It will try to provide as
close an emulation of the old style, without breaking too many things
(there are some limitations like what the CPAN indexer will put up
with; and we cannot override the modules previously uploaded by Ashley
et al. unless they delete them from CPAN, or at least transfer
namespace ownership over to us). So far the latter is pending.

I'd like to hear what you expect the API to be like, or perhaps to
give us a snippet of code you use, so that we can create a
compatibility API around that. Does that sound fair?

Cheers,

Jonathan

2009/6/2 Gary Greene <greeneg at tolharadys.net>:
> On Monday 01 June 2009 12:10:13 pm Eric Wilhelm wrote:
>> # from Jonathan Yu
>>
>> # on Monday 01 June 2009 11:28:
>> >I strongly feel that the Qt4 namespace is most appropriate for this
>> >module. On the other hand, how do we provide a simple upgrade path?
>>
>> I suggest:
>>
>>   use Qt4 as => 'Qt';
>>
>> This calls "Qt4->import(as => 'Qt');", which would then need to install
>> all of the constructor functions in the Qt:: namespace.
>>
>> --Eric
>
> As a person that has more than a fair amount of time invested in PerlQt3 based
> applications, I'd prefer that the syntax be left alone, please. Moving to Qt4
> will require rewriting much of my applications as is, and I'd prefer NOT to
> have to learn a new idiom while having to wrap my head around the heavy
> changes to applications that Qt4 requires. Please just work with Ashley and
> Gerand to get the namespace transferred.
>
> --
> Gary L. Greene, Jr.
> Sent from: peorth.tolharadys.net
>  00:25:38 up 28 days, 16:51,  3 users,  load average: 0.82, 0.78, 0.65
> ==========================================================================
> Developer and Project Lead for the AltimatOS open source project
> Volunteer Developer for the KDE open source project
> See http://www.altimatos.com/ and http://www.kde.org/ for more information
> ==========================================================================
>
> Please avoid sending me Word or PowerPoint attachments.
>
> _______________________________________________
> Kde-bindings mailing list
> Kde-bindings at kde.org
> https://mail.kde.org/mailman/listinfo/kde-bindings
>
>



More information about the Kde-bindings mailing list