Tag: C++

  • Beginning C++ 25-35: Getting Started

    So, we are now entering a new section and we are Getting Started. Yeah, that’s the title of the section, so I must believe that we are now finally going to write some code.

    norm-mac-1.jpg

    Lecture 25: Section Overview

    This is just a section overview, just as the title say. Nothing special, let’s continue.

    Lecture 26: An Overview of the CodeLite Interface

    This is a very nice video as it tells you how you can change the layout of the CodeLite IDE to your own personal preference.

    I personally didn’t change it up to much. Just removed a few tabs the Workspace view I don’t think I will be using for now and also moving it to the right side of the window. That way it looks a little bit more like my setup in Visual Studio 2017. I also fiddled around with the themes to find one to my liking and ended up using Tomorrow Night as my theme.

    Lecture 27: Writing our first program

    We write a small program to type a message to the user and get an answer from him. We started with the template we made earlier, but deleted the source and wrote everything from scratch. This is a nice educational move as it will teach you more about the structure of a C++ program when you have to write everything yourself instead of starting from a random template.

    We learn some basic input/output functions of C++ and the difference between the insertion and the extraction operator. There is a small mention of namespaces, variables and how we include libraries.

    We end up with a short little program that we compile and hopefully end up with zero errors and warnings. I managed to bork it with some missing colons, but happily nothing I didn’t know how to fix.

    The instructor also shows us that since we made our own template and based this project on that, we can see that CodeLite instructs the compiler to use the C++14 standard.

    So again nothing special, but this is Beginning C++ after all and we all have to start somewhere.

    Lecture 28: Building our first program

    We learn more about compiling and building a project. What are source-files, object-files and executable files? The instructor also goes through the different options CodeLite have for compiling, building, rebuilding and cleaning files and projects.

    The course also tells us more about the difference of the files we see in the Workspace and what is really on the disk. There are many files on the disk that we as developers don’t need to know about, at least not at this moment, but it’s nice that the course explains them anyway.

    For beginners in C++ this is maybe not fully understood right now, but it’s something you need to know when your projects gets bigger and more advanced. But we’re still in the introduction stage learning basics that are important to know to set up your workflow and understand what’s happening if something goes wrong.

    Lectures 29-33: What are different types of errors?

    pexels-photo-277052.jpeg

    These videos goes through the following types of errors:

    Compiler errors

    The instructor creates a new project and shows us some common compiler errors and some ways on how to fix them.

    Compiler warnings

    What’s the difference between a warning and an error? Well, here you get an explanation. In short, it’s not “real” errors in your program, but it warns you about things that might give you unwanted or unexpected results.

    Seems like g++ is fairly good at giving error messages and warnings that you can understand. And CodeLite also helps you find the error as if you click on an error message, the IDE will jump to the place in the code where the error is reported.

    Linker errors

    These errors are a little bit more tricky to find. A program might compile without warnings, but when you build it you might get a linker warning. These errors can be more tricky to find in your source.

    This is something we probably won’t be having much in this course since we’re doing all the coding ourselves, but when you create large projects and try to link other libraries etc this is something that can happen.

    Runtime errors

    Runtime errors are errors that happen when you’ve taken care of all the bugs in your program, compiled and built it and made the executable file. Then some user runs your finished program and gets an error and yells at you, even after all your hard work.

    These are errors that you can’t really avoid. Sometimes a user gives you strange inputs, a file can be missing or something like that.

    These errors can make your program crash, so you have to use Exception Handling to deal with them. Exception handling will be a topic for later in the course.

    Logic errors

    Logic errors are errors that the compiler won’t help you with and doesn’t stop you from building your program. These errors are made by the programmer during writing of the code.

    These errors can really only be found by doing thorough testing of the program before you send it to end users.

    Lecture 34: Section challenge

    Fairly easy challenge here as everything you need has been shown to you in the previous videos.

    What you need to do is to make a program that asks the users for his favourite number and get that from him. You will then say that it’s also your favourite number and confirm that the number the user typed really is your favourite number.

    s2o7pty
    This is the output of my solution to the challenge

    If you want to see my solution you can check out this gist. You shouldn’t really need to look at my solution to solve this challenge, but it’s there if you need it.

    Lecture 35: Section Challenge – Solution

    Well, not surprisingly the solution the instructor shows us are more or less identical to my solution.

    Quiz 1: Section 4 Quiz

    The section ends with a quiz with 10 questions relating to the topics covered. Shouldn’t be too hard, but it’s nice to get a review of the topics to see if you understood the material.

  • Beginning C++, section 1-3

    I chose to do these three sections in one blog post since they don’t really contain much specific C++ teaching. When I get to more specific lectures I’ll make more in depth posts about what I’ve learned from those lectures.

    CodeLite

    Section 1 – Introduction

    This section goes into why you should learn C++ and a little bit about the history of the language.

    The simple reasons the teacher gives for why is two; salary and popularity.

    At least in the States it seems like C++ developers can earn good money. How it is over here I don’t know, but I see that there are several open positions for people knowing the language.

    The course points to several websites that make different indexes about the popularity of different programming languages. The most interesting link might be a ZDNet-article called Which programming languages are most popular (and what does that even mean)? It is sort of a rundown of all of the other pages linked in the course and it has some discussions about which way to go. You’ll see that C++ is ranked as one of the top 6 popular languages used now and it recommends you choose either C++ or Java as your first language to learn.

    Section 2 – Installation and Setup

    In this section the course just goes through some of the tools you can use to program C++. The teacher has gone for something that is cross-platform and has low requirements and has ended up with CodeLite as the IDE and they are going to use GNU compilers.

    Since I’m using Windows I ended up with using MinGW and CodeLite, but the course also goes through setting up systems for Mac OSX and Ubuntu Linux.

    It also links to some websites you can use if you quickly want to test some stuff and don’t have access to your IDE in the moment.

    Section 3 – Curriculum Overview

    As the title of the section explains pretty good, this is just an overview of what the course will be about and also how the course is built up with lectures and challenges.

     

  • Unreal Engine Developer Course, section 1-2

    This course is made by Ben Tristem and he has gathered a team of very good people around him and they are making some of the best online courses I’ve experienced. In addition to the Udemy site and it’s tools you will also get access to a website called GameDev.tv when taking this course.  I’ll go deeper into this in another blog post later.

    I’ll quickly go through the first couple of sections in this course since I did them some time ago and don’t think I can manage to do a detailed description of each lecture now.

    UnrealEngine

    Section 1 – Introduction and Setup

    This section gives a introduction to the course, what you get and the tools you will be using. Really nothing special, but you’ll learn to set up your system on Windows and Mac and getting ready to continue through the rest of the course.

    Section 2 – Bulls & Cows Word Console Game – Your First C++

    This section is an introduction into C++. The course itself requires no previous C++ knowledge, so here they introduce basic C++ to make a simple console game. They introduce you to the different concepts in C++, it’s syntax, functions, includes and namespaces, constants, variables, loops, comparisons, classes etc. This section is more or less the short version of the other programming course I’m taking, Beginning C++.

    Unreal is not touched at all in this section, but they do some things to get you ready for programming C++ with some specialised Unreal syntax.

    In the end you  end up with a nice little guessing game that they encourage you to change up and build on to make your own version.

    So yeah, that was the quick run through of these two sections. They’re really not that special just some intro to Unreal and C++. Some of the C++ concepts is covered very quickly and can be hard to understand, but this is just an intro to something we will be using a lot in the rest of the course so hopefully we’ll learn more about how to use it as the course progress.

    Edit: Did some editorial stuff to make the piece read better. Also changed from Unity to Unreal as I somehow got confused when I wrote the article and wrote the wrong name.