ChatGPT did much better but I cannot paste it into this text box no matter how many times I try with different formatting to get the white space preserved. chatGPT also could not figure out how to format it for pasting here.
If you look at the actual harmonics of a string and of horn, you will see how wrong you are. There is a reason why they sound different to the ear.
It’s because of this that you can have a relatively inexpensive synthesizer (not sample or PCM based) that does a crude job of mimicking these different instruments by just changing the harmonics.
There is one important difference between the harmonics of string and wind instruments: it's possible to build a wind instrument that suppresses (although not entirely eliminates) the even harmonics, e.g. a stopped organ pipe. If it sounds like a filtered square wave it's definitely a wind instrument. But if it sounds like a filtered sawtooth wave it could be either.
edit: in the past you would always get blocked, now I don't get blocked anymore when visiting lobste.rs with Brave. Anyway, do with this information as you please.
"bug" can refer to many categories of problems, including logic errors. I've certainly seen uninitialized variables be a source of bugs. Stackoverflow for example is full of discussions about debugging problems caused by uninitialized variables, and the word "bug" is very often used in those contexts.
I think what they mean, and what I also think is that the bug does not come from the existence of uninitialized variables. It comes from the USE of uninitialized variables. Making the variables initialized does not make the bug go away, at most it silences it. Making the program invalid instead (which is what UB fundamentally is) is way more helpful for making programs have less bugs. That the compiler still emits a program is a defect, although an unfixable one.
As to my knowledge C (and derivatives like C++) is the only common language where the question "Is this a program?" has false positives. It is certainly an interesting choice.
I mean that bug is *not in* uninitialized variable - bug in program logic. E.g. one of code pathes don't initialize variable.
So, I see uninitialized variables as a good way to find such logic errors. And, therefore, advice to always initialize variable - bad practice.
Of course if you already have a good value to initialize variable - do it. But if you have no - better leave it uninitialized.
Moreover - this will not cause safety issues in production builds because you can use `-ftrivial-auto-var-init` to initialize automatic variables to e.g. zeroes (`-fhardened` will do this too)
The same general concepts often have different terminology between different languages. For example, which is better, a parent class or a super class? Or a method function or a member function? Initializer or constructor? Long list of these synonyms.
You will typically find bugs go up when you do not use auto in most average C++ code bases because, as noted by another comment, a lot of C++ developers have the bad habit of writing uninitialized variables, which auto prevents.
As a C developer to me uninitialized variables are a feature and I love to invoke UB with __builtin_unreachable, because it makes the compiler able to actually bark at me on incorrect usage instead of it silently working.
This is indeed exactly correct. Probably on its own this is the most important reason for most people to use it, as I think most of the millions of C++ developers in the world (and yes there are apparently millions) are not messing with compiler flags to get the checks that probably should be there by default anyway. The keyword auto gives you that.
reply