Click here to Skip to main content
Click here to Skip to main content
Alternative Tip

Preventing stubbed methods from being released

, 14 Oct 2011
Rate this:
Please Sign up or sign in to vote.
Nice tip! I'm also a proponent of using your friend the preprocessor to stop you from making big mistakes, along with your best friend, the compiler.You can combine both using this alternative code:private bool ValidateUserDetails(string userName, string password){ //TODO: Default value...

Nice tip! I'm also a proponent of using your friend the preprocessor to stop you from making big mistakes, along with your best friend, the compiler.

You can combine both using this alternative code:

private bool ValidateUserDetails(string userName, string password)
{
  //TODO: Default value used for stub - implement this later
  #warning Not Implemented
  return true;
}

with the option "treat warnings as errors" in Release mode.

That has the big advantage of still showing something in the build results when building in Debug, thus inciting your team to go fix the issue before the time comes to make Release builds.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Julien Villers
Team Leader Multicam Systems
France France
No Biography provided
Follow on   Twitter   LinkedIn

Comments and Discussions

 
GeneralReason for my vote of 5 good tip PinmemberRoman_wolf15-Oct-11 6:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web04 | 2.8.140718.1 | Last Updated 14 Oct 2011
Article Copyright 2011 by Julien Villers
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid