Thread: Why this code is not working?

  1. #16
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Mad? Who says I'm mad? I am simply pointing out that style if a matter of choice. Neither you, nor I, can dictate what someone must or should use.
    They can do name the class car, CCar, Car or TCar or even cAr; it doesn't matter.

    So first: it's not hungarian. And if it is, then a lot of other things are hungarian. Such as prefixing or postfixing member variables, and prefixing types with capital letters.
    Point is, we do try to differentiate different types of identifiers with different conventions, just like hungarian try to differentiate type identifiers by prefixes. What if you change your class to a struct and it's a convention for you to make structs lower-case? Same story there.

    And secondly: It doesn't matter if it's unpopular or not. It's a style, and you are free to use it if you like it. Or not, if you don't. Just as you are free to capitalize types or not.

    Anyway, I simple prefix classes because I want capitalized variable names. Because I like everything to begin with a capital name. If you know of a way to avoid prefixing classes and keeping capitalized variable names, I'm all ears.
    Last edited by Elysia; 09-04-2010 at 04:46 AM.
    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.

  2. #17
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,613
    Mad? Who says I'm mad? I am simply pointing out that style if a matter of choice. Neither you, nor I, can dictate what someone must or should use.
    Must you point out every matter of style, if it is such an arbitrary thing? People don't really need you to point out freedom of choice every time.

    They can do name the class car, CCar, Car or TCar or even cAr; it doesn't matter.

    So first: it's not hungarian. And if it is, then a lot of other things are hungarian. Such as prefixing or postfixing member variables, and prefixing types with capital letters.
    Point is, we do try to differentiate different types of identifiers with different conventions, just like hungarian try to differentiate type identifiers by prefixes. What if you change your class to a struct and it's a convention for you to make structs lower-case? Same story there.
    Do we really need to have a prolonged discussion on things like this? If there is a large population of people like you who are this rigid about matters of style, they do not affect me and by large part I wouldn't care to work with them.

    Anyway, I simple prefix classes because I want capitalized variable names. Because I like everything to begin with a capital name. If you know of a way to avoid prefixing classes and keeping capitalized variable names, I'm all ears.
    So use the shift key. o_O;

    The only positive statement you made was that you can do this:

    CCar Car;

    Wow, did you know that works in reverse? What about Car MyCar; Holy crap this is hard.

    GO DO SOMETHING. PLEASE.

  3. #18
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by whiteflags View Post
    Must you point out every matter of style, if it is such an arbitrary thing? People don't really need you to point out freedom of choice every time.
    People do not have to stuff someone's particular style down someone else's throat.
    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.

  4. #19
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Hmmm... no, they should start with a capital C!
    Hideous. MFC does this and the reason has already been mentioned in this thread. Microsoft also does this but I'm not sure what the mindset behind it is since namespaces are now widely available. I used to use it but was eventually freed from captivity and now no longer use this style.

    People do not have to stuff someone's particular style down someone else's throat.
    This is odd coming from you since in every other thread you try to ram other things that are equally as useless down people's throats. Relax a bit.
    Last edited by VirtualAce; 09-04-2010 at 09:48 AM.

  5. #20
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    My mindset is not to replace namespaces... but to supplement my ability to use capital names for variables. Hideous or not... it's a style.

    I always listen to other peoples' feedback, and try to make myself better. So if you would, could you make examples of what I force down others throats that you deem useless?
    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.

  6. #21
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,613
    When you put forth this quirk of yours as a guideline, you invited it into discussion and you must be able to deal with it. You may feel as though you are being persecuted, but that is a personal problem.

  7. #22
    Registered User
    Join Date
    Oct 2008
    Posts
    1,262
    Quote Originally Posted by Elysia View Post
    People do not have to stuff someone's particular style down someone else's throat.
    Elysia, Elysia...

    The "Car" class name with a C prefix was obviously a joke. Anyways, I'm not saying a style with a C prefix is bad style - I'm just no fan of it personally. It's fine if you do it.

    What your actual problem seems to be is that I commented on the OP's style, where I shouldn't. There's a reason I did it: he's obviously a beginner. That's a very good time to develop a good style, or at least start shaping some good style. His current style is quite bad (obviously: he just started, it takes ages to get a style right). So what should we do? Leave him to it until he's a good coder, then let him shape his style? Well, I don't think that's a good idea.

    If you would've posted it in your style I wouldn't have commented on the style because of two reasons: you're experienced enough to know your own style, and the style is good, even though it's not mine.

  8. #23
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by whiteflags View Post
    When you put forth this quirk of yours as a guideline, you invited it into discussion and you must be able to deal with it. You may feel as though you are being persecuted, but that is a personal problem.
    I am fine with being persecuted. I have chosen it to the best of my ability with experimenting and trying different combinations. In fact, I am STILL trying other ways of augmenting my style.

    EVOEx: You bring up a good argument there. Unfortunately, I don't have a counter argument, so you win there.
    It's just that I don't like forcing styles down newbie's throats, because they often get stuck with it. Making newbies get used to various styles early might actually be a good idea.
    (It's not amusing when people have always typed T *myvar and then see T* myvar and come running asking, "What's this new special syntax!?! What does it do!?!".)
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Code not working?
    By Elysia in forum C++ Programming
    Replies: 12
    Last Post: 04-06-2009, 01:57 AM
  2. Replies: 3
    Last Post: 02-24-2009, 08:49 PM
  3. C code not working
    By D3ciph3r in forum C Programming
    Replies: 2
    Last Post: 05-27-2005, 04:13 PM
  4. Trying to eject D drive using code, but not working... :(
    By snowfrog in forum C++ Programming
    Replies: 3
    Last Post: 05-07-2005, 07:47 PM
  5. Linked List Working Code
    By Linette in forum C++ Programming
    Replies: 9
    Last Post: 01-24-2002, 12:00 PM