Setting Up C++ Programming Environment in Windows 10 Is a Pain

Yesterday I was excited and ready to start getting to programming with C++. I thought that it would be nice to learn and to refresh my memory. I have some years ago completed a programming basics course in C++. The idea of having an executable that could be run on a wide range of devices was the idea that was so fascinating to me. I use Windows 10 a lot. So I decided that it would be easiest to just install some IDE and also a compiler.

I was so wrong with my decision. I tried to install Cygwin. During the installation you would have to select all the components that you definitely need for C++ development. There are hundreds of them. If you would like to install all of them that would take days to download and install. So that basically wasn’t an option.

I have been around Java from 2010. I am very familiar with setting up programming environment for it. It is just way easier than with C++. I wanted to code in C++. I just think there are so many options if you learn and use this programming language. What was my solution?

While I was going through the material I found online I figured that it might be easier if I would start with Linux instead of keep hitting my forehead to Windows 10. I know that Microsoft has been trying to make it a bit easier to use Linux’s software on Windows. That however wasn’t the solution for me. So I swithched to my laptop that has a dualboot install of Windows 10 and Ubuntu.

I had already Visual Studio Code installed. All I had to do was to install the extension inside VS Code. That was almost it. I had to look up how to run build inside the IDE but that wasn’t a hard thing to do. So I got to programming quickly.

It was my goal to just write something that would work and refresh my memory on the programming language. As I got my programming environment to work I got to the actual programming. I had to look up some tips on how to present text and read it in online. I am serious as I say that any programming experience in any language makes it way easier to switch to a language that you aren’t already familiar.

C++ is used widely and still in 2022 for programming games and other software. Aside it being a tough to install in Windows it really is a dynamic programming language. There basically aren’t many limitations in what it can be used for. Even websites and desktop applications with a GUI can be build.

What I build yesterday was just a tiny application. Actually it is a personality test with a lot of humourous edges on it. You answer in five questions which give you points for a type of a person you are. There are three types. The personality type that you are is the one that gets most points based on your answers. Yes. And the types are (translated since the application is in Finnish) “a talented model citizen”, “an alcoholic” and “loser”. So you are one of these. I know, there aren’t much of a choice.

Anyways, I had fun all of the about three hours I spend developing this funny or stupid app.  I had fun. It was nice. The program managed to fit into about 150 lines of code. So you can imagine that it wasn’t so complex. It had some basic text that was read in and also printed out. It used different variable types, some loops and decision making with if-else structures and that was basically it.

If you would like to program with C++ yourself I highly recommend using a computer that has Linux installed. I also like Visual Studio Code which is a free text editor or even an IDE (which stands for Integrated Development Environment).

That Certain Randomness

There is this certain randomness in video games. There is fast learning involved especially when you start playing some game. Games are usually easy to pick up but hard to master. That gives you a feeling that you want to play this game some more. You learn a lot. How much does your skill develop when you are playing? It seems to develop a lot. That isn’t although the only thing your success in playing the game depends. It also has a lot to do with good luck. We can name this element “certain randomness”.

This idea became clear to me as I was one day playing again Need For Speed Hot Pursuit Remastered. I had to catch at least 5 racers as a police officer. The task seemed hard. I kept failing and failing. After trying as hard as I could I got lucky. There were several bad guys captured. It didn’t have so much to do with my skills as it had to do with pure luck.

You might be familiar with randomness in programming. While it is debatable if the random number generated is actually random or not there is a nice way to generate a random number between certain values that can be defined in almost every programming language. At least this is possible in Java and Python. How I first got to know this type of numerical behavior was as I had to deal with a Java application that had to generate a value of a dice getting tossed. You basically had to generate a number between one and six and do it as randomly as possible so that it would describe in the source code how a dice would act in real life.

If you know anything about dices and how are they used in games like Yatzy or some roleplaying game you can figure that their role is to create this random feature that gives you a nice feel when you are playing. It gives you an element of luck. For example if dice gives you 1, 2 or 3 your hit of axe has hit and if it gives you 4,5 or 6 you have missed. You can also define the enemy’s body part that was hit and define the amount of damage caused. A common way to use dices in board games is how many times you can move your character. You get to move the character the amount of times that the dices value is showing.

Playing video games is not only about your skills or your reaction time. It would be very boring to play games that only required skill and would have nothing to do with luck. But if everything in a game is random that isn’t satisfying also. Take poker for example. It is nice to play a game or two of poker. Would you play poker for three hours? Would you enjoy the game if there were no money involved? Of course the answer to these two questions are both “no”. Poker is such a game of luck, isn’t it?

I think the best games are the games that mix randomness smoothly to the skills needed to succeed. If you succeed all the time doing exactly the same thing it gets quickly boring. You want challenge. And you want some surprises. Nowadays video games are getting more complex. This makes things more interesting to us players and I think for also game designers. While you can mix things up by making them abstract and random you always don’t even have to. That’s because games are more complicated than this. You can watch the statistics, like how many kills you have in a shooting game, and make these figures random but in this case the number of kills depends also about the players skills and this forms the players performance. Some things can be simple and random while others can just be thought to be like that.

Anyways. Thanks for reading, again! I am going to continue to have my couple days of since it’s the mid summer party here in Finland. I am probably going to play, make music and read some books. We already had a small meeting with a friend. I have also something more to tell you about our game that we hope to have for sale soon. See you next time!

How Has Learning Computer Science Changed?

I was reading this book about JavaScript programming as I thought came to my mind. The book was dealing how you can launch a new web browser window  and how you can do it in JavaScript. I started thinking a bit about this.

I have always programmed something on top of a heavy operating system like Windows 10 or Ubuntu Linux. I am able to create a new window inside a web browser. I am able to produce code that can manipulate the contents of a web page inside the browser. What about the machine level functionality? How computer works inside?

I came to think about this for a second. Earlier, like back in the 80s, computer hobbyists had a computer that they could program a bit simpler and deeper with. It was Commodore 64. This device was partly an electronic device and partly a early personal computer. You could learn programming in BASIC or you could, if you had the talent and will to learn, program in assembler.

Assembler means that you are talking to the machine as close as possible. You get to temper with how the machine uses memory and so on. Commodore 64 was a perfect device for someone to learn skills like programming.

Today we don’t have such hardware. We do have complicated systems running complicated operating systems. You might get yourself a Raspberry Pi but that isn’t the same thing. I recently watched a documentary that was dealing with this issue. Back in 1990s there were people going to study Computer Science in universities. Nearly all of them had some background with C-64. Now there just isn’t a good enough source that you could basically learn and build on to learn some more about this field.

Things in computer technology have been progressing. It has become more and more difficult to learn the basics. It is also required for you to learn more about frameworks and software that runs on these complex systems. But you must remember that there is always the user in this field also. That’s where you can learn a lot.