557313 (9) [Avatar] Offline
#1
Hello,
In chapter 3 when modules are discussed and compared to functions and subroutines, perhaps it would be good to mention that modules are also useful to declare derived data types. Even if derived data types will be covered in a later chapter in more detail, a mention in ch. 3 could get that idea in the reader's mind early on. I like the ease of including modules in each routine that needs to get the derived data type definition.

In another discussion topic you asked about dividing ch. 3 into two chapters to cover modules separately from subroutines and functions. A separate chapter could be good, or having more sections in ch. 3 works well too. I feel that describing all three in ch. 3 with a quick comparison is a good introduction, which could be followed later by a chapter to discuss modules in more detail. If modules were moved to a separate chapter, that would allow the discussion of other features of modules to be gathered into one chapter.

Regards, Greg
Milan Curcic (26) [Avatar] Offline
#2
Hi Greg,

Thank you for the suggestion -- I think it's a good idea to mention derived types here.

I am now strongly considering giving modules a dedicated chapter, which would give me space to protected variables (currently not even mentioned) and submodules.

Best,
milan
557313 (9) [Avatar] Offline
#3
Hi Milan,

A chapter on modules and details about the useful features they provide (protected variables, derived data types, etc.) sounds great to me. Would you recast the wave example to use modules for comparison to using functions and subroutines?

Regards, Greg
Milan Curcic (26) [Avatar] Offline
#4
Hi Greg,

Not sure about "comparison", but if I split Ch3 into Chs 3 and 4, then:

* In Ch3, we'd use functions and subroutines without modules, that is we'd define them inside the main program
* In Ch4, we'd define the functions and subroutines in modules, and the main program would access them from there, like we do currently.

So not a side-by-side comparison, but Ch3 would be a stepping stone toward Ch4. Does this make sense?

Thanks!!
milan
557313 (9) [Avatar] Offline
#5
Hi Milan,

It does make good sense to me to show the same example program using subroutines/functions in Ch. 3, and then same program again in Ch. 4 using modules. I feel that would provide a great example giving readers the chance to see the same program implemented using the two different approaches.

Regards, Greg