As always, the source code is available here: iki.fi/bisqwit/jkp/polytut/ *A reminder: Do not reply to **_this post_** if you want me to see your comment. Post your words as a new comment, not as a reply, unless you are addressing the contents of **_this comment_** specifically. KZbin does not show creators new replies, it only shows new comments. If you reply here **_I will not see it_** unless I manually check for it.* If you are addressing a comment someone wrote, then you _should_ reply it, though.
@XArticSpartanX4 жыл бұрын
Any reason you're not using github to also host your files? Either way your work is impressive and I appreciate it
@Bisqwit4 жыл бұрын
My own server, the one linked in the comment yo replied to, is literally at my reach here at home. Putting stuff at a remote server is always some more work. I have used Github for many of my previous projects, but it is extra effort and requires more maintenance compared to just copying files over from a path to another path. Even if you argue it’s just a "git push", you also need to set it up, do README.mds and so on. More work. Also for a series under progress like this one I can limit which/when files are going to be visible to the audience. In Github everything that is pushed there is downloadable.
@Bisqwit4 жыл бұрын
First
@deepudinesh27204 жыл бұрын
Bisquit after commenting first: "They called me a madman"
@deepudinesh27204 жыл бұрын
Would appreciate if you could make a video on PBR rendering or something of the sort, I've been using unity for a while and I'm interested in the behind the scenes working of it.
@ircitonod36744 жыл бұрын
hey, that's not fair mr bisqwit
@bahathir_4 жыл бұрын
I am suprised! You started with "Selamat pagi" :) Next, try Japanese.. Ohayou Gozaimas.
@madridx20104 жыл бұрын
Second!
@bemo643411 ай бұрын
This is my second favorite KZbin video of all time! Really inspiring stuff! 👍
@tsonez4 жыл бұрын
Not sure if it was mentioned in the video but the book “Refactoring: Improving the Design of Existing Code” has a solid definition of refactoring - what it is, why it’s beneficial and what’s good design as the aim of refactoring. Another important (and perhaps more approachable) book is “The Pragmatic Programmer” (20th Anniversary Edition) which also handles refactoring as part of more general discussion on design and programming as a craft. Both books are highly recommended.
@audiencebigg63024 жыл бұрын
it's really nice that you've explained about readability and maintainability of the codes, separate them into multiple header files, *and* using less dependencies while ensuring that it can be platform independent
@izaac2294 жыл бұрын
This is like a sort of crash course into Computer Graphics. Thank you so very much for the videos!
@duuqnd4 жыл бұрын
Eventually you won't have technical debt, but rather debtnical tech.
@metallitech4 жыл бұрын
Modern C++ template programming is hideous and hard IMO. Hats off to you.
@saultube444 жыл бұрын
Why? Have you done any efforts to influence the makers of this template to improve it? or you just limit yourself to complain?
@eagle2com4 жыл бұрын
@@saultube44 What. I think google translate has failed you.
@Maraus924 жыл бұрын
@@eagle2com As much as I want to think that templates are a good idea, I just can wrap myself to like them. You can solve problems much better and more readable with other tools. Or I might be wrong and templates are a good solution.
@Caellyan4 жыл бұрын
@@Maraus92 Any type-safe language requires something like them. The alternative is storing type information with the objects, which doesn't work as well with native languages and makes all objects consume more memory without giving any choice to the programmer. They allow code to stay nice and compact. Besides, most of the template code gets optimized away anyway. Also, Lothbrok*
@aevus4 жыл бұрын
@@Caellyan thats not the point. The idea of template metaprograming is good, but the execution in c++ is just bad.
@ClaymorePT4 жыл бұрын
The only time that manager understands what Tech Debt is, is when they hire someone and that someone quits after spending one week looking at the codebase. When that happens, it's too late and the product fails.
@crafoo4 жыл бұрын
The problem is software engineering is not a real engineering field, at least outside of aerospace. Engineering has well-tested methods for managing projects and addressing known issues. The issue with software is estimating real costs and schedules, and inexperienced managers/MBAs with expectations detached from reality.
@ClaymorePT4 жыл бұрын
@@crafoo That's not true. The problem with the field is that there's lots of programmers who do not take responsibility for the problems created by the software they design and implement. You have tons of software development fields which apply strong mathematical skills, from architecture going trough language design. That is why you can also study computer science. Because it is a science field on it's own.
@KuraIthys4 жыл бұрын
@@ClaymorePT It's worse than that. There are some 'experts' deliberately creating a mess so that nobody else will understand it as some twisted form of ensuring job security. Priorities are messed up.
@monad_tcp3 жыл бұрын
@@crafoo "The issue with software is estimating real costs and schedules" You can't estimate what you never done before. And if you are using software to automate things properly, you are never doing things exactly the same ever again, because software can be infinitely replicated just by copying the executable. So, basically, each and every software product is more of a handcraft than anything engineered. Its more closer to writing a book than to an actual engineering field. And the schedule and cost is not even the real issue. The real issue is having predictable results, i.e., the software will work for the intended purpose and attain whatever is that you wanted from it. Computing is much more of a science than anything else, every software you write is an experiment, which is why you never, ever define the schedule or the cost, you only say what you are interested in investing, like X per month, and then we can see how far that will get you (you can pretty much see the progress as we use iterative methods [aka, "agile"], so you can see if you need to kill the project, invest more or go another direction, or think that's enough and just deploy and use what you got). Yes, its that risky, almost 80% of the software projects will fail. (while on civil engineering that's more like "only" 40%, if I'm not mistaken). Want something that you have a real cost and a schedule, buy a software that already exists, leave the creation of newer software for those who are adventurous venture capitalists that can afford to lose. The real issue is that MBAs/managers think they can manage a software development shop like a factory where you input coffee and out comes code, but that's not how it works. Its not a issue with software, its a issue with business management practices that don't work for creating software and were created for factories. In a car factory you are going to make that specific model of car 1000000 times. While software is more like designing an entire new car engine, frame, everything from scratch, every time, and then you hit a magical button and get a "print" of 1000000 cars, that button is called "compile", software is 99.99% design and 0.01% production (which is actually made by the machines themselves while the people drink their coffees). And yes, even with reusable parts (OO mostly largely failed at it), its hard to reuse a part of something in something else on software, software is much more complex, this is were the analogy breaks, you try to reuse a banana, but then you get the entire gorilla and the forest as a dependency, reuse never worked that well. The last job I quit, I left nine copies of the Mythical Man Month book, because I though with 9 copies they would read it much faster, 9 times faster (I wish they got the joke, which they will after they read the book).
@petrosiuksline70134 жыл бұрын
Doing work < refactoring the code I swear I refactor it more that I code up new one...
@iam-smza4 жыл бұрын
I am watching the video alone at 4 in the morning, and that demon voice at 4:06 scared the shit out of me.
@saultube444 жыл бұрын
LOL. He re is a great demon to help you code kzbin.info/www/bejne/hae4e6aratxrf7c
@bahathir_4 жыл бұрын
Selamat pagi, Tuan. Good morning, Sir.
@shmuel-k4 жыл бұрын
Thanks for extracting the hard-coded stuff into descriptive variables! I think this is the first time I (somewhat) successfully read your code!
@KuraIthys4 жыл бұрын
It's funny. Everything you're doing right now is by and large the opposite of what I aim for when writing this kind of code. You've made the functionality increasingly generic and capable of more and more things in a small number of functions, where generally I would aim to break up anything complex into smaller and smaller chunks that do the simplest possible things that it's reasonable to do. Compare and contrast: Function that can render arbitrary convex polygons. vs. Function that splits an arbitrary convex polygon into triangles. Function that splits a triangle into flat top and flat bottom sections. Function that can draw flat top or flat bottom polygons. Ultimately I suppose this comes down to intention. I learnt coding in an era and context where performance was at such a premium (and compilers were not always that great) that you do anything you can to ensure that the code is fast, and this includes things which force more assumptions onto the programmer. If a particular vertex ordering improves performance, the code would demand the use of that format, and so on. To a certain extent this is a tradeoff, but again, it depends on your goals. 'clean' code is often written under the assumption that performance is free, or that computer performance improves quickly enough that you can justify the slower but more elegant code because it'll be fine in future, over the messier but faster code. Sometimes you can get both, but at some point, frequently you have to pick one. And you might say writing 'correct' code is better, but with that attitude we never would have had realtime 3d in the 90's... And you could also ask yourself why something like Microsoft office now uses 1000 times as much memory to do mostly the same tasks it used to do with considerably less memory... Part of it is just because absent those harsh hardware constraints, people are free to do bad things (from a performance perspective) if it makes the code easier to understand, faster to write, or so on... Optimisation is a tricky subject though. There are many ways to approach optimisation, and it's usually not wise to optimise too soon. (though of course, creating things which make optimisation more difficult is not helpful if you know performance is going to be a major consideration in the future.) One of the obvious problems with optimising too early is that you may waste a lot of time using really aggressive optimisation on stuff that doesn't need it because it hardly ever runs...
@theairaccumulator71443 жыл бұрын
Your way of writing code is correct. Tbh almost everything after c++ 11 is worthless and serves as syntactic sugar that just makes code more inefficient and harder to read and mentain. Compare structs to tuples/named tuples for example.
@travbrack4 жыл бұрын
Thanks to Bisqwit, I'll always wonder if my coach driver is secretly a software engineering genius.
@ioanniskoutsouris99444 жыл бұрын
Awesome content as usual 👏 Would be very insightful to share how you think of design patterns before/during developing a project
@ooze98084 жыл бұрын
Nothing else on the internet releases as much dopamine as a new bisqwit video notification.
@miguellama76184 жыл бұрын
After a year of learning c++ at university I can finally understand your code :)
@laharl2k4 жыл бұрын
But can you write it?
@haky21734 жыл бұрын
"In that sit st ss the lt s tht thss tht si" 12:42
@More_Row4 жыл бұрын
Marek Hák ?
@SimGunther4 жыл бұрын
@@More_Row auto text replacement placeholders for the bot to change over time
@igor-the-software-engineer4 жыл бұрын
I'm a simple man: I see Bisqwit's video -- I press "like".
@undefined_cat4 жыл бұрын
When I watch your videos I feel so dump xD
@ll_sch1zophr3ni4_ii94 жыл бұрын
You need my bbc mati mati
@saultube444 жыл бұрын
You mean dumb, but that is good, a humble position is the right position to learn from a Master/Expert, a Master Programmer in this case, it's a good feeling, it should also makes you realize that you're in front of a wealth of knowledge and that you can learn a lot, so rewatch and read books, digital or physical, read a lot
@roku18923 жыл бұрын
i am a NodeJS web programmer, when i see this, i started math for programmers
@4yearsago2 жыл бұрын
Hi I'm your Indonesian fans "selamat pagi " You're great Bisqwit
@wijaksanapanji4 жыл бұрын
The intro surprised me 😂
@NonTwinBrothers10 ай бұрын
13:33 so glad mobile youtube allows pinch zooming now 👍
@PeranMe4 жыл бұрын
Great stuff, looking forward to upcoming videos!
@davidmahbubi4 жыл бұрын
Selamat pagi juga, Mr. Bisqwit
@dariusduesentrieb4 жыл бұрын
I don't understand why there is still no simple mechanism for compile-time for loops (that provides an index that can be used for tuple access)
@metallitech4 жыл бұрын
I think it's because compile-time doesn't have variables, and recursion is used instead.
@edino19814 жыл бұрын
There is for ...
@telnobynoyator_61834 жыл бұрын
When I realized how important refactoring is, my (programming) life was changed forever !
@accountNo04 жыл бұрын
Much love for this series
@whythosenames4 жыл бұрын
6:30 In your explaination the blue numbers start from 0 and the green ones from 1
@Bisqwit4 жыл бұрын
So it seems
@NonTwinBrothers2 жыл бұрын
6:22 Huh, I *REALLY* don't remember this part of the video
@vapourmile4 жыл бұрын
I find refactoring is part of development. I develop and refactor. It isn't always truly possible to tell at the start of development where something will go, how it will be used, or how best to implement whatever it is you're trying to do. You tend to learn by doing. Every once in a while you can realise it would be better to change how it's written to make it more flexible or satisfy an unforeseen use case. It's also popular refactoring doesn't always make things better as such. It's possible to have several different versions of something better suited to various different tasks.
@sankrantchaubey67314 жыл бұрын
Shalom! This series is awesome. Thank you so much Bisqwit! I would like to learn more about software rendering. Do you recommend any books for the topic?
@Bisqwit4 жыл бұрын
I’m not a book person so I don’t really know. I have got just one graphics book that I bought years ago upon someone else’s recommendation. www.pbrt.org/ Should read it some day.
@tomkaiserfoto914 жыл бұрын
Thank you for your thoughts, Bisqwit! I love seeing (and hearing) you explain these projects. I would be interested in your opinion - do you feel it's important to read a lot of code before attempting to write your own? Have you read any modern C++ code recently that you liked the style of? How did you get your coding style?
@Bisqwit4 жыл бұрын
I think it’s important to read a lot of code _in general._ I attribute it to a significant portion of my prowess. In the recent years though I have not done much reading. Pretty much the only pieces of modern C++, that I have read in the recent years that weren’t written by myself or that weren’t part of libstdc++, have been the sources of github.com/nlohmann/json and github.com/fmtlib/fmt .
@tomkaiserfoto914 жыл бұрын
@@Bisqwit That's some very good advice! I myself have not nearly done as much reading as I have writing code, and it shows in every project that I attempt. I'm starting a new project on image manipulation now, and I'll be sure to read a lot of code before writing the first line! Thanks!
@positive_energy31314 жыл бұрын
Thanks for saying "selamat pagi"
@manojshindetalks43654 жыл бұрын
I am a big admirer of your programming work and skills. Not seen anyone like you. Please if possible answer the questions. 1. Why any of your videos do not talk about Visual C++, Borland Delphi or Any visual development tool? Is it by choice or any reason 2. Do you have a strong mathematical background? I see you are using it frequently with super ease. 3. I also do not see you talking about low level Android programming (not talking about regular apps). Please let me know. Really curious to know how you decide what to use and not use for development.
@Bisqwit4 жыл бұрын
1. Visual C++ and Borland Delphi are both software that are entangled with products of Microsoft Corporation, particularly their operating system. I am not a customer of that company. As for UI development in general, not really something I am very familiar with it. 2. I used to be quite interested about math _in the elementary school._ My father taught me long multiplication years before I even went to school, and in school I liked to study things that were way beyond what the classes covered. Eventually that changed though. By the time I was in the vocational school, I only studied what I needed to study. Even today I only look up what I need, although I do spend much of my free time learning about stuff. What I do in my videos gives somewhat a biased view. I only talk about and do things that I know, and even much of that is specifically researched for that video or video series. If I don’t speak about something, it’s often because I don’t know about it. 3. I haven’t done any Android programming.
@manojshindetalks43654 жыл бұрын
@@Bisqwit Thanks for the detailed answers. I have been programming mostly in visual basic, c# and delphi. I do it for living but I was always interested in doing system and graphics programming since DOS days.. I am 43 now. I learned advanced c and some assembly coding but I could never do something worthwhile in it. I hope to learn from your videos but somewhat difficult to understand as I do not know a lot of stuff the way you do. Learning is the only way ahead. 👍
@wargacosmos28124 жыл бұрын
ahhaha Selamat Pagi Too,, Salam dari Jakarta Mr. Joel Yliluoma
@Milkybean4 жыл бұрын
I watch these videos so I can refresh how it felt to be in mathematics course in university
@treyquattro3 жыл бұрын
congrats on jumping into C++20 with concepts & templated lambdas (and a bunch of other stuff probably). What compiler are you using? I believe you're on Debian, and as everyone knows, Debian is many releases behind of the kernel, toolchains, etc. I tried to build Clang 11/12 but Debian Buster is too far behind with gcc or clang to build new projects (especially if they use filesystem)
@Bisqwit3 жыл бұрын
I use Debian _Testing branch,_ which updates at a much faster cycle than the official releases.
@treyquattro3 жыл бұрын
@@Bisqwit thanks. That was the obvious guess :-)
@ne0komodo4 жыл бұрын
Selamat pagi, semoga semuanya baik-baik saja 🌞 .
@JamesHoughton4 жыл бұрын
I haven't noticed this in other videos, but the code edits in this video seem a little strange to me. For example, at 1:22, you write ditiional_t and I was very confused. Has something changed?
@Bisqwit4 жыл бұрын
I am using a different input generator than before. It supports things the old input generator didn’t support, such as block indenting and rectangle-copies, but as it uses an algorithm that seeks to find a way to enter/modify lines with least number of inputs, sometimes it produces rather counter-intuitive results, and sometimes (nearly always) due to runtime constraints it gives up before finding the obvious solution. It works by treating the editor state as a graph and uses Dijkstra’s algorithm to test different inputs until it ends up with the desired target state, choosing the path with smallest penalty.
@JamesHoughton4 жыл бұрын
@@Bisqwit Perhaps there's a way to bias towards more human-like solutions. Are cursor movements counted as inputs? Maybe they should have less weight. Weight could be added for other paths too, like ones that add to the middle of words for example. Just some ideas :)
@Bisqwit4 жыл бұрын
Besides arrow keys it also uses home and end keys, and keys which move forwards and backwards by one word. These are considered cheap inputs because they are just single buttons. Successive arrow movements are considered more expensive.
@SpartanOdyssey4 жыл бұрын
@@Bisqwit This makes so much sense. I was wondering what was going on after seeing the input generator write "he he he he he" at 12:30 only to then see the editor fill in the rest of the comment like magic. I think this behavior is actually really cool even if it isn't necessarily human-like.
@baltazarus33074 жыл бұрын
Zdravo, Bisqwit! *Hello, Bisqwit!
@Svipers4 жыл бұрын
Why dont use a ide??
@chiptuneanimation44924 жыл бұрын
Bisqwit, are you going to do beginner friendly tutorials in the future? I, and I am sure many others barely understand what is going on in your videos, although it is just amazing to see.
@Bisqwit4 жыл бұрын
In general I try to make layered tutorials that have something for every level. Obviously not all of it will be useful for beginners, and some of it will be boring for experts. However, you should be able to get _something_ from it. For example, with this video, the general principles: Reduce dependencies, don’t have too big files, have each distinct topic together and different topics in different sections. Or the anecdote that in professional world there is rarely time to dedicate time for refactoring, so you should pay attention to it continually.
@telnobynoyator_61834 жыл бұрын
What text editor is that ? Looks a bit like vim...
For videogames like quake phisics and half life1 enviroment, wich laguaje programing will you choose?
@Bisqwit4 жыл бұрын
In general, the best programming language is that which you know well. And for me, that is C++ for compiled code and PHP for interpreted code. For engine development you’ll want a language that can be compiled into highly efficient code. C, C++, Rust, Go, Haskell are among these languages. For non performance critical code, such as UI, any language will do including interpreted ones such as Python and lua.
@ABaumstumpf4 жыл бұрын
I HATE Refactoring with a passion - because we never get the time for it, constantly have to refactor and recode cause the requirements change MONTHS after they have been signed, often after development finished, and even for future projects we get told "nah, we want it quick and dirty now and not make the life easier for everybody later on". And yes, just last we we got such a reply - not word for word but in that sentiment. It was about an extra simulation-software that was supposed to simulate some subsystems and hardware-processes that our software is interacting with (Were we have 4 different systems that interact with those subsystems independently or through each other). The initial simulator was written by a programmer in his spare time to safe him countless hours when developing, testing and debugging as the only ways possible to do that at this point are still some very crude command-line tools, writting to a socket by hand, or even just creating xml-files by hand...... So the simulator of course is not designed to handle larger systems, it of course is not easily integrated, it of course is a pain to setup (still easier than doing ti by hand), bad performance and all that. But the higherups don't care as "it works". Heck, just doing some basic system setup to test the already existing state often takes each developer several days, testing a single scenario that after release would be done in a couple of seconds in the real environment with physical processes takes a couple of minutes by hand. I had to write 2 new tools and change quite a few other components just to get anywhere close to the system-loads that the software is expected constantly when released as the existing tool, via commandline, were too slow to actually do that. Yes - using bash/python/whatever with the existing tools was over 2 orders of magnitude too slow for simulating the normal case. Each event sent via commandline has a ~150ms delay before getting registered and conversion to the actual signals takes another 20ms (yes, that slow) but just the one part i had developed was supposed to handle over 4 events a seconds, being just one out of over 20 Processes that work together in a hard-realtime situation.......... TL:DR: Refactoring - really important, hardly anybody that does not work with the code will give it any resources and make it worse for everybody.
@Bisqwit4 жыл бұрын
It sounds like you don’t hate refactoring, but you hate not being permitted to do it.
@90hijacked4 жыл бұрын
20:20 wait, are you saying SDL applications can run under fbdev, without X11?
@Bisqwit4 жыл бұрын
Yup
@90hijacked4 жыл бұрын
@@Bisqwit I've so far had no luck running either DF or CDDA using their SDL backends without launching X11, assumed it was impossible could just be the way they're implementing it, or maybe im missing something.. either way its def something to look into, thanks!
@Bisqwit4 жыл бұрын
Maybe you need to enable it explicitly when compiling LibSDL itself.
@90hijacked4 жыл бұрын
@@Bisqwit I'll be giving it a try over the next couple days, any and all advice is much appreciated, I'm not a C++ programmer per say
@cmdlp41784 жыл бұрын
The View::Draw function is erroneous, because it captures variables by reference. Outside of the function those referenced local variables (here: the function parameters) are already out of scope, so the references are dangeling. You could be lucky if everything works as intended, but that is UB. You could use a [=] capture instead.
@Bisqwit4 жыл бұрын
Considering that the only thing it captures by reference _is_ already a reference, I leave it up to you to prove to me with a testcase that the code commits a UB.
@cmdlp41784 жыл бұрын
@@Bisqwit I looked into a draft of the standard (github.com/cplusplus/draft/blob/master/papers/n4835.pdf) and, you are right (On page 102 part 13): [QUOTE] An id-expression within the compound-statement of a lambda-expression that is an odr-use of a reference captured by reference refers to the entity to which the captured reference is bound and not to the captured reference. [/QUOTE] I personally think that something like return [&]... is a direct code smell and I often am explicit about "references" and use pointers instead, but only when lambdas are returned from a function.
@Bisqwit4 жыл бұрын
It essentially returns to the caller the same reference that they themselves provided, and thus, falls to the same category as this code: const std::string& testfunc(const std::string& str) { return str; } This code is perfectly safe if used like this: std::string str(5, 'a'); auto& ref = testfunc(str); However, it is _not_ safe to be used like this: auto& ref = testfunc(std::string(5, 'a')); But it _is_ safe to use like this: std::cout
@Darksoulmaster4 жыл бұрын
Yay new video!
@BadPotat04 жыл бұрын
@Bisqwit What's about adding units tests? When refactoring, in particular, unit testing shouldn't be left unheard of. I known you aim to provide a one-screen format for your videos and the size of function is constraint by this goal, but I still believe there could be a workaround with this issue. What's great with unit testing is it help to document your code "as code" as well. If you do some refactor you can make sure to valid if behavior is the same as before and help to stay sane. You could even use TDD to think about your code will do beforehand. This can help to better structure your code. Now you may say it's a bit early to talk about unit testing as we can just manually test the result when running the program, but if you intend to revisit this project later your future self will thank you even if it require additional maintenance to keep the tests up-to-date and anyone trying to read your code will get a better hint about what's going on. Sometime to provide inspiration, you can be required to make a big project, if so, then you may need a solid base and that's where unit test come handy.
@Bisqwit4 жыл бұрын
Yes, unit testing is another topic. I may attempt to cover it some day, perhaps.
@abab-ge2tu3 жыл бұрын
Is it recommended to always keep output from logic by separate functions?
@Bisqwit3 жыл бұрын
No guideline is absolute, but in general it is smart to keep user I/O and program logic separate, so that you are free to change either without affecting the other. Identify architectural components of your program and keep them separate, connected with as thin paths as possible.
@spiralingspiral724 жыл бұрын
Magandang umaga po... Good morning, sir...
@eyemotif4 жыл бұрын
do you think prototyping and then refactoring is more efficient or easier than trying to make everything as generic as possible the first time?
@Bisqwit4 жыл бұрын
The more experience you gain, the less chance there is that the shortcomings of your design become _immediately_ apparent, but it all depends really on case. There is no generally applicable answer to your question.
@jasonyesmarc3094 жыл бұрын
In my experience, trying to make everything as generic as possible the first time can make you spend a lot of time rewriting large chunks of code as you discover better solutions in the middle of your work period. Most bugs and logic problems aren't easily predicted. I've found it's better to prototype first, because you will write your code toward where your solution really is, rather than toward where you predict your solution to be. Once you know exactly what the working best solution is, you can generalize it with a solid foundation in mind for the program's function. If you write generically out of the gate, it's only practical if you've already figured out what your full code will be beforehand, at which point you're hundreds of leagues above me and my advice would no longer have value. I try to sit somewhere in between. I'll prototype, but the moment I notice I'm writing the same code twice, I refactor that part to be less redundant and more generic, and continue prototyping.
@igor-the-software-engineer4 жыл бұрын
Btw, Bisqwit, what do you think about path tracing?
@monad_tcp3 жыл бұрын
4:20 No #pragma include in C++20 ? why ?
@Bisqwit3 жыл бұрын
I think you mean #pragma once. For a discussion about its standards compliance and caveats (which may be why it is not a part of the standard) see en.wikipedia.org/wiki/Pragma_once
@benjaminbrady23854 жыл бұрын
So what editor do you use when programming yourself?
@Bisqwit4 жыл бұрын
kzbin.info/www/bejne/kH6lgqCehJ1-p6s
@dertechl66284 жыл бұрын
It's obviously THAT editor.
@cortexauth40944 жыл бұрын
I am thinking to work on a game engine (2D first), I was planning to do it on C because I just want to get better using it, and I wanna use up optimizations messing with assembly instructions. But I have also learned modern C++ recently and I can go with it too. I am so confused!
@laharl2k4 жыл бұрын
remember you first design it, then you code it. you go from the end product, back each step looking at what you need for the next step. Game > background and sprites > how do i draw background > primitives > etc. If you are gonna do it in C/C++ i can recommend SDL2 and try making (if you like sonic) a simple program that loads the tiles, draws a map, and lets you move a sprite on it, the rest depends on how motivated you are.
@cortexauth40944 жыл бұрын
@@laharl2k is it bad idea to use opengl?
@cortexauth40944 жыл бұрын
@@laharl2k I have done that in SDL! That tile and sprite thing. What I am more interested in is making transitions, and queues (on how layers deep you are in, like opening inventory then details, fading and being able to go back). I referred to someone's code on some ideas related to a game, but it was still bit tricky. I need to try again
@cortexauth40944 жыл бұрын
Those "professional" effects were all in a C game, I saw and read the code, but I was puzzled because of terminology, and formalism, Like, code was so structured, I started feeling dumb and could not think of contexts and queues same way. Maybe I need to actually try and do it bit by bit
@laharl2k4 жыл бұрын
@@cortexauth4094 opengl is a bit more complicated i myself dont have experience with it but id say start with the basics and then "enhance it" With SDL you work with your standard ram, but to use openGL and all the hardware acceleration you need to upload your content to the video ram (afaik) which changes the way you do the graphics entirely. (also why doing images in software is so much slower. all the data transfer to and from the video memory kills your fps, you can see that enabling and disabling hardware acceleration in sdl)
@ianpan01024 жыл бұрын
I really like the font used in the terminal (an old-school feel), anyone knows what it's called?
@Bisqwit4 жыл бұрын
Which one of them? I change the font like 46 times in the video.
@ianpan01024 жыл бұрын
@@Bisqwit Hi Joel! I'm most interested in the first one you used. Let's say, the one at 1:00. I think it really resembles IBM VGA8. However, IBM VGA8 has a dotted zero, and yours has a slash.
@Bisqwit4 жыл бұрын
The fonts used by _That Terminal,_ which is the terminal in which I used the editor, are listed here: github.com/bisqwit/that_terminal/blob/master/doc/fonts.md
@ianpan01024 жыл бұрын
@@Bisqwit Thanx I'll check it out
@ianpan01024 жыл бұрын
@@Bisqwit Found it, it's the EGA font (similar to VGA, but with a slashed zero).
@quantummechanist14 жыл бұрын
@Bisqwit how do you deal with a corporate programming job where management does not believe in refactoring? I'm looking to refactor my job since I'm not allowed to refactor code (it's a Finnish company to book)...
@SimGunther4 жыл бұрын
If an emotional appeal doesn't work, just think about working some place that'll allow refactoring in the first place. Not sure how great a code that company has in the first place if refactoring and basic code ethics/practices aren't allowed to flourish in the first place.
@tsonez4 жыл бұрын
Not Bisqwit, but “The Pragmatic Programmer” has the suggestion try explain the need to the client/management in a plain simple way. Like, the code has a disease (design issue) that spreads unless operated (refactored). Or the code is an overgrown garden which needs cleaning and pruning. Or it’s perhaps a messy restaurant kitchen where it’s hard to get work done efficiently with required hygiene (quality)... Hope this helps.
@JosefdeJoanelli4 жыл бұрын
The clock in the top is running in real time, but his typing is impossibly fast, how is this happening?
@JosefdeJoanelli4 жыл бұрын
Haha literally the next minute he explains it 😁😁
@motsgar4 жыл бұрын
This is the reason i am often stuck for weeks because i want to create my new feature so that i can actually use it without any weird hacks and so i can add to it later
@eemelilehtonen86284 жыл бұрын
I have no idea why that (sizeof...(args)) destroys my head
@eemelilehtonen86284 жыл бұрын
Found it> "en.cppreference.com/w/cpp/language/sizeof..."
@Bisqwit4 жыл бұрын
For whoever is reading that, the URL should contain _three_ trailing periods. Fix it manually if it does not.
@TheMariday4 жыл бұрын
I've just noticed something after watching a few of Bisqwit's videos... I always assumed the coding is sped up but the timestamp at the top of the screen is real time. So my question is how the hell does anyone program this fast‽‽‽
I was looking around for anyone writing code from scratch without using standard libraries, but I couldn't find any ? Why isn't it a widespread practice to write your own I/O library or own gui library ? I know that logistically speaking it's programming suicide but being ignorant about how things actually work in the non-abstract low level domain is not fulfilling to me. What should I do ?
@gayusschwulius84904 жыл бұрын
Separating C++ and the STL is generally a bad idea because they're build to be complementary to each other. If you make your own libraries, your code will be extremely platform dependent, because every OS has a slightly different way of handling I/O, threads, windows etc. STL generalizes that task and allows you to compile your code for pretty much any OS in existence. The standard functions are also more efficient than anything you could ever write and it's therefore a good practice to use them instead of inefficient custom functions if you can. If you really want to learn how to do this very low level stuff on your own, your best bet would be to look up an Assembler tutorial to do it, then integrating that into your C++ program using an _asm{} block.
@perplexedmurfy92624 жыл бұрын
Nero Das, You should introduce yourself to Handmade Hero where the sole programmer live streams himself working towards shipping a game that doesn't rely on external dependencies, all while explaining what he's doing and why he chooses to do it. The archived livestreams should be on here under "Handmade Hero"s youtube channel.
@Bisqwit4 жыл бұрын
“Write your own I/O library or own gui library” is rabbit hole with no end in sight, because of the reasons I mentioned in the video at 20:26.
@notlegal994 жыл бұрын
your accent sound smart. i like it
@simetri54593 жыл бұрын
Selamat pagi joe a.k.a bisqwit
@antonsurviyanto58964 жыл бұрын
selamat pagi pak..
@saultube444 жыл бұрын
Fascinating, thank you. What do you think of Intermediate Languages (IL), like Java and C#? I personally think they're a stone in the shoe, and we can do way better with automated compilation and Assembly-Level Efficiency (ALE) to run code ASAP in all platforms; 1 good example of this, is Qt.io Have you met Bjarne Stroustrup?
@Bisqwit4 жыл бұрын
Java is like “yo dude, I heard OOP is the next great thing, so I put OOP in your OOP soup and covered it in OOP”. It takes from C++ only the things that are bad and runs with it. C# is like “yo dude, Microsoft here. We heard Java is great, but it’s not invented at Microsoft, so we made our own”. Although to be fair I heard C# is somewhat better than Java, but personally I have had no interest in either. I have not met Stroustrup.
@kahnfatman3 жыл бұрын
It takes a lot of courage to piss off both halves of the colosseum in the flame war between Java and C#. :D Hat off to you -- Jedi Master @Bisqwit, as always.
@kahnfatman3 жыл бұрын
@@Bisqwit It takes a lot of courage to piss off both halves of the colosseum in the flame war between Java and C#. :D Hat off to you -- Jedi Master Bisqwit, as always.
@carbon134 жыл бұрын
People complain about how bloated the template programming side of C++ has become, but to be fair it allows you to accomplish amazing things at compile time that would be impossible or ambiguous without it.
@laharl2k4 жыл бұрын
It would be cool if C++ had all the ready to use high level libraries python has so you could seamlessly mix high level and low level code without having to cobble together python into your c++ code. Some stuff is easier to do in low level and some other stuff is easier to do in high level where speed isnt that important.
@zatherz24984 жыл бұрын
nobody in the history of the world has ever said compiletime execution is bad, it's just that the C++ implementation of it is beyond disgusting
@hyperbole57264 жыл бұрын
Where can I learn about all this template programming? I'm comfortable with almost any other C++ paradigm including simple templates, but this seems crazy. Also is it even worth considering practically all computation will be done with 32/64-bit int/float anyway?
@Bisqwit4 жыл бұрын
All that the template stuff does is that it lets you use the same algorithm regardless of the presentation of your data. It’s a thing that makes programming easier in presence of constantly changing requirements (such as when doing a video tutorial series). Later on (two episodes from now), it will also help using the same algorithm for different purposes, such as scene rendering and lightmap rendering, where the latter is done by first using lightmap coordinates instead of world coordinates and then doing several _recursive_ renderings for each luxel. It means I won’t have to write separate rendering routines for these different purposes. Like I said, it’s like pulling strings from afar. It is _not_ a thing that is done for efficiency. Rather, it is a technique that helps you gain reusability of code _without_ sacrificing efficiency.
@roku18923 жыл бұрын
omg he speak my country language 😳
@ceciphar4 жыл бұрын
Just realized that KZbin stopped showing your videos in my subscription box
@Bisqwit4 жыл бұрын
Oh :-( Even on this page? kzbin.infosubscriptions?disable_polymer=1 The next will be published this Friday, so check if it happens again.
@Bisqwit4 жыл бұрын
So, did it work?
@ceciphar4 жыл бұрын
@@Bisqwit nothing. Been on all week. Edit: with the link I was able to see it.
@SoftBreadSoft4 жыл бұрын
I'm always making messes. Always refactoring the next day.
@JoneKone4 жыл бұрын
Fantastic :)
@huyvole97244 жыл бұрын
Advance C++ make me headache
@KishoreG23964 жыл бұрын
I chuckled when I first clicked on this video, since I saw it had exactly 256 views, which overflows the value for an 8-bit unsigned binary number. 😊
@madridx20104 жыл бұрын
Could a Noob programmer like me get a heart from a god programmer like you ?
@floatingpointerror554 жыл бұрын
Take a shot every time he says "function" 17:35
@samzx814 жыл бұрын
Nice video :)
@KrrSplat4 жыл бұрын
Why not just have DrawPolygon break the polygon into triangles and then pass the triangles to DrawTriangle???
@Bisqwit4 жыл бұрын
That’s actually what I did before. That’s the Tesselate thing that I mentioned. It was covered in the previous episode. But it does involve some redundant calculations. For example, for a quadrilateral, you end up with two triangles that share an edge. The same edge will have to be computed and interpolated twice.
@official-obama Жыл бұрын
12:31 we he hed he h). "se he
@marcoaurelio95274 жыл бұрын
incrivel!
@elmonni21034 жыл бұрын
SHALOM is this siipasplas?
@Bisqwit4 жыл бұрын
You tell me
@voxbine40054 жыл бұрын
I dont know if you speak spanish but i will try speak english.. Where you study to do all of this programing content, i like programing but i cant underestand all of it its bery dificult and confusing to me underestand this.... But i love it and i know if i study all of this i will able to know how this work, i went to a programing school but i just learn about python and the profesors before i enter to the school they promised me learn about c# c++ and some java. After that i move to another scool but without programing... Sorry for my english....
@Bisqwit4 жыл бұрын
You did the correct choice: I don’t speak Spanish. Where I learned “all of this” is irrelevant. The correct question is “when”, and the answer is “25 years of professional experience”. The world was a different place when I began (in 1992). Even the Internet did not exist (in practicality). The tools, operating systems, and hardware were different. Each person has a different story.
@voxbine40054 жыл бұрын
@@Bisqwit that's right i think experience is a little bit more important than just learn but its important learn too so. Thanks :D now i will go to some website to practise with some .bat cmd console and have more information and experience in my brain :D but python is not a languaje that i want to learn well is not for videogames i guess...
@GianGiovanii4 жыл бұрын
Selamat pagi
@SomeRandomPiggo4 жыл бұрын
Here at 50 views!
@fredg83284 жыл бұрын
What ? A "two dimensional" cross product ? Heretic ! :D
@Karreth4 жыл бұрын
dot product ≠ cross product (except for scalars).
@kuro680004 жыл бұрын
Your code illustrates a problem that other languages have solved and that is one of the main reasons why it's getting less and less popular. The syntax is complex and esoteric and doesn't make for readable code. It's very far from self documenting.
@chappie36424 жыл бұрын
The point of code is not to be easy. C++ won't die because it's currently the highest level language that allows you to keep the performance you could get from assembly as long as you know well how the language works.
@dariusduesentrieb4 жыл бұрын
The syntax for complex stuff is complex. You can translate Java/C# code into C++ and it will look mostly the same (except for memory management, which is not really about the clarity of the syntax). But if you'd try to translate a heavy generalized C++ function with tuples and auto and templates everywhere you would need a lot more code with Java if it is even possible at all.
@metallitech4 жыл бұрын
@@chappie3642I doubt that the performance is like assembly. The modern template programming avoids run-time polymorphism, but I would have thought it's always possible to write a faster program in assembly.
@ll_sch1zophr3ni4_ii94 жыл бұрын
E=mC2
@mokamoka75864 жыл бұрын
oh , modern c++ again :/ , keep your code readable and simple is much better than flexing your c++20 muscles back to c++03
@udayanjoshi26914 жыл бұрын
Is this even cpp? This doesn't even remotely resemble what I learned in college.
@saturdaysequalsyouth4 жыл бұрын
C++ has gone through a lot of changes.
@Bisqwit4 жыл бұрын
Many schools only teach C++ like it was still 1997, when C++ still kind of sucked.
@udayanjoshi26914 жыл бұрын
@@Bisqwit yeah. I basically program with c style in cpp. How does one even learn this?
@indrit664 жыл бұрын
@@udayanjoshi2691 by being a nerd bro he probably put thousands of hours in programming and being smart helps too look at hes geeky personality tho i think he dosent care about girls either so only programming
@aatishsingh11834 жыл бұрын
Do you spend your whole time in programming? Do your mom and dad live with you? Do you have brother or any sibling? I don't know but i am very curious about you since i started watching you.my intentions aren't to hurt you but i want to know about these things
@Bisqwit4 жыл бұрын
Programming is my what I spend most of my free time with, and given today’s worldwide situation it tends to be the only thing too. I like to keep my personal situations private, but I do live alone for more than 20 years already.
@dominuspiritus4 жыл бұрын
Omg. New video with good code and ugly font
@Sopel9974 жыл бұрын
The moral of the story is that tuples are not the right abstraction for everything. Sorry, but this is an unreadable mess stemming from overgeneralization. Polygon rasterization is not a common algorithm. It's used in domain specific contexts with already abstracted geometric primitives. It doesn't need to be so generic. I also don't like the overuse of auto - explicit typing has a merit, especially in public API.
@Bisqwit4 жыл бұрын
While you are right that polygon rasterization is not a common algorithm, this tutorial series makes for an exception because I keep adding new features iteratively, and when I do that, I want to focus on the actual topic at hand _for presentation reasons_ and not have to rewrite half of my code every time I add a new feature. But you are entitled to your opinion of course.
@dariusduesentrieb4 жыл бұрын
Ahh reddit.
@Sopel9974 жыл бұрын
@@dariusduesentrieb ? yes, I posted it there too
@Sopel9974 жыл бұрын
@@Bisqwit Understandable. The only problem I have with that is that people may think this is actually what writing C++ looks like and should be. Objectively it's a good video, but the message may not be exactly right.
@metallitech4 жыл бұрын
I agree about auto; I like to see types. I was thinking of writing a visual studio plugin-thingy that changes all the "auto" for the type.