Thread: Looking for constructive criticism

  1. #16
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    If you can't use Unicode, then complain to your Professor that you shouldn't use it.
    O_o

    Internationalization and localization are massive fields.

    I'd be shocked if a university did teach UNICODE at the beginner level.

    Soma

  2. #17
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by grumpy View Post
    I've never heard it called that before. It is usually referred to as the "scope resolution" operator, and is used for resolving names within named scopes (a scope is sometimes called a context in natural english). A namespace is one type of named scope. The name of a struct or class is another type (where the name is that of the struct/class type).
    Ah yes, so it is called. Not namespace operator. Thanks for the correction.

    Quote Originally Posted by phantomotap View Post
    O_o

    Internationalization and localization are massive fields.

    I'd be shocked if a university did teach UNICODE at the beginner level.

    Soma
    I don't see people teaching ANSI at beginner level, either.
    All they have to do is say "use wide chars, prefix with an L; just do as we say, it will become apparent why later."
    It is much better than using some bloody extended character set.
    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.

  3. #18
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    I don't see people teaching ANSI at beginner level, either.
    It is much better than using some bloody extended character set.
    So a professor asks for a specific character from a code page, and somehow, this does not qualify as using ANSI text.

  4. #19
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Don't get your point, or meaning. I see no universities explaining the downfalls on ANSI, anyway.
    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. #20
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    Don't get your point, or meaning.
    Your loss.

    I see no universities explaining the downfalls on ANSI, anyway.
    There really shouldn't be any downfall. But let's just drop class over it because our prospects are so great elsewhere Unless you know that the school isn't teaching C++ on windows, then you don't really have a point. The code page will be alright. Like I told you before, it is far easier just to take the missed points in stride in case of a code page ........ up, than to argue with the professor without complete understanding. You're being really unrealistic.
    Last edited by whiteflags; 09-09-2012 at 03:42 AM.

  6. #21
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by whiteflags View Post
    There really shouldn't be any downfall. But let's just drop class over it because our prospects are so great elsewhere Unless you know that the school isn't teaching C++ on windows, then you don't really have a point. The code page will be alright. Like I told you before, it is far easier just to take the missed points in stride in case of a code page ........ up, than to argue with the professor without complete understanding. You're being really unrealistic.
    Unrealistic? How?
    I included every option.
    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.

  7. #22
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    You may be interested in the contents of post 15, and in case you don't get it, my point in general is pragmatism.

  8. #23
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Like I said, you can drop the course IF that's an option. But that question's answer is different to each one. Is it worth it? Do I have to do this because of some requirement?
    These things are a sign of some professor who knows not what he/she speaks of, and that is bad.
    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.

  9. #24
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    What doesn't the professor know in this case?

  10. #25
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Using characters from extended code pages and recommending Dev-C++.
    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.

  11. #26
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    That's not a great answer, but I'll respond as if it is. The real problem here is that skyliner learned C++ on a windows platform, but did his homework on a linux platform, and expected 0 issues. Why do you think that the professor wanted Dev-c++? It's windows software. I see it this way: if you step outside the bounds of a class environment, you have to deal with those issues that will come up on your own. It's not the professor's problem.

  12. #27
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    I don't see people teaching ANSI at beginner level, either.
    O_o

    Once again, ANSI is not a character set.

    I didn't say that teaching the particulars of OEM437 was a good idea.

    All they have to do is say "use wide chars, prefix with an L; just do as we say, it will become apparent why later."
    That isn't the same thing as using UNICODE.

    I see no universities explaining the downfalls on ANSI, anyway.
    You don't actually have much experience with internationalization and localization.

    Trying to teach how to manage these things at the same time as beginner programming constructs is a serious mistake.

    I included every option.
    No. You didn't.

    How "Windows" and "Visual C++" do it are not "every option".

    These things are a sign of some professor who knows not what he/she speaks of, and that is bad.
    In that case, we have ready proof that you should stop talking about how concepts related to character sets and encoding should be taught.

    Soma

  13. #28
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    All I said is that professors should not use characters from the extended character set or minimize the issues by using wide chars. I know wide chars are not necessarily unicode, but it's still better than narrow chars which typically map to ANSI.
    So whatever. That's all I'm going to say on the subject. Think what you want.
    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.

  14. #29
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    All I said is that professors should not use characters from the extended character set or minimize the issues by using wide chars.
    A professor of a beginner class has no business teaching either of those concepts.

    Sure, "a character is really just a number under the hood" is fine, but going beyond that into different character sets and encodings isn't good for students at that level.

    Imagine hearing "parse a simple newline delimited file into a linked list" the same day as hearing about the several different UNICODE character encodings!

    Soma

  15. #30
    Registered User
    Join Date
    Jul 2012
    Posts
    23
    Quote Originally Posted by grumpy View Post
    there are ways to configure most modern compilers so they do give detailed diagnostics.
    Well, my new IDE has many options under the "Compiler and Debugger" setting. I enabled -Wall, -Wextra and -pedantic. I also found optimization options. It's astonishing how many features I can control form there.

    Defining a type at file scope is a good idea, Defining instances is not.
    Could you be so kind and explain why ? I find rather convenient to do the first.
    Note also, that if you are passing larger structs to a function, it is often practically a good idea to pass them by reference rather than by value.
    Right, would it not be better to pass a specific member instead of the whole structure though?? I.E sub.shape vs sub.
    A namespace is, in mathematical lingo, a space containing names.
    ...
    The problem with "using namespace" is that they cause ambiguity.
    ...
    In this case both std::cout and X::cout are candidates to match "cout".
    ...
    Generally, it is considered a good idea to either use using directives, or fully qualify your names. But you can do both.
    I understand. ATM, most if not all of the objects I use belong to the std namespace. So it would make sense to use the "using namespace std;" statement.
    If I ever find myself using objects from other namespaces or even my own, I will specify the namespace the object belongs to, at each use.

    Quote Originally Posted by whiteflags View Post
    That is precisely why it is used by newbies the way it is. Everything you need typically is in std.
    That is great. I'll keep using it then.
    You will probably collide with something with the same name if you don't know what you're doing. Mine was Rectangle.
    Wouldn't the compiler warn you or something ?
    Seriously, Rectangle. What namespace Rectangle belongs too ?
    Quote Originally Posted by jimblumberg View Post
    ASCII TABLE and ASCII CODE and ASCII Comparison. So as you can see with one character set you get one set of extended characters while with the other character set you get something different.
    I'm glad we have unicode to solve that mess.
    The int is usually considered the optimum type for the processor.
    Jim
    Would you please elaborate ?

    Quote Originally Posted by Elysia View Post
    OK, so first, you can just type '┴', not 193.
    LOL that's what I tried first. But '┴' showed like '-' in DevC++. So I resorted to the extended character codes.
    read this: The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!) - Joel on Software.
    Very illustrating. I still have doubts on how to use unicode on my program though. Do I have to use a special processor directive, include a specific library ?? I'll have too look it up on the web.

    Don't use Dev-C++. It's old and unmaintained. get a modern IDE. Here is a small list of modern IDEs, SourceForge.net: Integrated Development Environment - cpwiki
    I picked code::blocks it's working GREAT and it's multiplataform.

    - Your program modifies these variables from different functions
    The only global var, gameOver is modified form one function; message().
    Though I get you other points.

    What is 2 bytes vs 4 bytes in today's memory?
    If we follow that logic then why bother using bools at all. We should use integers/longs for everything that doesn't need decimals.

    The idea is, instead of:
    Code:
    switch (day)
    {
        case MONDAY: return "Monday";
        case TUESDAY: return "Tuesday";
        // etc
    }
    You can simply do:
    Code:
    const std::string Days[] = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" };
    return Days[day];
    The problem is I need to print some vars to the screen along with some of the message lines. I could use your method on the rest of the lines though.
    I'm curious however, is there any performance gain by doing it that way or is is just for convenience ?
    Also, how are the strings typed in the source code, stored and later retrieved during runtime ?

    Also, the idea was that instead of
    message("gameOver")
    you would do
    message(GAME_OVER);
    Where GAME_OVER is a constant from a Messages enum.
    That's a great idea. I don't know why I didn't think of it before.

    Quote Originally Posted by whiteflags View Post
    The real problem here is that skyliner learned C++ on a windows platform, but did his homework on a linux platform, and expected 0 issues.
    Well, I didn't have any problems. I just ended up unnecessarily specifying cout, cin and endl as std objects. When there was a 'using namespace std' statement at the beginning. Oh and the sub's char appeared as a '?' in my linux box. (but appeared correctly in windows, were the program was going to be run and graded on)

    To defend my professor I will say that he specifically asked us to use devC++ because of general issues he had had with other students code, because they were using other IDEs.
    Also the programs we made were so trivial that didn't require a modern IDE. He also aclaimed DevC++ for its simplicity and ease of use. Most of the students there had absolutely no background with computers and this was only a 16 week course, with two 90 minutes meetings per week. I guess he thought it convenient to use this, unmaintained, but simple IDE. On the other hand he could have very well recommended another IDE at the end of the class.

    For me, using code::blocks for the first time was a little different, it required creating a "build target' 'debug' and 'release' configurations and manually creating a source file. Definitely much more work than in devC++. This could be daunting for a newbie. Though not too much.
    IMHO, features such as code folding more than make up for it. I mean that's gotta be single handedly the best feature ever to be invented in a code editor. I am enamored with it.
    Last edited by skyliner; 09-15-2012 at 04:43 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Looking for constructive criticism
    By wd_kendrick in forum C Programming
    Replies: 16
    Last Post: 05-28-2008, 09:42 AM
  2. Constructive criticism/suggestions
    By LineOFire in forum C Programming
    Replies: 11
    Last Post: 09-30-2006, 09:32 AM
  3. Constructive criticism, suggestions etc
    By BobS0327 in forum C Programming
    Replies: 3
    Last Post: 01-08-2006, 09:35 AM
  4. Constructive criticism highly appreciated!
    By muggizuggi in forum C++ Programming
    Replies: 17
    Last Post: 08-01-2005, 11:54 AM