We’re rewarding the question askers & reputations are being recalculated! Read more.
    Post Closed as "not constructive" by Joris Timmermans, Kilian Foth, Martijn Pieters, gnat, user53019
5 added 1 characters in body
source | link

I was attempting to identify an element of software engineering that I think is overlooked, not emphasized or not taught in typical undergraduate course work for CS or SE. What I came up is the concept of defensive programming. I would like to hear the community's options on defensive program and/or specific techniques that you use on a regular basis. Also, I would to know if there are any language specific techniques.

Edit:

Just to more clear. I am not looking offor a lesson in defensive program. I understand what it is. I was hoping this would be more of discussion about different method members of the community employ or find valuable. Here are some techniques that I use. Keep in mind that I use C almost exclusively.

Coding standard. You not might initially think that this has anything to do with defensive programming, but it does. To illustrate, suppose your coding standard requires you to prepend variable names with the type of variable it is such as IntValue or UIntValue. The convention allows you to easily spot potential promotion rule issues like (IntX = IntValue * UIntValue)

Use preprocessor macros for constants. Personally, I think this also make your program more readable and maintainable, but it also provided a safety net. You can be sure that all areas of the code that use the macro will be updated when you change the value. Other uses of preprocessor macros can also provided defensive attributes in your code.

Some technique are built right into the language such as static variables or function declarations or in c++ data encapsulation.

Of course there are more obvious ones including validating all your input and output.

I was attempting to identify an element of software engineering that I think is overlooked, not emphasized or not taught in typical undergraduate course work for CS or SE. What I came up is the concept of defensive programming. I would like to hear the community's options on defensive program and/or specific techniques that you use on a regular basis. Also, I would to know if there are any language specific techniques.

Edit:

Just to more clear. I am not looking of a lesson in defensive program. I understand what it is. I was hoping this would be more of discussion about different method members of the community employ or find valuable. Here are some techniques that I use. Keep in mind that I use C almost exclusively.

Coding standard. You not might initially think that this has anything to do with defensive programming, but it does. To illustrate, suppose your coding standard requires you to prepend variable names with the type of variable it is such as IntValue or UIntValue. The convention allows you to easily spot potential promotion rule issues like (IntX = IntValue * UIntValue)

Use preprocessor macros for constants. Personally, I think this also make your program more readable and maintainable, but it also provided a safety net. You can be sure that all areas of the code that use the macro will be updated when you change the value. Other uses of preprocessor macros can also provided defensive attributes in your code.

Some technique are built right into the language such as static variables or function declarations or in c++ data encapsulation.

Of course there are more obvious ones including validating all your input and output.

I was attempting to identify an element of software engineering that I think is overlooked, not emphasized or not taught in typical undergraduate course work for CS or SE. What I came up is the concept of defensive programming. I would like to hear the community's options on defensive program and/or specific techniques that you use on a regular basis. Also, I would to know if there are any language specific techniques.

Edit:

Just to more clear. I am not looking for a lesson in defensive program. I understand what it is. I was hoping this would be more of discussion about different method members of the community employ or find valuable. Here are some techniques that I use. Keep in mind that I use C almost exclusively.

Coding standard. You not might initially think that this has anything to do with defensive programming, but it does. To illustrate, suppose your coding standard requires you to prepend variable names with the type of variable it is such as IntValue or UIntValue. The convention allows you to easily spot potential promotion rule issues like (IntX = IntValue * UIntValue)

Use preprocessor macros for constants. Personally, I think this also make your program more readable and maintainable, but it also provided a safety net. You can be sure that all areas of the code that use the macro will be updated when you change the value. Other uses of preprocessor macros can also provided defensive attributes in your code.

Some technique are built right into the language such as static variables or function declarations or in c++ data encapsulation.

Of course there are more obvious ones including validating all your input and output.

4 corrected spelling
source | link

I was attempting to identify an element of software engineering that I think is overlooked, not emphasized or not taught in typical undergraduate course work for CS or SE. What I came up is the concept of defensive programingprogramming. I would like to hear the communitiescommunity's options on defensive program and/or specific techniques that you use on a regular basis. Also, I would to know if there are any language specific techniques.

Edit:

Just to more clear. I am not looking of a lesson in defensive program. I understand what it is. I was hoping this would be more of discussion about different method members of the community employ or find valuable. Here are some techniques that I use. Keep in mind that I use C almost exclusively.

Coding standard. You not might initially think that this has anything to do with defensive programingprogramming, but it does. To illustrate, suppose your coding standard requires you to perpendprepend variable names with the type of variable it is such as IntValue or UIntValue. The convention allows you to easily spot potential promotion rule issues like (IntX = IntValue * UIntValue)

Use preprocessor macros for constants. Personally, I think this also make your program more readable and maintainable, but it also provided a safety net. You can be sure that all areaareas of the code that use the macro will be updated when you change the value. Other uses of preprocessor macros can also provided defensive attributes in your code.

Some technique are buildbuilt right into the language such as static variables or function declarations or in c++ data encapsulation.

Of course there are more obvious ones including validating all your input and output.

