seems pointless to extract `handle_suspend` here. There are very few reasons to extract code that isn't duplicated in more than one place; it's probably harder to read to extract the handling of the event than to handle it inline.
The logic of process flow is essentially one kind of information.
All the implementation details are another.
Step functions should not hide further important steps - they should only hide hairy implementation details that other steps don't need to know about.
There's extraction for reuse and then theres extraction for readability/maintainability. The second largely comes down to personal taste. I personally tend to lose the signal in the noise, so it's easy for me to follow the logic if some of the larger bits are pushed into appropriately named functions. Goes to the whole self commenting code thing. I know there's a chunk of code behind that function call, I know it does some work based on its name and args, but I don't have to worry about it in the moment. There's a limit of course, moving a couple lines of code out without good cause is infuriating.
Other people prefer to have big blocks of code together in one place, and that's fine too. It just personally makes it harder for me to track stuff.
defer is still something you have to consciously put in every time so it destroys the value semantics that C++ has, which is the important part. You don't have to "just write defer after a string", you can just use a string.
The 'not a problem for me' is what people would say about manual memory in C too. Defer is better but it isn't as good as what is already in use.
I'm not sure why you shouldn't make your compiler accept CRs (weird design decision), but fixing it on the user-side isn't exactly hard either. I don't know an editor that doesn't have an option for using LF vs CRLF.
The unused variable warning is legitimately really annoying though and has me inserting `_ = x;` all over the place and then forgetting to delete it, which is imo way worse than just... having it be a warning.
I don't know an editor that doesn't have an option for using LF vs CRLF.
And I don't know any other languages that don't parse a carriage return.
The point is that it was intentionally done to antagonize windows even though they put out a windows version. Some people defend this by saying that it's easy to turn off, some people defend it by saying windows users should be antagonized.
No zig people ever said this was a mistake, it was all intentional.
I'm never going to put up with behavior like that with the people making tools actively working against me.
We've had machine translation for a while and I don't think anybody particularly thinks of it as a bad thing? Writing something and then having a machine directly translate it (possibly imperfectly) is a lot different than a machine writing the thing.
Personally I would like people to try learning other languages more (it's hard but rewarding) but you can't learn every language ever, and it is really hard to learn a language to fluency.
> We've had machine translation for a while and I don't think anybody particularly thinks of it as a bad thing?
Not all, but some machine translators can be comically (if not horrifically) bad sometimes. Search Twitter-become-X for examples. Native writers can't pick a working machine translator unless they are explicitly allowed to do so themselves.
The WASM component model is really cool in that you can export basically anything as a component and use it in basically anything else that can compile to WASM and understand components.
I would love something like this for native applications; I'm so tired having to wear C's skin every time I want to do bind together code written in different languages.
I disagree. That's how WASM is now, and I guess that's fine, but that's not all it could be. I really think it would be awesome if you could write code for the web in your preferred programming language.
iirc webassembly components need to explicitly import anything they use, so it should be transparent which dependencies something has by just grepping its WIT for `import`
I wonder what a 'mixed model' would look like (e.g. is it even possible), e.g. an application which wants to call into component model APIs, but at the same time also needs to call into JS code which then accesses the same APIs. This hybrid model will definitely be needed for any non-trivial web application.
reply