I'm about to get back into programming after 30 years.
I want to learn the right way to make my code, the Linux kernel style that is easy to read and edit., such as indent with 8 spaces and such, so if I share or release my code it can be much more productive in a team environment.
Assume I have no knolege of programming what so ever, and please recommend a hard print book for me to buy that uses the most standard Linux IDE that will run on both Linux and Windows, thanks.
Learning C++ Linux kernel style the first time
Re: Learning C++ Linux kernel style the first time
There are many styles and conventions. It is up to the team, what style they prefer or require.
Linux kernel style can be found with websearch: https://www.kernel.org/doc/Documentatio ... -style.rst
Note though that there is no "C++ Linux kernel style" because Linux kernel is not written with C++.
Linux kernel style can be found with websearch: https://www.kernel.org/doc/Documentatio ... -style.rst
Note though that there is no "C++ Linux kernel style" because Linux kernel is not written with C++.
Re: Learning C++ Linux kernel style the first time
I need to learn C and then eventually to the object orientation, I'm just asking for a way to start learning that will instill good practices such as an indent of 8, keeping each line short, a good way to keep code readable so it can be edited.
Example: when I look at code from the Microsoft coder it's all jumbled up up, not much indent, very difficult to see what's going on as if they are hiding something.
Then I look a CentOS package code that is much easier to read and edit....... simply typing "Make" will compile a useable executable under Linux or even Windows using a MinGW console.
If it was a video game, I can easily find and change the power of a 45cal pistol from dmg = 23 to dmg = 46
The Window game programmer has these setting burried so deep I'll never find the setting, and even if I did find it, that changed setting may mess up other setting that I don't intend to change.
I basically want to learn GOOD PRACTICE that allows me to code quickly vs bad practice that is slow and difficult to find and make changes.
I want to be able to easily spot a mistake and fix it.
Example: when I look at code from the Microsoft coder it's all jumbled up up, not much indent, very difficult to see what's going on as if they are hiding something.
Then I look a CentOS package code that is much easier to read and edit....... simply typing "Make" will compile a useable executable under Linux or even Windows using a MinGW console.
If it was a video game, I can easily find and change the power of a 45cal pistol from dmg = 23 to dmg = 46
The Window game programmer has these setting burried so deep I'll never find the setting, and even if I did find it, that changed setting may mess up other setting that I don't intend to change.
I basically want to learn GOOD PRACTICE that allows me to code quickly vs bad practice that is slow and difficult to find and make changes.
I want to be able to easily spot a mistake and fix it.
Re: Learning C++ Linux kernel style the first time
Basically I want a book that will allow me to learn GOOD practice from the start, assuming I have no knolege of programming at all, so I can follow the instructions to learn and at the same time build good habits within myself.
The link you gave above is exactly what I'm talking about, I can clearly see what is going on and reguardless what I'm coding, that's how I want my code to look, I want a book that will show me to code like this.
The link you gave above is exactly what I'm talking about, I can clearly see what is going on and reguardless what I'm coding, that's how I want my code to look, I want a book that will show me to code like this.
Re: Learning C++ Linux kernel style the first time
One can write code that is heavenly gorgeous to look at, yet pointless.
For a book, perhaps:
https://dl.acm.org/citation.cfm?id=993828
https://herbsutter.com/elements-of-modern-c-style/
For a book, perhaps:
https://dl.acm.org/citation.cfm?id=993828
https://herbsutter.com/elements-of-modern-c-style/
Re: Learning C++ Linux kernel style the first time
True, but IMHO rarely write ugly code that is effective.