Programming Tip #1

<I know this is going to be incomprehensible for nearly all of my audience, but I wont stop talking about different topics till I manage to get my readership down to 0. The topic might have insights for a wider audience though.>

When programming I have started to find that if I am having trouble convincing something to do what I want it to do, chances are I’m using the wrong tool.

Today I realised this when I was converting constantly between AnsiStrings, integers and std::strings. Everything became much simpler and easier when I started using std::stringstreams, although Borland doesn’t like to call them that it requires that I use the namespace and just use the basic name.

Advertisements

5 responses to “Programming Tip #1

  1. I love stringstreams. Not that I’ve really programmed in C++ for ages.

  2. what was confusing me: thinking that AnsiString is sort of a parrallel for std::string, but AnsiString also borrows some of the concepts of std::stringstreams so the following is valid:

    AnsiString sTmp = AnsiString(“blah”) + int(39);

    and I was trying to replace such lines of code with std::string (because AnsiString is buggy), which doesn’t really work nicely.

  3. You’re right, that went over my head :) .

    I can’t program for shit, that’s why I went into computer graphics.

  4. What is Ansistring anyway? Some borland thing?

  5. yes a terrible evil borland thing. unfortunately they are used by all of the borland gui controls :(

    For that matter they may be a terrible evil Pascal thing :(

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s