General Programming Information¶
Application and Library¶
The purpose of programming is to develop softwares/programs. There are many ways to categorize software entities. I prefer to generalize them into applications and libraries for teaching purposes. Applications are more commonly see in the courses as ad-hoc solutions to problems. They focus on executables that can be executed to finish some tasks. Libraries are reusable code entities. They focus on providing functions, classes, configurations, etc. to support programming of applications or other libraries.
Programming Languages¶
Programming languages can be categorized from many perspectives. Some of the commonly employed code categorizations are listed below:
Compiled, Interpreted
Typed, Untyped
High-level, Low-level
General purpose, Domain specific
Declarative
Logical
Procedural
Functional
Object-oriented
class-based
not class-based
Language |
Tags |
---|---|
Java |
Compiled+Interpreted, Typed, High-level, Object-oriented, Class-based, General purpose |
C++ |
Compiled, Typed, High-level, Object-oriented, Class-based, General purpose |
Python |
Interpreted, Untyped, High-level, Object-oriented, Class-based, General purpose |
C |
Compiled, Typed, High-level, Procedural, General purpose |
Javascript |
Interpreted, Untyped, High-level, Object-oriented, not class-based, General purpose |
SQL |
Interpreted, High-level, Declarative, Domain specific |
Coding style¶
A coding style includes naming, formatting, indentation, blank spacing, comment and documentation. It affects the readability and maintainability of source code files.
There are many coding style conventions as part of coding standards or guidelines from various companies, universities, and organizations. They are widely adopted and confirmed to be effective. Choose one to follow and stick to it. Many programmer’s editors and IDEs have built-in support to them.
If your instructor requires everyone to follow a certain style, follow it! It will help the communication, teaching and grading process a lot.
The minimum requirement is to be consistent. Do not mix styles in one project.
Sometimes you will be working with existing code and it is a good idea to align the code style to the existing one.
Comments and Documentations¶
Documentations are special comments employed to provide documents for programs, functions, classes, and class members; They are employed to provide reference to the user of the program on how the entities can/should be used. Tools like Doxygen, Sphinx can extract documentations from source code files and create standalone documentation in sharable format like HTML, PDF, etc.
Explains a line or a code snippet; To be used by the programmer about the internal details that cannot be easily learned from direct code reading. They are also employed to mark important places in the source code where everyone should pay attention. Tags like TODO, FIXME, WIP are commonly seen in comments in unfinished codes. Comments in finished code can be avoid most of the time with proper naming of variables, functions, classes, namespaces, etc.