Day 1:
- Researching
- Datatypes
- Syntyax
- Compiling a program
- Windows (Visual Studio) setup.
So I started my journy on learning cpp, so I thought I would give it a week to see how I like the language. This is not my first time programming, so im comforable I can pick of many concepts quickly. My main reason for getting into cpp is im currenly a second year college student and I know javacript/typescript
and rust
. However, I want to be able to do more things than just web, and there are sadly not enough junior rust jobs for me to bet my future on (however I will use and keep learning rust for personal projects as I love it!)
So cpp, is being used in everything still. AI, Games, Video editiors, Desktop, Crypto, etc and I want to get more into systems programming and lower level embeded as it interest me more than my 3 years on the web with js. Today the first thing I did was install cpp on my laptop. I decided to do with visual studio as my IDE because on windows at least, working with c/cpp is a bit of a pain without an IDE IMO. After that I started reading a few blogs on getting started with CPP, and then watched a youtube video. After I got the basic syntax I wanted to try and making something other than hello world. And this is where it all went down hill...
Librarys, they allow you to reuse other code from other developers to help reduce the amount of code you have to write. Coming from javascript, the biggest and most popular way to install javascript libarys is using the npm registry. However, in CPP, many projects have there "own" way of building there project. One for what playform (x64, x32, x86) they target and also if your using windows or linux, etc... Its really a pain. I really missing npm i
right now. As much as npm has its problems, I think I really didnt appreicate how easy it was to just import fs from "node:fs"
and it works without needing to import headers, and make sure that the binarys exist on my system. Now I didnt really have a problem with .h
files or how cpp does this, the problem is theres a million ways to do everything and if you mess up a little on any build steps your program could never work!
Its very hard and a lot of knowlege to get over my head as a begginer, however I will keep pushing! Other than librarys, CPP as been fine so far. But I do under stand why a lot of people build or make there own functions and not install lots of librarys like on nodejs.
Day 2:
- Using external Librarys
- Memory Management in CPP
- Reading more guides and best practices
- Using Vcpkg for the first time. (CPP Library PKG manager for windows)
- Learning and using sqlite3 in CPP
First Project:
ConsoleSQLite3 App - A simple console app that reads the cli args and runs sql statements/querys
Over-all Thoughts:
While a much better day then day 1, C++ is harder than I thought. Working with SQL without an ORM is a very arcaice but natural feeling and it makes me apresiate all
the work done to make development easy in a lot of other languages. Ive spend the whole day writing, debugging, and coding c++ and ive
over-all learned a lot about memory management, and how to think about software. I was used to just writing code and thinking about
how functions work and how I react to them and there return types, but in c++ you have to think about what your doing and how you
affect the code around you in the program. At the start of making my console app, i wrote around 500 lines, with no test, and was feeling good. I had the CLI part done (somewhat) and had no compiler errors. Then I ran into Out of mem
errors from SQL. Had to stop and do some research on how pointers work, passing veriables, and also just how the SQL library itself worked and what the native funcitons did. Again, coming from JS and using an SQLite wrapper. They handle all the memory management under the hood and its easy to forget just how much programming is abstracted from us. Overall, I got my cli to create, drop, select, and almost insert into an SQL database. Im happy with this, was slightly sad I could not get my INSERT INTO
command to work but its just to much effort building a basic sql parser when im still learning the language without making the cli total crap. So I just stopped.
I also installed and enjoyed using VCPKG from microsoft while helps with installing cpp libarys basically from there standard repo. While im sure this is not what most veterns do, it helps someone like me learn the skipps without having to fight CMake build files.
Day 3:
Over-all Thoughts:
Day 4:
Over-all Thoughts:
Day 5:
Over-all Thoughts:
Day 6:
Over-all Thoughts:
Day 7:
Over-all Thoughts on CPP: