Having your camera in the top left instead of top right was definitely a poor choice. You might like microsoft-windows-terminal its better version of command prompt
When I learned C/C++ years ago, header files always felt like such a prehistoric way to combine multiple source files. At least we have #pragma once to cut #indef etc. but it's a waste of time pasting declarations into a .h every time I write a function.
From what I understand, the main utility of header files in the modern day is to provide a convenient way to see how you're meant to interact with an implementation file, particularly when working with closed-source libraries, or in large projects where digging through bloated implementation files could take hours. But I do agree, for solo dev, they're nothing but a nuisance.
When i worked with c++ at university i just wrote the code i needed in the header file , why not just do that? Also, I've seen you can include a .cpp file as well
8:50 "Which gets very annoying when you want to test stuff." This is the sort of thing I do all the time. I already hate Go for this nonsense. If a developer is debugging code, let it just build and run. While someone is developing software, they have all kinds of cruft they are churning out - half finished thoughts/ideas but need to test. It is NOT an error to not use a declared variable. Dump out a warning and then carry on. I'm now out on Zig too. Compilers should get out of developer's way and let them write software however they want to write it.
0:58 "But has a lot of flaws. Things like header files." Huh? I've never once considered header files to be a "flaw" of C (or C++). The macro preprocessor that results in nightmarish, unreadable gibberish? Absolutely. The C/C++ macro preprocessor is fundamentally broken by design and should have been redesigned decades ago to not be terrible. The concept of header files themselves are not really an issue. In fact, you have an @import at the top of your code, which is the same basic concept that you are complaining about being in C/C++.
My problem with c/c++ is not the fact that you have to import things. That's easy to do (once you've actually made a header file). Let's say you have 100 functions in a cpp file and you want to use them all in another file. You will need to manually copy the names of every functions into a header file so you can use them. This is unnecessarily tedious. Then there are linker errors, the problems with trying to create global variables and the requirement to put functions above other functions that reference them. In Zig you just put 'pub' before functions and variables and you can use them in other files. And I've never gotten a linker error. Another advantage to zig is everything is separate from each other. If you have two files with a function/variable with the same name, it won't create an error, as you access them similarly to classes.
A link to the code used in this series is in the description
Having your camera in the top left instead of top right was definitely a poor choice.
You might like microsoft-windows-terminal its better version of command prompt
I see Zig, I press like and subscribed!
When I learned C/C++ years ago, header files always felt like such a prehistoric way to combine multiple source files. At least we have #pragma once to cut #indef etc. but it's a waste of time pasting declarations into a .h every time I write a function.
From what I understand, the main utility of header files in the modern day is to provide a convenient way to see how you're meant to interact with an implementation file, particularly when working with closed-source libraries, or in large projects where digging through bloated implementation files could take hours. But I do agree, for solo dev, they're nothing but a nuisance.
usign #pragma once apparently doesn't work for all platforms and all circumstances, so using it is discouraged x/
lovee the content keep going
i=integer and u=unsigned integer
. In .{} refers to self/this so I interpret it as a tuple of a type that the function accepts but I’m new to ZIG
When i worked with c++ at university i just wrote the code i needed in the header file , why not just do that?
Also, I've seen you can include a .cpp file as well
8:50 "Which gets very annoying when you want to test stuff." This is the sort of thing I do all the time. I already hate Go for this nonsense. If a developer is debugging code, let it just build and run. While someone is developing software, they have all kinds of cruft they are churning out - half finished thoughts/ideas but need to test. It is NOT an error to not use a declared variable. Dump out a warning and then carry on. I'm now out on Zig too. Compilers should get out of developer's way and let them write software however they want to write it.
0:58 "But has a lot of flaws. Things like header files." Huh? I've never once considered header files to be a "flaw" of C (or C++). The macro preprocessor that results in nightmarish, unreadable gibberish? Absolutely. The C/C++ macro preprocessor is fundamentally broken by design and should have been redesigned decades ago to not be terrible. The concept of header files themselves are not really an issue. In fact, you have an @import at the top of your code, which is the same basic concept that you are complaining about being in C/C++.
My problem with c/c++ is not the fact that you have to import things. That's easy to do (once you've actually made a header file).
Let's say you have 100 functions in a cpp file and you want to use them all in another file. You will need to manually copy the names of every functions into a header file so you can use them.
This is unnecessarily tedious.
Then there are linker errors, the problems with trying to create global variables and the requirement to put functions above other functions that reference them.
In Zig you just put 'pub' before functions and variables and you can use them in other files. And I've never gotten a linker error.
Another advantage to zig is everything is separate from each other. If you have two files with a function/variable with the same name, it won't create an error, as you access them similarly to classes.