Friday, August 9, 2013

compatibility

Exciting stuff today.  I was going to add some manually generated templates to of of my program.  One of the types of things where a user can just kinda click around and get some examples of how things should look or get some general ideas.  And I completed messed myself up by opening the text files in notepad instead of my compiler.  I saw a bunch of random data everywhere and couldn't figure out how my program was still working.  So, I made a few changes to what I thought it should look like to see what happened.  Then before running the program I opened the new file in my compiler and found that it looked even worse than before.  Oh yeah, notepad wasn't showing the line feeds.

I made the changes to what it looked like before, but then I started thinking about compatibility issues.  I have no idea if this will ever be a problem.  I didn't know that sometimes line feeds just aren't read.  That's something I don't want to accidentally run into a while from now when it'll be a lot more work to deal with.  So, I changed my format to a character that I know is going to always be visible (On an unrelated side note, I also just realized I should probably ban format characters). 

After changing the format, the save, and both the read methods, I think that it's been a productive day.  Overall, strong improvements were made to the way that I'm writing code.  I'll have to remember to think about things like this for all of the code that I write.  That way I can say that I'm actually becoming a more well rounded engineer.

No comments:

Post a Comment