Like Tree2Likes
  • 1 Post By phantomotap
  • 1 Post By phantomotap

My attempt at FileHandling up for your inspection

This is a discussion on My attempt at FileHandling up for your inspection within the C++ Programming forums, part of the General Programming Boards category; Ok, I'm not to sure what to put in and what to leave out, so I'm just going to put ...

  1. #1
    Registered User
    Join Date
    Aug 2012
    Posts
    10

    My attempt at FileHandling up for your inspection

    Ok, I'm not to sure what to put in and what to leave out, so I'm just going to put it all out there. I'm going to attempt to format this as best I can for ease of readability.
    Fair warning: Some of what I'm going to say here isn't going to make sense if you haven't read my other thread (Which I will add a link to for completeness shortly).

    ******************************
    Index:

    1. Why I chose to do this.
    2. What it's supposed to do.
    3. Problems with my implementation.
    4. The 'Why' section.
    5. Things I haven't used before (and probably messed up)
    6. My environment
    7. Code
    8. Why did I post this?

    ******************************

    === Section 1: Why I chose to do this ===
    Almost every programmer I've read about or talked to has told me that the easiest way to learn programming is to have a project. While I have that database program I want to write for a family friend, I feel I should put that one off for later as it involves a lot of advanced stuff (Encryption, Network synchronization, advanced database features, etc). So I chose this project; one specific feature in a game. Who doesn't love games? (I could probably go on for hours about how almost everything when boiled down to it's essence can be likened to a game - but that's a subject for another time.)
    I didn't want it to be the sort of beginner game project most folks put in their books or on their blogs though, I wanted to try something new.
    === /Section 1 ===


    === Section 2: What it's supposed to do ===
    So the basic idea is that this is like a choose your own adventure book. The program is supposed to get a block of text and provide the user with a number of choices. When the user inputs his choice, the program is supposed to go retrieve the next block of text based upon what the user chose.
    === /Section 2 ===


    === Section 3: Problems with my implementation ===
    Currently the program retrieves all the blocks of text from a file and stores it in memory - very inefficient considering when this project is finished I anticipate that I will be contending with thousands of blocks of story with all their associated choices, putting the total probably somewhere in the hundreds of thousands of lines (Which is probably only going to be like 10 or so MB depending, but the operations on that text will probably be very intense. You will see what I mean when you see the code).
    There's also a function call that isn't working properly. I have marked it with an appropriate comment.
    === /Section 3 ===


    === Section 4: The 'Why' Section ===
    Why did I do things a certain way? That's what this section is for.
    Why did I use so many vectors when I could have used arrays?
    Basically because you can't have a function return an array without some finan'gling (©Fizzgig 2012) with pointers. And I'm just now beginning to learn about them. Plus most of the times I didn't know what the size was supposed to be beforehand. Vectors solve all this.
    Why did I make the IDs strings and not ints? (Which would have made comparisons so much easier)
    More options. Like I said, I'm going to have a lot of text when all is said and done. Assuming I keep it to 4 digits and don't use special characters:
    int = 9^4 = 6'461 IDs.
    string = 35^4 = 1'500'625 IDs
    Why declare my data members private when they are automatically set that way anyway? (Don't know if this is a big issue, but I will put this here just in case)
    I'm conflicted on this honestly. On the one hand, I feel it should be there for completeness and just because you don't have to do something doesn't mean you shouldn't. On the other hand, I'm new to C++ and doing it this way is stopping the fact that it's private by default to sink in. (I had to go Google it just to make sure)

    === /Section 4 ===

    === Section 5: Things I haven't used before ===
    Before starting work on this program I haven't used or even seen any of the following so chances are higher than normal I might have used them incorrectly: (If you have the time and inclination I ask that you point out if/when I did)
    Vectors, I/O and streams other than cout/cin (getline was a huge pain to get it working the way a wanted to in the end), .atoi() and the string compare (I'm still not sure exactly what it does and I need to fix this. Any recommended, easy to read/understand online documentation?).

    === /Section 5 ===

    === Section 6: My environment ===
    Just including everything; don't know what's necessary.
    I'm using Dev-C++ 4.9.9.2 with it's 'make' option set to "mingw32-make.exe" (Was told to do this), and minigw (Not sure which version).
    Also running all this on Win 7.

    === /Section 6 ===

    === Section 7: Code ===
    The .txt file is attached should you want to run this yourself. Just change the extension back to .dat . Reverse engineering one if going to take you a while.
    First the header, contentblock.h:
    Code:
    #ifndef CONTENTBLOCK_H
    #define CONTENTBLOCK_H
    
    #include <vector>
    #include <string>
    
    using namespace std; 
    
    class contentBlock {
          public:
                 void printBlock();
                 
                 // Set Functions
                 void setBlockID(string BlockID);
                 void setText(string Text);
                 void setChoiceAmount(int Choices);
                 void addNextBlockID(string ChoiceID);
                 void addChoiceText(string ChoiceText);
                 
                 // Get Functions
                 int getChoiceAmount();
                 string getNextBlock(int ChoiceIdentifier);
                 string getBlockID();
                 
          private:
                  int iChoices;
                  string sText, sBlockID;
                  vector<string> svChoiceText, svNextBlockID;
          };
          
    #endif
    Think this is called the implementation file for contentblock.h, contentblock.cpp:
    Code:
    #include <iostream>
    #include "contentblock.h"
    
    void contentBlock::printBlock() {
         cout << "==========" << sBlockID << "==========" << endl;
         cout << sText << endl;
         cout << "************************" << endl;
         cout << "**Please Select:[1.." << iChoices << "]**" << endl;
         cout << "************************" << endl;
          
         for (int i = 0; i < iChoices; i++) 
             cout << i+1 << ") (" << svNextBlockID[i] << "):" << svChoiceText[i] << endl;
             
         cout << "=========/" << sBlockID << "==========" << endl;
         cout << "Option (999 exits): ";
         }
              
    void contentBlock::setBlockID(string BlockID) {
         sBlockID = BlockID;
         }
         
    void contentBlock::setText(string Text) {
         sText = Text;
         }
    
    void contentBlock::setChoiceAmount(int Choices) {
         iChoices = Choices;
         }
    
    void contentBlock::addNextBlockID(string ChoiceID) {
         svNextBlockID.push_back(ChoiceID);
         }
         
    void contentBlock::addChoiceText(string ChoiceText) {
         svChoiceText.push_back(ChoiceText);
         }
    
    int contentBlock::getChoiceAmount() {
        return iChoices;
    }
    
    string contentBlock::getNextBlock(int ChoiceIdentifier) {
           return svNextBlockID[ChoiceIdentifier];
           }
           
    string contentBlock::getBlockID() {
           return sBlockID;
           }
    Main:
    Code:
    #include <fstream>
    #include <string>
    #include <iostream>
    #include <vector>
    #include "contentblock.h"
    
    using namespace std;
    
    vector<contentBlock> readContent(string iFile);
    void treeLoop();
    
    int main () {
        
        treeLoop();
        
        system("PAUSE");
        return 0;
    }
           
    vector<contentBlock> readContent(string iFile) { 
           //variable setup
           string sTemp;
           vector<contentBlock> vBlock;
           
           //stream setup
           ifstream contentStream;
           contentStream.open("Story.dat"); // It does not accept iFile as a parameter. Any thoughts?
           
           //if to check file access.
           if (contentStream.fail()) {
           cout << "File access failed.\n";
           system("PAUSE");
           exit(1);                          
           }//end if
           
           //while to read contents of file until .eof() returns true.
           int i = 0; 
           while (!contentStream.eof()) { 
                  
                  vBlock.resize(vBlock.size() + 1);
                  
                  // Retrieve and set BlockID
                  getline(contentStream, sTemp, '#');
                  vBlock[i].setBlockID(sTemp);
                  
                  // Retrieve and set Text
                  getline(contentStream, sTemp, '#');
                  vBlock[i].setText(sTemp);  
                  
                  // Retrieve and set ChoiceAmount
                  getline(contentStream, sTemp, '#');
                  vBlock[i].setChoiceAmount(atoi(sTemp.c_str()));
                  
                  // Retrieve and set Choice Texts and their associated NextBlocks
                  for (int j = 0; j <= vBlock[i].getChoiceAmount() - 1; j++) {
                      getline(contentStream, sTemp, '#');
                      vBlock[i].addNextBlockID(sTemp);
                      
                      getline(contentStream, sTemp, '#');
                      vBlock[i].addChoiceText(sTemp);
                      } // end for
                  
                  i++;       
           }// end while
           
           contentStream.close();
           return vBlock;
    } // end readContent function
    
    void treeLoop() {
         // variable setup
         vector<contentBlock> primaryVector = readContent("Story.dat");
         int iChoiceSelector, iPrimaryVectorSize, iCurrentBlock;
         iPrimaryVectorSize = primaryVector.size() - 1;
         string saTemp[iPrimaryVectorSize], sTemp;
         
         // Populate saTemp with all the BlockIDs
         for (int i = 0; i < iPrimaryVectorSize; i++) {
             saTemp[i] = primaryVector[i].getBlockID();
             }
         
         // For debugging purposes.    
         /*cout << "Array contents:\n";    
         for (int i = 0; i < primaryVectorSize; i++) {
             cout << sTemp[i] << endl;
             }  */
         
         // Initial setup. Will change this when I add "save" functionality.
         iCurrentBlock = 0;
         primaryVector[0].printBlock();
         cin >> iChoiceSelector;
         
         // Runs until the user enters '999' as input.
         while (iChoiceSelector != 999) {
         
         // while to check and correct input.
            while (iChoiceSelector < 1 || iChoiceSelector > primaryVector[iCurrentBlock].getChoiceAmount()) {
                    cout << "You have entered an invalid choice. Please select one from the list. [1.." << primaryVector[iCurrentBlock].getChoiceAmount() << "]: " ;
                    cin >> iChoiceSelector;
                    }// end inner while  
         
            sTemp = primaryVector[iCurrentBlock].getNextBlock(iChoiceSelector - 1);
            
            // runs string comparison to determine what the NextBlock is going to be.         
            for (int i = 0; i < iPrimaryVectorSize; i++) {
                if (saTemp[i].compare(0, sTemp.length(), sTemp) == 0) {
                   primaryVector[i].printBlock();
                   iCurrentBlock = i;
                   break;
                   } // end if
            }// end for
         cin >> iChoiceSelector;
         }// end outer while
    }// end treeLoop function

    === /Section 7 ===

    === Section 8: Why did I post this? ===
    Well, at first I didn't know how I was going to make the program move between different blocks. My thought was to take it as far as I can and then ask for help. As I went along, I figured out a way to do this and tried a lot of things to make it work. Now I just want to see if someone can make a more efficient(algorithm-wise)/eloquent solution. Also how my coding style holds up.
    If I'm close to the way you would have done it, and I just need to change one little thing to make it better; Could you give me a hint rather than a straight up solution?

    === /Section 8 ===

    Also, is it worth it to write a function if you only ever going to call it once, like I did here?
    Lastly I just want to say: Be as brutal in your feedback as you like.
    Attached Files Attached Files

  2. #2
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    4,165
    I'm using Dev-C++ 4.9.9.2 with it's 'make' option set to "mingw32-make.exe" (Was told to do this), and minigw (Not sure which version).
    Well, there is your problem.

    No, really, please don't use "Dev-C++" for any reason.

    If you downloaded the package with "MinGW" you have a really old version of a compiler and a really buggy IDE.

    I'm not joking by the way. Try to use a particular set of features at the same time and watch as "Dev-C++" tries to save a file but garbage the contents in the process.

    If you just need a simple IDE without jumping through a lot of crap try "CodeBlocks" or any of several others.

    I'll come back when I've had more time to examine your code, but this was something that needed to be said so you can get started downloading something different.

    Soma
    rags_to_riches likes this.

  3. #3
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,648
    Another small piece of feedback:

    Rather than
    Code:
    void printBlock();
    overload the stream insertion operator ( << ).

    Overloading the << Operator for Your Own Classes (Standard C++ Library)

  4. #4
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,420
    Well, there are a lot of things I could complain about. But I think first and foremost, you must change your IDE as Soma says. Your code actually violates the C++ standard (you use non-standard extensions). You can use Code::Blocks, and enable strict standards compliance and warnings with -Wall and -pedantic. You can also use Visual Studio, another popular IDE. You should then set warnings to max in your projects (see tutorials).

    Aside from that, some nuisances are: lack of const correctness and references. Const correctness is vital to catch more bugs at compile time than run time (if you've ever programmed in Javascript, you'd know what I'm talking about... horrid language). References are necessary to avoid lots of copying. Returning a vector full of strings can be a really bad idea since, unless you have a good compiler, they would be copied several times.

    Also put the ending brace at the same level of indentation as the start line for the block. You fail to properly indent some if blocks, too.

    Don't use "using namespace std" in headers. The problem is that you're forcing that habit down the throat of everyone who uses the header, and it might not be a good thing. Google it.

    You don't need to manually call close when closing a file. The destructor will take care of that for you. You should learn to know this pattern by heart since it is very important in C++, and one of its strongest traits: RAII.

    Don't use .eof() as the loop condition. It just won't work the way you expect. There's even a faq entry on the site explaining why.

    Finally, take a better look at your class design. You are using an extreme multi-pass construction phase. Avoid that, since it can more easily lead to bugs (say you try to use it before fully constructing it, what then? To avoid that, you'd have to add lots of checks, leading to lots of more code). Try to model your classes so you can construct them in one go. Once constructed, they should be usable from the get-go. Remember that you can use temp variables to store necessary info before constructing your objects.

    Oh, and vectors have a size. You should use that instead of some iChoicesAvailable variable.
    Oh, and hungarian notation is often frowned upon.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #5
    Registered User
    Join Date
    May 2010
    Posts
    2,690
    You also need to insure you include the proper include files for the standard functions you are using.
    main.cpp||In function ‘int main()’:|
    main.cpp|98|error: ‘system’ was not declared in this scope|
    main.cpp||In function ‘std::vector<contentBlock> readContent(std::string)’:|
    main.cpp|115|error: ‘exit’ was not declared in this scope|
    main.cpp|134|error: ‘atoi’ was not declared in this scope|
    main.cpp|102|warning: unused parameter ‘iFile’ [-Wunused-parameter]|
    main.cpp||In function ‘void treeLoop()’:|
    main.cpp|157|error: ISO C++ forbids variable length array ‘saTemp’ [-Wvla]|
    Note: I combined all your files into one file for the above errors.
    There's also a function call that isn't working properly. I have marked it with an appropriate comment.
    Code:
       contentStream.open("Story.dat"); // It does not accept iFile as a parameter. Any thoughts?
    Unless your compiler supports C++11 the open() function requires a C-string not a std::string. To convert a std::string use the std::string member function c_str() ( iFile.c_str() ).

    Also note you don't actually need to use the open function, you could just use the stream constructor:
    Code:
    /* Instead of this:
           ifstream contentStream; 
           contentStream.open("Story.dat"); // It does not accept iFile as a parameter. Any thoughts? */
       // This is equivalent.
       ifstream contentStream(iFile.c_str());
    Why did I use so many vectors when I could have used arrays?
    Actually in C++ programs vectors should usually be preferred over arrays. But you should be passing these vectors into your functions using references instead of by value. When you pass by value the compiler makes a copy of the vector to pass into your function which for large vectors is very time consuming. When you pass by reference you eliminate this copy generation and any changes made to this vector are reflected in the calling function. If you want to insure the vector is not altered pass by const reference. Also note that you should consider passing all non-POD data types by reference, const reference as well, this includes std::string. A POD data type means things like int, double, char, etc.

    Why did I make the IDs strings and not ints? (Which would have made comparisons so much easier)
    Actually comparing std::string and ints is not really that much different, you use the same operators (==, >, !=, etc) to compare std::string and int. Just remember using a 4 digit string will probably take up more memory than an int (on my system an int requires 4 bytes) and this int can be as large as 2,147,483,647 and still only take up 4 bytes a few more numbers than what you calculated your 4 digit string to hold.

    Why declare my data members private when they are automatically set that way anyway?
    When using classes I always use the access modifiers:
    Code:
    class myClass
    {
       public:
          void member();
       private:
          int somedata;
    };
    I usually put the public members before the private or protected sections. For simple structures I normally don't use the access sections. If I need public and private in a structure I will normally call it a class.

    Vectors, I/O and streams other than cout/cin (getline was a huge pain to get it working the way a wanted to in the end), .atoi() and the string compare (I'm still not sure exactly what it does and I need to fix this. Any recommended, easy to read/understand online documentation?).
    As far as the string.compare() I normally just use the overloaded comparison operators(==, !=, <, >, etc) when comparing two std::strings. As for the atoi() I actually recommend using stringstreams to convert to and from std::strings. I find this site a very good starting reference for most C++ constructs: C++ Language Tutorial and I recommend you bookmark this page in your browser. Also Google is really good at finding good sites when you type in the function names for example typing in: std::string.compare() usually lists cplusplus.com as one of the first few links.



    Jim
    Last edited by jimblumberg; 08-21-2012 at 02:22 PM.

  6. #6
    Registered User
    Join Date
    Aug 2012
    Posts
    10
    Ok, everyone seems in agreement that I shouldn't use Dev-C++ and I would love to tell you I'm switching over right this second, but it's not up to me. At least not for another year and a bit. All our exams and tests are done on/with Dev-C++, so for now at least, I need to condition myself to write what works for Dev-C++. Doesn't help me all that much if technically my code is flawless, but I fail the subject because it won't compile on the grader's system. Leading to me not being able to study this at college/university level. Now I know for a lot of people, a degree in programming (depending who granted it, sometimes not even then) doesn't mean a whole lot to a lot of people 'in the know'. People get hired based on this though and it's been decided that's what I'm going to do (not that it's against my will or anything). Retraining myself is going to suck, but you have to do what you have to do. Anyway... coming back to the point.

    If you told me right now; "You can write standard compliant code, etc, etc, and it will work fine on Dev-C++ -- I guarantee it"... well then, that changes everything and I will switch right this second. In fact I've already downloaded CodeBlocks just for this possibility.

    Quote Originally Posted by Elysia View Post
    Don't use "using namespace std" in headers. The problem is that you're forcing that habit down the throat of everyone who uses the header, and it might not be a good thing. Google it.
    This seems to be a relic from an earlier version of the program. Initially it was all in one file before I split it into three, somehow that made it over. It's good that happened though, because I probably wouldn't have known not to do it otherwise.

    Quote Originally Posted by Elysia View Post
    Finally, take a better look at your class design. You are using an extreme multi-pass construction phase. Avoid that, since it can more easily lead to bugs (say you try to use it before fully constructing it, what then? To avoid that, you'd have to add lots of checks, leading to lots of more code). Try to model your classes so you can construct them in one go. Once constructed, they should be usable from the get-go. Remember that you can use temp variables to store necessary info before constructing your objects.
    At first this flew right over my head. Think Peanut from Jeff Dunham, but I think I get what you mean now. I will see if I can redo it; it just made a lot of sense to do it that way at the time.

    There's lot of valuable feedback here which I want to respond to - but, if I don't get to bed soon there's going to be hell to pay.

    Thank you everyone for taking the time to have a look at my code! (Which I will be pouring over to figure out exactly why it's horrible)

  7. #7
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,420
    Quote Originally Posted by Fizzgig View Post
    If you told me right now; "You can write standard compliant code, etc, etc, and it will work fine on Dev-C++ -- I guarantee it"... well then, that changes everything and I will switch right this second. In fact I've already downloaded CodeBlocks just for this possibility.
    I can't guarantee that (what can you say with 100% possibility these days?), but I can tell you that it's extremely likely that it will work. You need to stay away from the newer C++11 standard, and be sure to compile your code with both the newer compiler and with Dev-C++. Find a compromise where it works with both (and without warnings).
    That should be ideal since you won't learn obsolete and/or dumb coding habit, yet be able to pass your exam.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  8. #8
    Registered User
    Join Date
    Aug 2012
    Posts
    10
    Quote Originally Posted by jimblumberg View Post
    You also need to insure you include the proper include files for the standard functions you are using.


    Note: I combined all your files into one file for the above errors.
    Dev-C++ must give you that by default then; when you create a new project, it automatically puts a
    Code:
    system("PAUSE");
    in your main() before the return. The program runs fine on my end.
    Not that I'm defending it or anything, I'm just saying I didn't know that it wasn't a thing that wasn't 'standard' (I don't know how to better describe this).

    Quote Originally Posted by jimblumberg View Post
    Just remember using a 4 digit string will probably take up more memory than an int (on my system an int requires 4 bytes) and this int can be as large as 2,147,483,647 and still only take up 4 bytes a few more numbers than what you calculated your 4 digit string to hold.
    I didn't take that into account. What you say makes sense and I will change it to use ints instead.

    Quote Originally Posted by Elysia View Post
    Oh, and hungarian notation is often frowned upon.
    I haven't read that entire wikipedia page yet, so I probably shouldn't say anything on this yet but...
    It mentions there that it confuses programmers? I find it quite the opposite in fact. Say I need 2 temporary values in a functions; one and int and one a string. I can't call them both 'Temp' and even if I could, that would be confusing. So I make the int 'iTemp' and the string 'sTemp'.

    But I suppose it's easy to fall into the pitfall and say "Well, no one else is going to see/work with this code other than me", but what about when I work as part of a team somewhere in the future? I'm going to do it the same way without thinking about it.
    So, if this causes other people headaches I will start changing my habits from here on. I mean, it's not that big a change really.

    Quote Originally Posted by Elysia View Post
    You need to stay away from the newer C++11 standard, ...
    That should be ideal since you won't learn obsolete and/or dumb coding habit, yet be able to pass your exam.
    So to aid in this, any book recommendations? Or any resource recommendations for that matter? Clearly the ones I have are teaching me wrong. I know there's a sticky with book recommendations already, but I don't know which are going to be helpful in my case. Any help in this area will probably saves me weeks of trial and error, not to mention the money.


    Thanks to everyone that gave feedback. I know I didn't respond directly to a lot of it, but honestly I don't have much to say to most of it other than "Ok, I'll do that". I am going to be applying and learning from all your feedback though. Perhaps when I've applied all of it I will re-post the code for your evaluation.

  9. #9
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    4,165
    It mentions there that it confuses programmers? I find it quite the opposite in fact.
    You don't have as much experience with it.

    The truth is that a simple prefix system isn't confusing. (Religiously using an "m" prefix for class members is common as dirt.)

    The problem is that "Hungarian Notation" isn't simple. Sure, with simple prefixes like "c", "i", or "d" there are no real problems, but eventually you come across a situation where a single character prefix isn't sufficient to describe the underlying type so you'll use two characters. Eventually, you'll hit a situation where two characters aren't enough so you'll use three. You may consider "i" as referring to an integer, but I immediately think iterator. That's where it starts getting ugly. You'll eventually see prefixes that don't represent the underlying type to your mind thus confusing the storage type, and then that prefix is six characters long it isn't easy to reason about without simply finding the definition at which point all reason to use a type prefix system becomes more than pointless.

    Also, the compiler knows the type whether you do or not which can catch the majority of errors, but the compiler will not enforce prefixes so a "i" can be a `double' and the compiler will just not care.

    So, consider not using a prefix system, or if you wish to use a prefix system consider using a simpler one that doesn't relate to the underlying type.

    A prefix system that relates to the measurement type isn't nearly as useless or confusing even though it has many of the same problems.

    Clearly the ones I have are teaching me wrong. I know there's a sticky with book recommendations already, but I don't know which are going to be helpful in my case.
    If C++ is your target language these are the ones you need to study.

    Code:
    Accelerated C++
    The C++ Standard Library
    Effective C++
    More Effective C++
    Effective STL
    Exceptional C++
    More Exceptional C++
    Exceptional C++ Style
    C++ Templates
    C++ Template Meta-programming
    Soma
    stahta01 likes this.

  10. #10
    Registered User
    Join Date
    Jun 2011
    Posts
    2,217
    It mentions there that it confuses programmers? I find it quite the opposite in fact.
    There have been a few discussions about Hungarian notation on these boards - here's one that I think does a good job of showing the underlying complexity behind the simple-seeming concept.

    hungarian notation

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. This is my attempt!
    By geustuser in forum C Programming
    Replies: 13
    Last Post: 06-24-2011, 03:26 PM
  2. First C++ Programme, Inspection Needed Please?
    By Danerrr in forum C++ Programming
    Replies: 3
    Last Post: 06-10-2010, 04:32 PM
  3. filehandling problem
    By mehmood_ahmed in forum C++ Programming
    Replies: 0
    Last Post: 10-31-2009, 12:31 AM
  4. Replies: 2
    Last Post: 09-24-2007, 02:46 AM
  5. Code inspection anybody???
    By Ruchikar in forum C++ Programming
    Replies: 0
    Last Post: 07-26-2002, 06:44 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21