How to know what I don't know about C++

As a self learner,I am struggling to get any confidence in programming. When I see typical easy problem I just don't feel interested to solve. But when I see the harder problems , I feel like I know nothing about C++.Understanding the algorithm is not the problem without the research papers.I studied quite a few books on C++ but I know my problem is, I neither solved any exercise problems at the end of each chapters nor practiced from any good website. I studied a lot of syntax of C++. Unlike other people I couldn't give enough time on programming since I am not a CS student but will change my career after I graduate from college.I apologise for all of my short comings.

With those being said, my biggest problem is I can come up with so many project ideas but I just struggle to get through , even don't know how to approach.

Last night I was trying to read a JPG/PNG/BMP image file and apply a few transformation on it just using pure standard C++ library. I don't want to use any third party to accomplish my job. Searching through internet I found it was never easy, got few codes and get struggled to understand those because those didn't come up with any good comments or any theoretical description.Here I feel like applying filtering,FT or rotating the images is easier than to read those images in C++.

Just before writing this post, another small project idea came to my mind. How it would be to build a command line program which will search for nearby available WiFi and will connect my laptop after I put on username and password. I just don't want to use my OS built-in program. And I even don't know how to communicate with Wifi driver using C++.I want to accomplish it using standard C++.

Few more project ideas those came to my mind : changing the laptop brightness along with power saving option, Sending a text file from PC using bluetooth to my mobile, reading an audio file and changing its tempo, designing an end to end video terminal over same network between two laptops or desktops, may be a very simplified web parser, a replica of netstat command and so many. May be those can be easily done if I use third party libraries or some other programming languages like python, java, C# etc. But I just want to accomplish those using standard C++ libraries.

I feel like I should learn a programming language in such a way that based on my knowledge of that language I can build whatever I want without any "google search". Suppose if you know calculus you can build a small calculus library for fun, same goes for linear algebra. If you know a decent amount of C++ you can actually implement those algorithms easily.

But for most of the project ideas I just feel like , I don't have much knowledge of C++ to build that and its true.Thanks for reading this long post. Now can someone give me some suggestions on any of the project ideas I mentioned how to approach to build a strong programming background to accomplish those? Should I study whole C++ documentation ? May be I am crazy or this post may seem ridiculous to you. I still apologise. Any type of advice will be appreciated. I want to build the wheel again just for learning purpose.
My suggestions.

1. Go back and do the exercises in the back of the chapters. These are there to give you experience writing C++ programs. "I ignored the opportunities to gain experience, but now I don't have enough experience to do what I want to do" doesn't sound like a request for help that I really want to waste my time on.

2. Use 3rd party libraries to get the functionality you want. Much of what you want to do is very difficult, especially for someone who has no experience beyond reading C++ syntax. The 3rd party providers have worked through many of the details for getting graphics or image processing or sockets or bluetooth or wifi to work so that end users can focus on what they want to do with the functionality. If all you do is reinvent the wheel over and over again, you will waste tons of time that could be used doing cool things.

If you really want to do it all yourself, then you need to start with writing your own compiler.

3. Start small.
Last night I was trying to read a JPG/PNG/BMP image file and apply a few transformation on it just using pure standard C++ library.


JPG images are not simple. You shot yourself in the foot by picking a complicated task that requires significant understanding of the JPG specification - https://www.w3.org/Graphics/JPEG/itu-t81.pdf


Note that a lot of what you're trying to do cannot (reasonably) be done without libraries. C++ doesn't know what a keyboard is, or a monitor, or WiFi, or a network, or sound, and so on. Your operating system does know, and you can ask the OS to do things for you through libraries provided by the OS.

I feel like I should learn a programming language in such a way that based on my knowledge of that language I can build whatever I want without any "google search".

Programming languages run on real physical computers. You will always need to know about the real hardware and the real computer; either by having a library take care of that for you (as it does, for example, every time you write cout ) or by writing your own libraries to do so - either way, extra knowledge is required.
If all you do is read syntax, what you don't know about C++ is how to use it. How to debug, profile, test, port, maintain. How to navigate unfamiliar source code. How to use build systems and source control. How to interact with users and contributors.

I don't want to use any third party to accomplish my job

That is not what a programmer would do. Doing this takes you farther away from your goal of getting "confidence in programming".

If you want to "read a JPG/PNG/BMP image file and apply a few transformation", then look at the libraries available, study their documentation, bug reports, user feedback, and make an informed engineering decision on what library you would use. If you decide that all existing libraries are unsuitable, then shelve your idea until you write, test, and release your own PNG library.
The problem I see when I read your post is that you do not understand a few basic things :)

1) you do not seem to know what 'no 3rd party library' c++ is capable of. It does not have any tools for graphics, jpegs, brightness on your screen, etc. Everything you listed as wanting to do is much more complicated than you probably think. For example, jpeg is a form of image compression that uses the discrete cosine wavelet as its core***. It is nontrivial to convert that to a pixel array that you can rotate, and once you do that, its nontrivial to display a pixel array. Now, if you took a RAW image (RGBA binary file with no headers, you can write these from many freeware image programs) and rotated that and wrote it back to a file and used the image viewer to see if you got it right, that would be a GOOD starting project.

2) you seem to have no grasp of what is difficult. What is easy to a human is near insurmountable to a computer (consider just reading text from an image for an example of this). What is difficult for a human is easy for a computer (consider finding the first 1 million prime numbers, which a 5 line program can do in a few min and a human in 50+ years). It takes some time to get a feel for this. A calculus library is a LOT of code. A matrix library is a LOT of code. Numerical problems in computations are a lot of trouble to manage.

3) your premise is poor. You want to be able to do anything yourself, which is praiseworthy, but it is also foolish. You are a caveman with a rock and a stick trying to build a jet airplane. Its a lot easier if you have the tools and knowledge of those who have already been there and done that. If you want results in a professional environment or even at home, use libraries and code from other people, and make that work (and that is plenty challenging). If you want to invent libraries, that is good too (someone has to do it) but be smart about it, don't try to make something that would take 25 people 10 years to mature -- do something that is appropriate for 1 person on their own to do in a few months.


***I looked into wavelet compression around the time that jpeg2000 format was being tossed around (it ultimately failed due to the performance problems in web pages) and its pretty hairy stuff. I am not sure I ever fully understood it, and now, about all I remember about it is enough buzzwords to sound cool. You can get some truly astounding compression ratios if you are willing to wait.
Last edited on
Topic archived. No new replies allowed.