Very dumb Arctic fox. Giving out free and open-source hugs. Also a GoldSRC modder, and a gamedev. (idTech 3, 4, Unity, Unigine)

  • View media
  • View media
  • View media
  • View media
  • View media
  • View media
Report RSS When the professor asks you to show the source code (view original)
When the professor asks you to show the source code
embed
share
view previous next
Share Image
Share on Facebook Post Email a friend
Embed Image
Post comment Comments
Deathblade100
Deathblade100 - - 936 comments

You really should have been the teacher of the class.

Reply Good karma Bad karma+3 votes
Admer456 Author
Admer456 - - 823 comments

Damn straight I will. I'll even hold my own classes on weekends if my classmates can't understand the professor's explanations.

The professor even wants us to follow his coding style, and that means no spaces between #include and <, absolutely no writing multiple commands in a single line (e.g. system("pause"); return 0;), no blank lines at all, no spaces between operators, no spaces between cout and <<, etc.

But that's okay. As long as I'm there, I'll show my classmates how to do it better.

Reply Good karma+2 votes
Deathblade100
Deathblade100 - - 936 comments

Any tips on learning c+++

Reply Good karma Bad karma+2 votes
Admer456 Author
Admer456 - - 823 comments

As a learner myself (been 'learning' for 3 years), start with the theory. You'll need it.

I spent quite some time at cplusplus.com learning the basics of the language. There's a good amount of YT channels that have videos about coding such as Bisqwit and javidx9, and the good thing is, they try to demonstrate you the concept itself, not just using the language.

Once you've got an IDE like CodeBlocks or Dev-C++, you can start writing programs. I'd recommend VS2017 but it can be overwhelming and needs a more decent PC.

And when you start doing that, start simple. First with some text output, then outputting variables a and b, then a + b etc. Then you can do some if statements, for loops and so on.

Once you've played around with the simple things, look for more detailed documentation of the standard library (this is when you'll need the theory).
Then you can go into structures, functions, enumerations, classes, projects with multiple .cpp and header files etc.

Once you can successfully 'translate' your own concepts and algorithms (doesn't have to be a very complex algorithm) into C++, you could also try using some other libraries such as SDL2, depending on what you need.
I, for example, just needed something that could draw lines without OpenGL and Direct3D (software rendering), but WinBGIm didn't work for some reason, so I simply tried SDL2. It works like a charm.

TL;DR
In the initial phase, focus on learning the language and the theory. Practice, practice and practice.
Later on, once you're more experienced and know various approaches to solving some problems, try out some ideas of yours, and at one point, you can try using other libraries. :3

P.S. using namespace std; isn't actually a bad practice as others will tell you.
It isn't a bad practice in the initial phase, where your program will be simple, and it'll be using just stuff from the standard (std) namespace.
Of course, once you reach the latter phases, you might as well just stop using it and do std::cout instead of just cout, for example.

Reply Good karma+3 votes
djole22lt
djole22lt - - 300 comments

Visual C++ 2017?

Reply Good karma Bad karma+2 votes
Admer456 Author
Admer456 - - 823 comments

Yup. But in my school, we use Dev-C++ 5.11. :3

Reply Good karma+2 votes
djole22lt
djole22lt - - 300 comments

I wish I we were learning C++ at school. Instead, we're learning Pascal. :(

There's a good C++ tutorial adjusted for game-designing on Youtube that I'm following, but I have a problem with VC++, it's a trial version.

Reply Good karma Bad karma+2 votes
Admer456 Author
Admer456 - - 823 comments

Get Visual Studio 2017 Community.
Then make a Microsoft account, or use one that you already have.
And then you can activate VS2017 Community, just by logging into your account from it. ^^

Reply Good karma+2 votes
djole22lt
djole22lt - - 300 comments

Thanks, I'll try that!

Reply Good karma Bad karma+2 votes
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account:

Description

(this screenshot isn't too related to my story here, but ask what it is if you want)

So, here's the story.

It was about 5 minutes before Programming class, and we all knew that our professor would give a test to somebody in the class. Basically, the professor asks you to write the source code of a program on a whiteboard.

They were SO afraid of it. And me? I didn't care. std::cout was child's play for me. So, they wanted me to apply for the test.

And I did. The professor asked for a volunteer, and I replied. Then he told me to write a program that outputs this:

Name
1
2
3
Surname

Pfft. You know what happened. 2 minutes later, I got a 5 (or an A, if you're used to that system).


But that doesn't matter. What matters is, my classmates signed up for a course (in my engineering school, we have an IT course, basically) that they aren't even willing to study for.

After I completed the test, our professor explained us variables. int a; int b = 150; etc. Either way, my classmates seemed to understand it.

But then, he told us to write a program (on computers) that would do 4 simple mathematical operations (+,-,*,/) and naturally, I did that in 2 minutes. But how I did it isn't the point.

Some of my classmates did the following:
#include<<iostream>
and
using namespacve std;

They managed to fix the namespacve easily, but they wanted to cry because the compiler complained "Invalid argument" at the #include<<iostream> line. Hah.


Man, what a fun day. I ended up helping a third of my class, and the professor told me I should be his assistant.

So yeah. I think that my classmates will get better as time goes on. I'll even teach them on a few occasions. :3