ADDITIONAL CONTENTS FOR CHAPTER 9

অধ্যায় 9 ৰ বাবে অতিৰিক্ত সমল

A. Tips for good programming practice

উ. ভাল প্ৰ’গ্ৰামিং অনুশীলনৰ বাবে পৰামৰ্শ

The ability to write good programs is always appreciated. Good programs many things: easy to read, faster execution, lesser memory requirement and other. Let us have some simple tips to make a program easier to read.

ভাল প্ৰ’গ্ৰাম লিখাৰ সামৰ্থ্য সদায়প্ৰশংসিত হয়। ভাল প্ৰ’গ্ৰাম বোৰ বহুতো বস্তু: পঢ়িবলৈ সহজ, দ্ৰুত কাৰ্যকৰীকৰণ, কম স্মৃতিৰ প্ৰয়োজনীয়তা আৰু অন্যান্য। প্ৰ’গ্ৰাম এটা পঢ়িবলৈ সহজ কৰি তুলিবলৈ আমাৰ ওচৰত কিছুমান সৰল পৰামৰ্শ আহক।

1.variable naming: Variable used in the program should be named appropriately. The name should represent its purpose. For example, if we need to store the roll number of a student, some appropriate proper variable names can be roll Number, roll No, roll, etc.

1.পৰিৱৰ্তনশীল নামকৰণ: প্ৰ’গ্ৰামত ব্যৱহৃত চলকৰ নাম সঠিকভাৱে উল্লেখ কৰিব লাগে। নামটোৱে ইয়াৰ উদ্দেশ্য প্ৰতিনিধিত্ব কৰিব লাগে। উদাহৰণ স্বৰূপে, যদি আমি এজন শিক্ষাৰ্থীৰ ৰোল নম্বৰ সংৰক্ষণ কৰাৰ প্ৰয়োজন হয়, কিছুমান উপযুক্ত সঠিক পৰিৱৰ্তনশীল নাম হ’ব পাৰে ৰোল নম্বৰ, ৰোল নম্বৰ, ৰোল ইত্যাদি।

2. proper indentation: The program should look good. The lines in the program should be properly justified. Figure 9.1shows this clearly.

সঠিক ইণ্ডেণ্টেচন: প্ৰ’গ্ৰামটো ভাল দেখাব লাগে। কাৰ্যসূচীৰ শাৰীবোৰ সঠিকভাৱে ন্যায়সঙ্গত হ’ব লাগে। চিত্ৰ 9.1-এ এইটো স্পষ্টভাৱে দেখুৱায়।

3. Writing comments : it is a good practice to write comments along with the program. Comments will not be executed by the compiler. But these will help when we read the program at a later point in time. Comments are also helpful when someone else needs to go through the program for making some changes in it. This situation is so common in an industry where programs are written by many people in a team. Example B.5 shows a well commented program in C. When we want to comment a single line in C programming, we put double slash (//). When we want to comment more than one line , we enclose them inside /* and */.

Whenever you write a program now onwards, you should always try to follow the above mentioned tips. You may also follow other tips you acquire from other genuine sources. This will help you to become a good coder oneday!

যেতিয়াই আপুনি এতিয়াৰ পৰা প্ৰ’গ্ৰাম এটা লিখে, আপুনি সদায়ে ওপৰোক্ত পৰামৰ্শবোৰ অনুসৰণ কৰিবলৈ চেষ্টা কৰা উচিত। আপুনি আন প্ৰকৃত উৎসৰ পৰা প্ৰাপ্ত কৰা আন পৰামৰ্শবোৰো অনুসৰণ কৰিব পাৰে। ই আপোনাক এদিন এজন ভাল কোডাৰ হোৱাত সহায় কৰিব!

All these rules are not followed in all example program because you are the beginner of the programming language and seeing many comments (or lengthy variable names) inside the programs may hamper your learning.

এই সকলোবোৰ নিয়ম সকলো উদাহৰণ প্ৰ’গ্ৰামত অনুসৰণ কৰা নহয় কিয়নো আপুনি প্ৰ’গ্ৰামিং ভাষাৰ আৰম্ভণি আৰু প্ৰ’গ্ৰামবোৰৰ ভিতৰত বহুতো মন্তব্য (বা দীঘলীয়া পৰিৱৰ্তনশীল নাম) দেখিলে আপোনাৰ শিকাত বাধা হ’ব পাৰে।