Posts

Showing posts with the label Identifiers

ភាសាកម្មវិធី C++៖ អត្តសញ្ញាណសំគាល់

អត្តសញ្ញាណសំគាល់ Identifiers               អថេរភាសាកម្មវិធី C ++ ទាំងអស់ត្រូវតែមានឈ្មោះសំគាល់តែមួយគត់(unique names) ។ ឈ្មោះតែមួយគត់ទាំងនេះហៅថាអត្តសញ្ញាណសំគាល់ (identifiers)។ Identifiers អាចជាឈ្មោះខ្លីៗ ដូជា x និង y ឬអាចវែងជាងនេះ ដូចជា age ឬ sum ឬ total_tolume ជាដើម ។ ចំណាំ៖ ណែនាំឱ្យប្រើដែលមានការឈោ្មះពណ៌នា (descriptive names) ដើម្បីបង្កើតកូដដែលងាយលយ់បាន និងអាចថែរក្សាបាន (maintainable) ។ ឧទាហរណ៍៖ // Good int minutesPerHour = 60; // OK, but not so easy to understand what m actually is int m = 60;