পৃষ্ঠাসমূহ

Search Your Article

CS

 

Welcome to GoogleDG – your one-stop destination for free learning resources, guides, and digital tools.

At GoogleDG, we believe that knowledge should be accessible to everyone. Our mission is to provide readers with valuable ebooks, tutorials, and tech-related content that makes learning easier, faster, and more enjoyable.

What We Offer:

  • 📘 Free & Helpful Ebooks – covering education, technology, self-development, and more.

  • 💻 Step-by-Step Tutorials – practical guides on digital tools, apps, and software.

  • 🌐 Tech Updates & Tips – simplified information to keep you informed in the fast-changing digital world.

  • 🎯 Learning Support – resources designed to support students, professionals, and lifelong learners.

    Latest world News 

     

Our Vision

To create a digital knowledge hub where anyone, from beginners to advanced learners, can find trustworthy resources and grow their skills.

Why Choose Us?

✔ Simple explanations of complex topics
✔ 100% free access to resources
✔ Regularly updated content
✔ A community that values knowledge sharing

We are continuously working to expand our content library and provide readers with the most useful and relevant digital learning materials.

📩 If you’d like to connect, share feedback, or suggest topics, feel free to reach us through the Contact page.

Pageviews

Wednesday, February 1, 2017

Fortran - Programming Style

Programming style is all about following some rules while developing programs. These good practices impart values like readability, and unambiguity into your program.
A good program should have the following characteristics:
  • Readability
  • Proper logical structure
  • Self-explanatory notes and comments
For example, if you make a comment like the following, it will not be of much help:
! loop from 1 to 10 
do i=1,10  
However, if you are calculating binomial coefficient, and need this loop for nCr then a comment like this will be helpful:
! loop to calculate nCr 
do i=1,10
  • Indented code blocks to make various levels of code clear.
  • Self-checking codes to ensure there will be no numerical errors like division by zero, square root of a negative real number or logarithm of a negative real number.
  • Including codes that ensure variables do not take illegal or out of range values, i.e., input validation.
  • Not putting checks where it would be unnecessary and slows down the execution. For example:
real :: x 
x = sin(y) + 1.0

if (x >= 0.0) then
   z = sqrt(x)
end if
  • Clearly written code using appropriate algorithms.
  • Splitting the long expressions using the continuation marker ‘&’.
  • Making meaningful variable names.

No comments:

Post a Comment