Posts

Showing posts from April, 2020

A study of Bulls and Cows in C++

Image
This repository contains my attempt of doing Bulls and Cows game with C++. It is a study so everything here is done while I am trying to learn coding with C++. Here is how it looks like in normal mode: And here is how it looks like in verbose mode: Here is the source code: https://github.com/ibetovski/bulls-and-cows-study/blob/master/main.cpp There is a binary compiled on Linux here: https://github.com/ibetovski/bulls-and-cows-study/raw/master/bin/Debug/learncpp What is done: - The computer generates a 4 digit number - The generated number doesn't start with 0 - The generated number consists of unique digits. - The computer calculates the number of bulls and cows. - The player can guess computer's number To do: - Reading about Bulls and Cows algorithm - Implementing computer guessing the player's number. - Probably adding class to manage the logic. - Too optimistic: UI using Qt. Should read about Qt. Challenges I faced so far. - I am not sure if kee...

Learning to code and how to approach a new programming language

I am learning C++. This is a new language for me than the ones I already know (or at least I think I know them). I am writing this post to share with you what learning process I am applying. Here are the rules I am trying to apply: Code every example from the book. When you read the example your mind tricks you to say "Oh, it is pretty logical and easy. It makes sense" until you code it and run it. Only then you find out if you got it right at first. When you start seeing errors from compiler or interpreter, then you start getting familiar with them. Later, when you stumble upon the same errors again, you know what to do to fix the error so you can move on. Take as an example reading how to drive a car.  Reading about it or watching how others do it is not the same as when you actually do it. It is the same with coding. You have to try, to fail and raise. Only then the brain learns. Do not use an IDE. The IDE will autocomplete most of the objects and methods for you...

It's benefitial for a developer to work on a slower machine

Image
How much resources do you need? Currently we can notice there are a lot of YouTubers who create videos about product reviews. They compare one product with another and usually say if one is good or bad. But what we can notice there is they usually review a flagship products and try to find the best one – which one is the fastest, performing the best, has the best camera and etc… But when we watch such kind of videos we usually end up buying the most powerful product and probably the most expensive among the products of its family. It is pretty common nowadays to ease our life when we buy something just to reach for the best one because we are afraid if we get something from the middle range class it might not serve us well. But what actually and how much do we need? Let me share my story with you. As a developer I used to own a MacBook Pro mid-2015 (the one with the best keyboard and a lot of ports) which was the fastest on the market back then: 15 inch glossy screen...