:: Re: [DNG] Experiencing with GtkBuil…
Forside
Slet denne besked
Besvar denne besked
Skribent: Edward Bartolo
Dato:  
Til: Steve Litt
CC: dng
Emne: Re: [DNG] Experiencing with GtkBuilder
Hi Steve et al,

The only problem that comes to my mind about Lazarus and Pascal, is
many Linux users would not have a Pascal compiler (fpc)
installed on their machines. Consequently, netman will fail to build
while other packages coded in C and C++ would build without problems.
Users have a tendency to judge such a temporary failure as a bad
indication which may dissuade them from using netman.

A literal translation is definitely not the best appoach, but functions
that are my programming can still be translated, while the GUI is
created with glade and the corresponding event handlers set up. That
should provide a good working GUI skeleton which we should be able to
fleshen-up with translated code.

The above would go like this:
a) the classes for the main form and dialog box would be merged into
one basic class essentially without any ancestors. This would imply,
we would have only a collection of methods and their data encapsulated
in a class.
b) the GUI would be created using glade and the corresponding events set up.
c) a global object instance would be created using the translated
class that exposes the translated methods. These methods would be
called inside the newly created event handlers.

I think, this way, the translator should remain efficient and readable.

Edward


On 24/11/2015, Steve Litt <slitt@???> wrote:
> On Tue, 24 Nov 2015 06:02:42 +0100
> Edward Bartolo <edbarx@???> wrote:
>
>> Hi Aitor et al,
>>
>> What about directly translating the Object Pascal code into C instead
>> of doing a reimplementation of the logic? I remember, once I had a
>> Pascal class that took me six months to write which I translated into
>> C++ within a month. I think, this is the most practical approach.
>>
>> There are also Pascal into C translators which I am thinking of trying
>> although the translated code would still need inspection before
>> deployment.
>>
>> Edward
>
> Oh HELL no!
>
> Pascal's a good language that compiles to highly efficient executables.
> The point is that *Lazarus* is a drag and drop Rapid Application
> Development (RAD) environment that happens to work with Pascal. But it's
> optimized to be quick development, not create good Pascal algorithms.
> The Pascal it creates is mostly scaffolding. So you'll be translating
> incredibly de-optimized Pascal into C, and you'll end up with a huge
> swarming mess of unreadable C. People will observer that it works, but
> nobody will be able to modify it, because they won't be able to fathom
> the fundamental design of the program from the code.
>
> I don't see the problem with Lazarus. It's a drag and drop RAD suitable
> for quick GUI development. A client to wpa_supplicant or however you're
> doing this doesn't need to be lightning quick or close to the metal or
> even particularly parsimonious with RAM, so what's the problem? And
> once your program is done, and the user interface is perfect, THEN you
> or others can use your program as a prototype and code other versions
> of it.
>
> Don't translate the Lazarus created Pascal to C. That would be a
> horrible decision.
>
> SteveT
>
> Steve Litt
> November 2015 featured book: Troubleshooting Techniques
>      of the Successful Technologist
> http://www.troubleshooters.com/techniques
> _______________________________________________
> Dng mailing list
> Dng@???
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng

>