Well, sorry for earlier: it is just that if encapsulation is seen as "fighting 
the language", then this is clearly not a good fit for me. And that happened in 
one of the worst times for me: I am basically adapting a multigrid solver 
algorithm to two code bases, one in Python, the other in Fortran.

The work on Python lasted a day, with no specific IDE support... All I had to 
do was to look at the documentation to identify the class I was looking for 
(Density), copy the class somewhere else for the time being, plug the multigrid 
solver in, rename, run tests, add an option to use that new class. I did all of 
that without having a clue about how the remaining 95% of the program works!

I've been working on Fortran's version for more than a week, the code 
constantly reminds me that I need to wrap my head around EVERYTHING!!! The code 
is scattered everywhere with no other reason than "oh, these were just 
different people trying to hack on the code", some strictly identical 
procedures are defined multiple times... except when they are not, there is 
absolutely no indication that anything I do won't prevent the compiler from 
compiling (quite the opposite actually)!

Nim is clearly not as bad as Fortran! However it is not as good as Python 
either...

Leaving the possibility to explicitly import modules fully-qualified with an 
idiomatic construct would at least allow to mimic this kind of class-esque 
behavior that could be handled separately. I agree with @Jehan that modules 
should basically be classes (sorry for the shortcut) in the sense that one 
module should (generally) equal one type + methods. This is one way to scale 
while retaining maintainability by guaranteeing that the content of the module 
is the only thing the developer should care about while solving his problem.

All that said, I don't believe that "classes" are the only way: I don't care 
what the specific solution is as long as, as a consequence, what I described 
with Python above is typically what's happening with Nim. 

(NB: I did not have time to read just everything yet. I'll come back later.)

Reply via email to