Code does not rot. If it works it works. Only when it has or need to be interfaced with something new, does it need a rewrite. And by then he it may be better to write the function from scratch. Time is life. Are you willing to exchange life, yours or someone else, in order to change something that works for something that may or not work? That said in the rare occasions. Make sure you understand the requirements and don't go into change for the sake on change.Then change what needs to be changed.
rxantos
Posts
-
Strategies to upgrade antiquated C and C++ code to some more modern coding practice. -
AI Economic ModellingIt will probably be like Metal Gear. War is the quickest way to make a profit. And the machine will quickly learn that. Without the military industry complex there would be no Federal Reserve. Without the Federal Reserve there wouldn't be a military industry complex. Two evil organizations that need each other.
-
free memory when constructor throw exceptionIdeally you avoid any activity that would throw an exception in the constructor. Instead of using new on the constructor. Mark the pointers as nullptr and then have a separate init function. But you might try
new (std::nothrow)
which will eat the exception and instead return nullptr. or you can do something like.
try {
ptr = new char[100];
} catch(std::bad_alloc& e) {
// Decide what to do.
}But overall, is a bad idea to throw on a constructor.
-
Mark Zuckerberg thinks AI will start outperforming humans in the next decadeEasy to do when dealing with his users. A random quotes placer would outperform an average Facebook user.
-
What does it take to become an Apple fanboy?A Fanboy is like someone that is in love with a gold digger and sees all the good things but ignores all the bad things. Except that is worse, as at least the person in love with the gold digger do not try to force others into loving the gold digger as well.
-
10 CommandmentsThis looks like someone making his jobs easier, by making everyone else job harder. As I see it, as long as all the people on a project agree to a tab size there is no problem. And using spaces instead of tabs carry the problem that you will need to press the keyboard 4 to 8 times(depending on tab size) to indent and un-indent your code when with a tab you press only once. When in doubt, just put a comment line telling whoever wants to maintain your code your tab size.