• 5 Posts
  • 65 Comments
Joined 3 years ago
cake
Cake day: January 7th, 2024

help-circle


  • The review process is all wrong if something like this is ever on the table as a single PR*.

    Big changes like this were made before, and knowing how to split the work (or at least trying to work it out) used to be part of the job.

    Hopefully, strong unions and worker involvement can remedy this, given we change our work culture to be closer to what projects like SQLITE and FFMPEG have (noting, of course, the fact these are FOSS, and made by volunteers, yet are very dependable), slower and stable development cycle that prioritizes high quality work that people can actually depend on and trust.

    • As in one single PR you’re expected to read, instead of one backed by tests and the like.


  • I’ll attempt to give a more hand wavey approach, but one that is hopefully easier to understand.

    First, implement:

    \\ find first index of `c` within string `str`.
    \\ returns true if found, sets `out` to result.
    \\ otherwise returns false.
    bool find(char* str, size_t len, char c, size_t* out)
    

    Now this can be used in a loop, where you supply a slice starting at the last line (or the beginning of the slice, on the first iteration), where len is the length of the original string minus the amount of characters consumed (index of the beginning of the slice, relative to the start of the original string).

    Note this requires calculating the string length beforehand, if this is a c-string (as in null terminated).

    This should be relatively simpler to understand and implement than what the standard library supplies, sadly the C standard library is not easy to use or very reliable, so you’ll mostly have to make do yourself.

    I hope this helped, I’m currently away from a computer so i can’t give a code example, good luck.





  • I can see that, personally i dislike using C++, as it has so many different ways to solve the same problem, confining a project to use a specific subset of C++ is very difficult.

    Though mostly what i would like to be closer to other languages, is what is mostly standard across everything, like tuples, so i wouldn’t have to do:

    Err fallible(Arg argument, Out* output) { ... }
    

    But at least attributes allow me to warn if the error in this case is unused.

    Thing is, C can compile to anything, so i wonder if Zig/Rust can really be a drop in replacement in most use cases.


  • I don’t know if I’d assume the same about them, as the way the argument was worded made it seem the new features aren’t a positive, or are broken in some way, or at least gave the appearance of the actual reason being technical and not skill.

    I was originally thinking of the use case for C is when you need to have something in a closed ecosystem, as in no dependencies, so generics made sense as an example, and while I’m aware one can use rust, it usually enables (and in a sense encourages) pulling in many dependencies, which is not always desirable.







  • I’d say 2001 and 2006 purely because the scrollbar is textured in a way that make it seem dragable at first glance |=|.

    Which is standard by now but still, besides that 1998 has all the other visual cues to denote what’s clickable and i would otherwise agree as i generally prefer flatter designs.