Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Advice 2

Status
Not open for further replies.

Arpene

Programmer
Apr 20, 2010
6
DE
Hello Guys

I'm a litlle bit concerned about "good practices" on programming in Fortran.
I'm not a professional programmer. I do use Fortran in my work as a tool.
However, I think, I have already gathered a good knowledge about it, so that now I'd like to optimize the way I write my codes.

Is there some specific literature about it? (I mean: how to write a good code?)
Is this an area that doesn't depends on the language you're using?

I'll be very thankfull for any advice or hint that I could receive from you guys.

Thanks in advance.

Artur
 
Is this an area that doesn't depends on the language you're using?
IMHO it depends of langugage, but mostly of Programming paradigm you are using.
Fortran is a procedural language. When I started to learn programming the good style for procedural languages was called Structured programming.

If you want improve in any programming language, you need the knowledge and experience:
Look at the code written by experienced programmers, try to understand it and learn from them.
Read tutorials, manuals and books about programming.
Practice, writing your own programs.
 
I'd worry more about maintenance and adding debugging and feedback features.

If it takes 5 minutes and a rebuild to increase the array size instead of 5 hours then you've done something right.

Also, from the program output, if you can tell the user what they did wrong, eg matrix ill conditioning, or maybe switch on a flag from the command line or input file to generate more output then that would be useful. The problem is we don't always run in an environment with a debugger or have access to the source code so anything would be useful.

Sometimes it is helpful to put the debug out in CSV format. Pop it into a spreadsheet and you've instantly got something readable without having to format it.
 
Status
Not open for further replies.

Similar threads

Replies
2
Views
31

Part and Inventory Search

Sponsor

Back
Top