Re: Segmentation Fault?
| From: | Christian Weiske | Date: | Sun, 18 Dec 2005 11:23:53 +0000 |
| Subject: | Re: Segmentation Fault? | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-6428@lists.php.net to get a copy of this message | ||
Hello Anant,
> Was just wondering what a 'segmentation fault' was. It seems to appear
> wherever a PHP-Gtk2 app is implemented in OOP style. The error doesn't
> seem to occur in the same app implemented procedure style. Of course,
> I am new to OOPS so I could have done something wrong there!
A segmentation fault is a really bad crash. It has nothing to do how you
are programming - it's a bug in php-gtk2.
If you come across one, please try to reduce the code which causes it to
a minimum, so that we have a running (or crashing in that way :))
example of that segfault. That makes it easier to track down the problem
and fix it. The "minimal code" is very important, because it doesn't
help if someone tells "my code crashes" and attaches 200kb of code - the
crash could be everywhere, but having only the most necessary parts
reduces the time required for finding the fault position a lot.
> Is there really any advantage in programming OOP style? PHP-GTK itself
Yes, definitely. It would take longer to explain, but after
dontknowhowmany years of programming I don't want to miss it.
If you are writing small tools, don't using oop is mostly no problem.
But as soon as your code takes more than 15kb (don't take that as a hard
border) and will grow in future, you will get serious problems.
> On another note, I was just curious about the .phpw extension. The 'w'
> is just a random character chosen to differentiate between PHP-Gtk
> apps and regular php scripts, or is there any historical significance?
> ;-)
w is for "windowed" - so it's "windowed php application".
Historically there have been two flame wars in php-gtk-general some
years (or one?) ago, but brought nothing except that some old schoolers
didn't want another file extension. At first I stuck to ".php-gtk", but
that was too specific to just gtk. As you might know, there is a
tcl/tk-extension for php and the winbinder, which both you can use to
write GUIs with. So somebody wrote that "phpw" for "windowed php app"
would be a good idea - and I stuck with it.
Btw, Ruby uses "rb" for normal script files and "rbw" for graphical apps.
--
Regards/MfG,
Christian Weiske
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc