O_oIf you can't use Unicode, then complain to your Professor that you shouldn't use it.
Internationalization and localization are massive fields.
I'd be shocked if a university did teach UNICODE at the beginner level.
Soma
O_oIf you can't use Unicode, then complain to your Professor that you shouldn't use it.
Internationalization and localization are massive fields.
I'd be shocked if a university did teach UNICODE at the beginner level.
Soma
Ah yes, so it is called. Not namespace operator. Thanks for the correction.
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.
So a professor asks for a specific character from a code page, and somehow, this does not qualify as using ANSI text.I don't see people teaching ANSI at beginner level, either.
It is much better than using some bloody extended character set.
Your loss.Don't get your point, or meaning.
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.I see no universities explaining the downfalls on ANSI, anyway.
Last edited by whiteflags; 09-09-2012 at 03:42 AM.
You may be interested in the contents of post 15, and in case you don't get it, my point in general is pragmatism.
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.
What doesn't the professor know in this case?
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.
O_oI don't see people teaching ANSI at beginner level, either.
Once again, ANSI is not a character set.
I didn't say that teaching the particulars of OEM437 was a good idea.
That isn't the same thing as using UNICODE.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."
You don't actually have much experience with internationalization and localization.I see no universities explaining the downfalls on ANSI, anyway.
Trying to teach how to manage these things at the same time as beginner programming constructs is a serious mistake.
No. You didn't.I included every option.
How "Windows" and "Visual C++" do it are not "every option".
In that case, we have ready proof that you should stop talking about how concepts related to character sets and encoding should be taught.These things are a sign of some professor who knows not what he/she speaks of, and that is bad.
Soma
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.
A professor of a beginner class has no business teaching either of those concepts.All I said is that professors should not use characters from the extended character set or minimize the issues by using wide chars.
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
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.
Could you be so kind and explain why ? I find rather convenient to do the first.Defining a type at file scope is a good idea, Defining instances is not.
Right, would it not be better to pass a specific member instead of the whole structure though?? I.E sub.shape vs sub.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.
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.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.
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.
That is great. I'll keep using it then.
Wouldn't the compiler warn you or something ?You will probably collide with something with the same name if you don't know what you're doing. Mine was Rectangle.
Seriously, Rectangle. What namespace Rectangle belongs too ?
I'm glad we have unicode to solve that mess.
Would you please elaborate ?The int is usually considered the optimum type for the processor.
Jim
LOL that's what I tried first. But '┴' showed like '-' in DevC++. So I resorted to the extended character codes.
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.read this: The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!) - Joel on Software.
I picked code::blocks it's working GREAT and it's multiplataform.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
The only global var, gameOver is modified form one function; message().- Your program modifies these variables from different functions
Though I get you other points.
If we follow that logic then why bother using bools at all. We should use integers/longs for everything that doesn't need decimals.What is 2 bytes vs 4 bytes in today's memory?
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.The idea is, instead of:
You can simply do:Code:switch (day) { case MONDAY: return "Monday"; case TUESDAY: return "Tuesday"; // etc }
Code:const std::string Days[] = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" }; return Days[day];
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 ?
That's a great idea. I don't know why I didn't think of it before.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.
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.