I wanted to know what was meant by “modules” when applied to FB, so I kept watching this topic. Now it is confirmed that this is a philosophical discussion and that it all comes down to the many individual interpretations of the vague term “module”.
It seems that without any definition, “modules” must be good, just like motherhood and apple pie.
Maybe it is time to define what in the FB a module is, and why and how to implement an FB module.
Does using modules have any advantages?
Richard, at the moment, FB only has the notion of QB/C/C++-like modules (C/C++ call them translation units). Typically, a module comprises of a source file (.bas), which may import the text of include files (.bi). The entire text is then compiled into an object file (.o), which is linked to other object files to produce an executable (or library). So, externally, the smallest "self-contained" grouping of code is the eventual object file. In the past, some QB people have called the source file a module, and the QuickBASIC [the language FB was originally designed to succeed] manual seems to agree:
Any discussion of different types of module schemes doesn't apply to FB as it is now, though it seems that there is some interest in moving away from/deprecating the QB/C/C++/FB scheme. However, any form of encapsulation is generally more beneficial than not. If you have a 50KLOC program, splitting those lines into separate files is useful for the obvious reasons, even if they are ultimately compiled as a single module. When you create multiple modules out of those lines, the benefits increase.BASIC programs consist of one or more modules. A module is a source file
that can be separately compiled.
A module may contain SUB and FUNCTION procedures, as well as code not
directly part of a SUB or FUNCTION. Statements that are not part of a SUB
or FUNCTION are called module-level code. Module-level code includes
declarative statements like DIM and TYPE as well as error-handling and
event-handling code.
A program has one special module, the main module. The main module contains
the entry point of the program (the place where the program starts
running). Each program contains only one main module. In the main module,
module-level code corresponds to what is often called the main program.
Remember that I compiled it on a 233mhz cyrix at that time. :*)Galeon wrote:In time, it is still useful in slow computers. According to relsoft, it took 2 minutes to compile fjrx in his own computer. It is divided in modules, but he compiles it all at once, the default in FbEdit.
BTW, may "globe tatoo" na ako. hahahahahahaha
Internet anytime in 53 kbps since the signal here is only 2g. But 2g is better than "no g". hehehehehe
Anyways, making FJRX into a multi module program made things easier for me. I could use a debugger to debug each module independently. Less headaches.
I use modules because I can easily find a function by reading the file names.
relsoft, alam mo libre ngayon internet ko, nakakatuwa 500mb+ na nga ng Ubuntu programs ang nadownload ko eh, libre pag gabi basta pipilitin mo. Yung SmartBro ko pinakamabilis na ang 150kbps tuwing 1am+, kalimitan >35kbps ung bilis niya, 'di malayo yung sa 'yo.
Yung 233mhz, may iba ding programmers na may ganyang computer kaya nabanggit ko na din.
relsoft, alam mo libre ngayon internet ko, nakakatuwa 500mb+ na nga ng Ubuntu programs ang nadownload ko eh, libre pag gabi basta pipilitin mo. Yung SmartBro ko pinakamabilis na ang 150kbps tuwing 1am+, kalimitan >35kbps ung bilis niya, 'di malayo yung sa 'yo.
Yung 233mhz, may iba ding programmers na may ganyang computer kaya nabanggit ko na din.
hahahahaha. My download speeds would range fronm 0.5 to 2.00 kbps so napakalayo.Galeon wrote:I use modules because I can easily find a function by reading the file names.
relsoft, alam mo libre ngayon internet ko, nakakatuwa 500mb+ na nga ng Ubuntu programs ang nadownload ko eh, libre pag gabi basta pipilitin mo. Yung SmartBro ko pinakamabilis na ang 150kbps tuwing 1am+, kalimitan >35kbps ung bilis niya, 'di malayo yung sa 'yo.
Yung 233mhz, may iba ding programmers na may ganyang computer kaya nabanggit ko na din.
-
- Posts: 72
- Joined: Oct 13, 2006 6:11
- Location: Latte Plantation, Guam
- Contact: