i use this way because to me its easy, it allows me to easier read the code and find bugs (despite how you say its harder), and I'm using everything I've created as something to look back at in the future.
If you would like to see all of the coding projects i have ever created (there all organized in a .zip file) you can email me and i will send them to you to look at
email: [email protected]
Oh, so you have never named your function "distance" or "max" or "generate" with use of <algorithm> header? Or work with library with several namespaces including global? It usually teaches to not have "using namespace" in global scope. Actually all corporation I worked on forbid use of usingnamespace in global scope. And explicitly forbid usingnamespace std everywhere.
Another link: http://www.parashift.com/c++-faq/using-namespace-std.html
I have never used <algorithm> header,
if you want to see all of my projects email me.
I am only 17, i am not planning on making console based games, (planning on online games) but use c++ as it is basis for many other languages (know many other languages as well), I know how to code without namespace std but since its not a priority, its easier for me to read code, or look back on in the future, so i use it.
So you have never used C++. You have used "C with classes". Main part of C++ is standard library, which allows you to not reinwent the wheel and to use optimized algorithms and containers which will work faster that you probably could write.
I suggest to read some C++ books. I recommend "C++ Coding Standards", or Scott Meyers books: Effective C++, More Effective C++, Effective STL and Overview of the New C++ (C++11)
Note that all of this books recommendation should be used with understanding that they were written before C++ 11 which made several technique obsolete.
Also this: http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list
I have never even learned c, i started with c++, and just because i dont use #include <algorithm> ,does not mean i don't know c++, this is c++ as far as i know, as you would see from other projects, and i do code most c++ standards.
these are the only headers i have ever needed to use
Beginner level questions when hiring C++ developer:
What is pros and cons of std::unordered_set in comparsion with std::set?
Which standard algorithms does std::list implements as a member functions and why?
When you should use decltype instead of auto?
Which code is valid, which is not C++ standard compliant and which lead to undefined behavior:
1 2 3 4 5 6 7 8
int x = 5//1
int y(10)//2
int array[2][2][2][2] = {};//3
int z[y]//4
x = y = x = y; //5
x ^= y ^= x ^= y; //6
++x *= y++; //7
1[0[array][1]][0] = 1;//8
That is a beginner level, which means that applicant knows basic C++ and will be code monkey in company. Waiting for answers!
Which code is valid, which is not C++ standard compliant and which lead to undefined behavior:
int x = 5//Which code is valid
1[0[array][1]][0]//which is not C++ standard compliant
int array[2][2][2][2] = {};//which lead to undefined behavior
cool and, your point, I havent coded in 6 months and never will I use
int array[2][2][2][2] = {};//4 dimensional array, uneeded
x = y = x = y; //extra coding
x ^= y ^= x ^= y;//no point
++x *= y++;//no point
1[0[array][1]][0] = 1;//makes no sense
Beginner level questions when hiring C++ developer
not planning on developing in c++, as it is not compatable easily with online games. just learning
if you want to look at all my c++ projects and tell me what I'm doing wrong. go ahead and feel free, i will gladly take note so i know not to make those same errors in the future
email: [email protected]
x ^= y ^= x ^= y;It is one-line fast xor swap implementation.
Usually and correctly written as
1 2 3
x ^= y;
y ^= x;
x ^= y;
++x *= y++ if it was *(++x) *= *(y++);it would be correct low-level pointers (or iterators) range manipulation. x = y = x = y; If used as a += b = getValue(); it is fall-throug assigment. Used sometimes in complex algorithms. int z[y] Valarrays. Will be included in C++14
Note that all these examples is synthetic and exist only to fix attention on some parts of the language.
Last one was to see if appicant knows that subscript operator is commutative, so a[2] is equivalent to 2[a].
4 dimensional array, uneeded
Main point that it is zero-initializated array.
All question designed to start discussion with applicant and test his level of knowledge.
For example answers "you can't do that", "standard explicitly forbids it" and "it would cause unneeded complexity in implementation because..." will each give you different position and salary.
By the way: why x ^= y ^= x ^= y; causes undefined behavior? Predict possible values of x and y after execution.
What? World of Warcraft written in C++, Lineage II based on UE which written in C++, Diablo 3 written in C++, most Ultima online servers written in C++.
As lower level languages C/C++ is often used for highload application like online games.
All of them were old files when i was learning coding, and are no longer games I am working on anymore, from time to time I look back on them, to remember something i forgot and use it in my new program. (btw, the purpose of creating my new program is to compileeverything i have learned in c++ into one project so It is easier to look back at in the future (well besides the maps, because there has to be a better way than that), as well as create a fun game for myself to play)
as for the Fighting Game, the errors you are seeing is that i accedently gave you the older version of the game (but doesn't matter as I no longer need it, except to use snidbits of it for help in my new project)
and MapFunctions.h is not needed, in the map files (old attempt to simplify them)
(The javascript one was when I was learning 3 new languages and stopped doing c++ for like 6-8 months, to learn them, and i had help on that project to learn them html5,css,javascript)
The last file i think called "NewProgram" or something similar, is the game i'm currently creating, and as of yesterday is no longer up to date, due to the tons of new weapons, armor, and shields added, and changed stats, as well as some new things for each (such as Weapon_Reload).