I was attempting to identify an element of software engineering that I think is overlooked, not emphasized or not taught in typical undergraduate course work for CS or SE. What I came up is the concept of defensive programing. I would like to hear the communities options on defensive program and/or specific techniques that you use on a regular basis. Also, I would to know if there are any language specific techniques.

Edit:

Just to more clear. I am not looking of a lesson in defensive program. I understand what it is. I was hoping this would be more of discussion about different method members of the community employ or find valuable. Here are some techniques that I use. Keep in mind that I use C almost exclusively.

Coding standard. You not might initially think that this has anything to do with defensive programing, but it does. To illustrate, suppose your coding standard requires you to perpend variable names with the type of variable it is such as IntValue or UIntValue. The convention allows you to easily spot potential promotion rule issues like (IntX = IntValue * UIntValue)

Use preprocessor macros for constants. Personally, I think this also make your program more readable and maintainable, but it also provided a safety net. You can be sure that all area of the code that use the macro will be updated when you change the value. Other uses of preprocessor macros can also provided defensive attributes in your code.

Some technique are build right into the language such as static variables or function declarations or in c++ data encapsulation.

Of course there are more obvious ones including validating all your input and output.

I was attempting to identify an element of software engineering that I think is overlooked, not emphasized or not taught in typical undergraduate course work for CS or SE. What I came up is the concept of defensive programming. I would like to hear the community's options on defensive program and/or specific techniques that you use on a regular basis. Also, I would to know if there are any language specific techniques.

Edit:

Just to more clear. I am not looking of a lesson in defensive program. I understand what it is. I was hoping this would be more of discussion about different method members of the community employ or find valuable. Here are some techniques that I use. Keep in mind that I use C almost exclusively.

Coding standard. You not might initially think that this has anything to do with defensive programming, but it does. To illustrate, suppose your coding standard requires you to prepend variable names with the type of variable it is such as IntValue or UIntValue. The convention allows you to easily spot potential promotion rule issues like (IntX = IntValue * UIntValue)

Use preprocessor macros for constants. Personally, I think this also make your program more readable and maintainable, but it also provided a safety net. You can be sure that all areas of the code that use the macro will be updated when you change the value. Other uses of preprocessor macros can also provided defensive attributes in your code.

Some technique are built right into the language such as static variables or function declarations or in c++ data encapsulation.

Of course there are more obvious ones including validating all your input and output.

3 added 1030 characters in body
source | link

I was attempting to identify an element of software engineering that I think is overlooked, not emphasized or not taught in typical undergraduate course work for CS or SE. What I came up is the concept of defensive programing. I would like to hear the communities options on defensive program and/or specific techniques that you use on a regular basis. Also, I would to know if there are any language specific techniques.

Edit:

Just to more clear. I am not looking of a lesson in defensive program. I understand what it is. I was hoping this would be more of discussion about different method members of the community employ or find valuable. Here are some techniques that I use. Keep in mind that I use C almost exclusively.

Coding standard. You not might initially think that this has anything to do with defensive programing, but it does. To illustrate, suppose your coding standard requires you to perpend variable names with the type of variable it is such as IntValue or UIntValue. The convention allows you to easily spot potential promotion rule issues like (IntX = IntValue * UIntValue)

Use preprocessor macros for constants. Personally, I think this also make your program more readable and maintainable, but it also provided a safety net. You can be sure that all area of the code that use the macro will be updated when you change the value. Other uses of preprocessor macros can also provided defensive attributes in your code.

Some technique are build right into the language such as static variables or function declarations or in c++ data encapsulation.

Of course there are more obvious ones including validating all your input and output.

I was attempting to identify an element of software engineering that I think is overlooked, not emphasized or not taught in typical undergraduate course work for CS or SE. What I came up is the concept of defensive programing. I would like to hear the communities options on defensive program and/or specific techniques that you use on a regular basis. Also, I would to know if there are any language specific techniques.

Edit:

Just to more clear. I am not looking of a lesson in defensive program. I understand what it is. I was hoping this would be more of discussion about different method members of the community employ or find valuable.

I was attempting to identify an element of software engineering that I think is overlooked, not emphasized or not taught in typical undergraduate course work for CS or SE. What I came up is the concept of defensive programing. I would like to hear the communities options on defensive program and/or specific techniques that you use on a regular basis. Also, I would to know if there are any language specific techniques.

Edit:

Just to more clear. I am not looking of a lesson in defensive program. I understand what it is. I was hoping this would be more of discussion about different method members of the community employ or find valuable. Here are some techniques that I use. Keep in mind that I use C almost exclusively.

Coding standard. You not might initially think that this has anything to do with defensive programing, but it does. To illustrate, suppose your coding standard requires you to perpend variable names with the type of variable it is such as IntValue or UIntValue. The convention allows you to easily spot potential promotion rule issues like (IntX = IntValue * UIntValue)

Use preprocessor macros for constants. Personally, I think this also make your program more readable and maintainable, but it also provided a safety net. You can be sure that all area of the code that use the macro will be updated when you change the value. Other uses of preprocessor macros can also provided defensive attributes in your code.

Some technique are build right into the language such as static variables or function declarations or in c++ data encapsulation.

Of course there are more obvious ones including validating all your input and output.

2 added 226 characters in body; added 4 characters in body
source | link
1
source | link