Jump to content

  • Log In with Google      Sign In   
  • Create Account


How often do you revisit your hacky solutions or "ToFix" comments?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
27 replies to this topic

Poll: How often do you revisit your hacky solutions or "ToFix" comments? (47 member(s) have cast votes)

How often?

  1. Always (13 votes [27.66%])

    Percentage of vote: 27.66%

  2. Sometimes, when i have the time (19 votes [40.43%])

    Percentage of vote: 40.43%

  3. Pretty much never unless it finally breaks (15 votes [31.91%])

    Percentage of vote: 31.91%

Vote Guests cannot vote

#21 Memories are Better   Prime Members   -  Reputation: 769

Posted 19 October 2013 - 07:28 PM

Always, although I never use TODO for fixes or for hacks (never even used the HACKED task), in fact all I use TODO for is for future additions to the project that I want but don't have time to implement yet. For fixes / hack checking isn't that best done through unit tests and have full code coverage of the area, at least that way it would always fail until you fix it and you can apply the assertion checks globally too if necessary as a fix in one area could just give birth to a bug in another.

 

Edit: Ofc this isn't always the easiest way to test graphics / sound / scene logic issues but then sticking a TODO flag may not be the most efficient method either, well not for me at least anyway


Edited by Dynamo_Maestro, 20 October 2013 - 04:45 AM.


Sponsor:

#22 Luckless   Crossbones+   -  Reputation: 1730

Posted 20 October 2013 - 10:09 AM

Code can pass any and all unit tests you could write, but still be in dire need of fixing/improvement. Performance issues, working well with future expansion, etc. Lots of reasons to still maintain a ToDo list along side other things.


Old Username: Talroth
If your signature on a web forum takes up more space than your average post, then you are doing things wrong.

#23 Memories are Better   Prime Members   -  Reputation: 769

Posted 20 October 2013 - 02:39 PM

Code can pass any and all unit tests you could write, but still be in dire need of fixing/improvement. Performance issues, working well with future expansion, etc. Lots of reasons to still maintain a ToDo list along side other things.

 

I agree, I am not saying TODOs are bad I am just saying I never use them for 'fixing' stuff or for anything important for that matter, for extending projects they are great, things typically not part of the project gantt (which is directly connected to my code work items via TFS) but could be a great addition, a wish list I guess. I think my post may have made it look like task lists in general are bad, this isn't the case, im not sure how other version controls work or how others manage but for me it is VERY important for me to ermm analyse, schedule my project work outside code if that makes sense. TFS and ofc VS have some excellent ways to do this, so I cant really use TODO for anything other than a unexpected wish list I guess.

 

I don't think this is an uncommon way of doing things either, as these are all built in features.



#24 Servant of the Lord   Crossbones+   -  Reputation: 17961

Posted 20 October 2013 - 04:43 PM

That code looks pretty dodgy to me.


I should actually use &str[0] to get a non-const pointer to the internal data... oops. That'll let me avoid the const_cast, but it'll do the same thing anyway. Really, they ought to just make .data() return a non-const pointer. rolleyes.gif

 
Hmmm, come to think of it, &str[0] also ensures that compiler implementations doing clever things behind the scenes like copy-on-write strings handle the situation correctly. GCC iirc, still uses COW for relatively recent versions of the compiler. C++11 requires std::string to not be COW, but last I heard GCC hadn't yet changed their std::string implementation. So my const_cast actually could be buggy.

I still think .data() ought to return a non-const pointer. wink.png


Edited by Servant of the Lord, 20 October 2013 - 04:44 PM.

It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.

[Fly with me on Twitter] [Google+] [My broken website]

All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.                                                                                                                                                            [Need web hosting? I personally like A Small Orange]
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal


#25 Paradigm Shifter   Crossbones+   -  Reputation: 5203

Posted 20 October 2013 - 05:16 PM

If you are worried so much about performance you can't read the data into an intermediate buffer, you are probably reading too few bytes of data which is likely inefficient.


"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

#26 Orymus3   Crossbones+   -  Reputation: 6837

Posted 21 October 2013 - 10:51 AM

and you have close to a normal distribution now...



#27 alnite   Crossbones+   -  Reputation: 2061

Posted 24 October 2013 - 07:19 PM

Always.

 

I always reread and reread my code.  This is my typical workflow:

 

Write -> Test -> Read -> Write -> Read -> Test -> Read -> Test -> Read -> Write -> Read -> Test -> Read -> Test -> Read -> Commit -> Read -> Read -> Refactor -> Test -> Read -> Refactor -> Read... and so on

 

those TODOs won't survive the endless rereads.


Edited by alnite, 24 October 2013 - 07:20 PM.


#28 Sirisian   Crossbones+   -  Reputation: 1672

Posted 26 October 2013 - 02:36 AM

I can't move forward with code until my current solution is to my satisfaction. I've iterated on code for a week or more on personal projects verifying a design. I'll get done with it and more often than not decide on a cleaner design or algorithm. There are no TODO comments. I makes my coding very slow, but it's code I'll go back and look at later and reuse.

 

It's interesting at work I have to maintain and fix bugs. I don't know how to put it nicely, but it's horribly designed and prone to error with >50% comments or commented out code where most of the comments don't match what the code does. (Not the new projects, but old ones). It's weird seeing the difference in coding styles. I ran into one part while fixing a bug where a previous developer had copy and pasted some code in like 10 places and made a change to like 3 of them and forgot the rest leading to very weird behavior. My favorite one the other day was "// Does this even work?" while looking for a bug my breakpoint lands on that. "no is the answer, are you kidding me?" Good times. The code is filled with TODO statements and it wasn't really written in a rush.


Edited by Sirisian, 26 October 2013 - 02:39 AM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS