This forum is in archive mode. You will not be able to post new content.

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - kelvinsilva-katokato

Pages: [1]
1
C - C++ / Re: problem with Cout statement
« on: March 27, 2013, 10:13:05 PM »
for using namespace std;
It really depends where you want to put it. It deals with scope.

putting using namepsce std; above int main() makes it file scope, meaning that the std namespace will be applied to everything outside the main function (other functions as well).

Putting it inside the main, means that it will be only applied WITHIN the main function. And not to any other functions.

The best practice in reality is to do std::cout <<
Since that is too hard to type std:: you can do this:

using std::cout;

and put that in your main().

Reason for this is that then there will be no namespace conflicts. Since you are working with small and simple projects, you may only want to keep it at using namespace std;
Once you start working on large projects with multiple namespaces, you will want to restrict your use of using namespace std; and start doing things like std::cout<< or using std::cout;

2
C - C++ / Re: C++ instead of C[not what you think]
« on: March 27, 2013, 09:59:16 PM »
IMO, the speed difference between c and C++ is vritually non existant.
OOP is merely a programing paradigm that is used, and while yes there are more abstractions used in using classes and objects, I think that programming style and algorithm development will affect your code optimization way the fuck more rather than if you are using a class versus a bunch of structures (c vs c++).

Using classes is really helpful for large projects that need to reuse a set of variables and certain methods to manipulate them over and over again. Its kinda like using functions, but instead you are combining functions and variables together.

WINAPI programming is mainly done in C and does not really use many things from c++, but you can always combine the two (for example you can design your own class using win32 api functions).

Once you start learning c++, you will learn c functions as well. A lot of things used in C++ are nearly identical to C. Basic things like loops, structures, variables, are identical to C and C++. Both languages use pointers (c++ includes references). The only main difference is that in c++ you have to learn how to use Classes and templates.

Not really a BIG difference there.

Even if you find yourself taking a C++ class, you will often stumble across C stuff because a lot of C functions are already there and are working, so why reinvent the wheel?

Saying that you want to learn C before C++ is like saying that you want to learn how to read before you write. Makes no sense. While you are learning to read, you are also learning how to write at the same time. In a typical C++ beginner book, the first 8 or so chapters deal with things that C and C++ share the same. The other half of the book is talking about Classes, inheritance, templates, namespaces, and C++ i/o stream. Loops, Variables, functions, and procedural programming paradigm are the things that each language shares in common (same with java, and many other languages as well.)

Makes no sense.

C++ is just C with classes. Not really a big difference.

"Also for writing server applications I highly recommend a language like Go or Javascript (Node.JS and others)."

I think you are getting confused. Javascript is a client side language, rendered and done through the browser. Server side applications are usually done in PHP.

Pages: [1]


Want to be here? Contact Ande, Factionwars or Kulverstukas on the forum or at IRC.