Comments (5)
Is the reason to append _t
as in user_t
so that the variable can be named user
, as in type(user_t) :: user
?
It might be helpful to go over the most popular codes listed in https://github.com/fortran-lang/stdlib/wiki/List-of-popular-open-source-Fortran-projects and see what conventions they use and list them here, so that we can make a more informed decision.
from stdlib.
Yes and also to allow the module that contains the class/type to be named with a similar name so that there is no conflict.
ie
Module userClass
Type :: UserClass_t
This is one of the things recommended in Clerman and Spector's very excellent book, "Modern Fortran, Style and Usage" although I saw it used by other folks prior to their book. Again just another way of avoiding naming conflicts. Note you can always rename it on USE if you prefer in your code. Just makes the name somewhat unique. Adding an _et for extended types just gives you a visual signal in the source that the type is extended from something else when the original code author might have chosen to make all or parts of the class private.
from stdlib.
FWIW, my convention is also similar to the above one (i.e., UserClass_t) such that it does not interfere with local variable names. I also sometimes rename it into a shorter one (e.g., FB_t => FooBaa_t) when importing it in a local module (if I want to type less). But I am also interested in other conventions.
from stdlib.
The appended _t
for types and _m
for modules is also found in the "opinionated" best Fortran practices: https://github.com/Fortran-FOSS-Programmers/Best_Practices
Sometimes I also go for the longer _type
to be more explicit. The iso_fortran_env
module contains a lock_type
as example.
from stdlib.
So far we've been using a _type
suffix though not 100% consistently:
stdlib_bitsets
providesbitset_type
, but alsobitset_64
andbitset_large
that extendbitset_type
. The latter two should be renamed tobitset_64_type
andbitset_large_type
.stdlib_logger
provideslogger_type
stdlib_string_type
providesstring_type
I opened #332 to solicit feedback about making the convention 100% consistent. But otherwise, we have a good enough convention so I will close this.
from stdlib.
Related Issues (20)
- Support sorting arrays of bitsets HOT 2
- bitset count performance HOT 10
- A runtime error occurs when assigning a variable of `bitset_large` HOT 7
- Incorrect result for gamma functions of pure imaginary argument HOT 5
- Test: string_intrinsic (move) failed built with GCC 13.2 HOT 3
- Adding a procedure getting all keys in the hashmaps HOT 2
- Improve fpm build in README for faster getting started HOT 1
- test fault by string_intrisic HOT 1
- 'Sleep' not working when compiled in Win32 (x86) HOT 9
- Compilation error on Linux. Disabling hash/hashmap files compiles rest of the project successfully. HOT 6
- `string_intrinsic (Subprocess aborted)` failed HOT 7
- `bits()` in `bitset_type` returned a non-zero value even though no value is set. HOT 1
- Support for linear algebra HOT 6
- Hashtable write error on exit HOT 7
- use stdlib_math, only : gcd HOT 4
- The file src/stdlib_hashmap_chaining.f90 and two others are set as executable HOT 1
- Support for I/O of standard formats HOT 10
- Memory mapped features HOT 9
- Add `.gitignore` to `stdlib-fpm` deployment for generated test files HOT 1
- hash_functions test fails on i386: `Segmentation fault - invalid memory reference`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stdlib.