Re: [tsc-devel] Question on SFML Rewrite Strategy - To comment old code or not to comment...

Quintus | Fri, 16 Oct 2015 16:48:34 UTC

datahead <…r@f…> writes:
> I've been wondering what
> your general strategy is for deciding whether to comment out existing
> legacy OpenGL/SDL code as opposed to allowing it to run side by side
> with ported SFML code.

My working cycle is currently like this:

1. Find code using legacy SDL/OpenGL
2. Copy it over to the SFML port
3. Comment it out completely, leaving these “// OLD” comments
4. Port it to SFML line-by-line, removing the “// OLD” comments
   one by one.
5. Test if the change worked.
6. Commit the change.
7. If there are still “// OLD” comments remaining, go to 4. Otherwise go
   to 1.

That way there will be absolutely no OpenGL or SDL code left, and the
“// OLD” comments ensure that anyone browsing the code immediately
notices that there’s something unported in that section.

> How do you decide whether unconverted portions
> of code should be commented out or allowed to run for the time being
> with converted SFML code?

Due to my lack of OpenGL knowledge, I have just ported everything I was
able to. If you say “you can leave this in, it works still under SFML”
that’s okay for now as it’s more important to get the nonportable code
transformed (which is mostly the SDL-related stuff I guess).

> To comment or not to comment - that is the question you faced...

It is hard to say whether it’s nobler in the mind to suffer the slings
and arrows of outrageous fortune, or to take arms against a sea of
troubles.

Vale,
Quintus

-- 
#!/sbin/quintus
Blog: http://www.guelkerdev.de

GnuPG key: F1D8799FBCC8BC4F