The bad practice is to use an object (.pmod) as type and not a program (class/.pike).
/ Martin Nilsson (DivX Networks)
Previous text:
2004-10-14 09:23: Subject: Re: distinction between modules and classes? (Was: Re: MySQL big_query in 7.7)
Thanks. This verifies what I've learned so far. So my remaining ?-mark is what mast referred to as bad practice regarding the muddling with modules and classes.. didn't quite follow the discussion about inheritance and so (what was, and why, a bad idea). But it might fall into place later on..
Marcus Agehall (PacketFront) @ Pike (-) developers forum wrote:
I think of modules as objects without programs and classes as instances of some program. A module is normally a .pmod file and a class is implemented in a .pike file.
The main difference is, that the module only exists in one instance. You cannot create multiple instances of it whereas the class can be instantiated into several instances.
I'm sure mast, grubba or Nilsson or someone else can give a more detailed and technical explanation of classes vs modules but that is what I consider the most important difference.
/ Marcus Agehall (PacketFront)
Previous text:
2004-10-14 09:07: Subject: distinction between modules and classes? (Was: Re: MySQL big_query in 7.7)
Martin Stjernholm, Roxen IS @ Pike developers forum wrote: [...]
But the worst is that it might give other users the impression that that sort of thing is a good idea, especially those who don't have a clear understanding of the distinction between classes and modules.
/ Martin Stjernholm, Roxen IS
I'm not sure I have a clear understanding of the distinction. Is it documented somewhere, or is it appropriate to ask for a brief explanation?
Looking at the pike tutorial (http://pike.ida.liu.se/docs/tutorial/) I get the feeling that modules is .pmod files and classes is .pike files (or a class{ ... } in any of these). But my only conclusion to this is that modules then will be pre-created by the pike compiler, ready to be used whenever referenced, and classes needs to be cloned before use. As has been made clear to me in previous discussions about pike modules.
What part is 'muddling with the distinction between modules and classes' ? Is it when inheriting a module into a class.. ?
// Andreas
/ Brevbäraren
/ Brevbäraren