code_junkie

How do you flag code so that you can come back later and work on it?

Nov 12th, 2011
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. #warning This is dirty code...
  2. #error Fix this before everything explodes!
  3.  
  4. PutTheUpdateCodeHere();
  5.  
  6. #error finish this
  7.  
  8. try
  9. {
  10. //do stuff
  11. return true;
  12. }
  13. catch // no idea how to prevent an exception here at the moment, this make it work for now...
  14. {
  15. if (DateTime.Today > new DateTime(2007, 2, 7))
  16. throw new InvalidOperationException("fix me already!! no catching exceptions like this!");
  17. return false;
  18. }
  19.  
  20. // TODO: <explanation>
  21.  
  22. // FIXME: <explanation>
  23.  
  24. //TODO: Finish this
  25.  
  26. class ToDo_helper
  27. {
  28. public:
  29. ToDo_helper(const std::string& msg, const char* file, int line)
  30. {
  31. std::string header(79, '*');
  32. Log(LOG_WARNING) << header << 'n'
  33. << " TO DO:n"
  34. << " Task: " << msg << 'n'
  35. << " File: " << file << 'n'
  36. << " Line: " << line << 'n'
  37. << header;
  38. }
  39. };
  40.  
  41. #define TODO_HELPER_2(X, file, line)
  42. static Error::ToDo_helper tdh##line(X, file, line)
  43.  
  44. #define TODO_HELPER_1(X, file, line) TODO_HELPER_2(X, file, line)
  45. #define ToDo(X) TODO_HELPER_1(X, __FILE__, __LINE__)
  46.  
  47. void some_unfinished_business() {
  48. ToDo("Take care of unfinished business");
  49. }
  50.  
  51. // REVIEW - RP - Is this the best way to achieve x? Could we use algorithm y?
  52.  
  53. // REFACTOR - should pull this method up and remove near-dupe code in XYZ.cs
Add Comment
Please, Sign In to add comment