• 0 Posts
  • 101 Comments
Joined 1 year ago
cake
Cake day: August 7th, 2023

help-circle




  • I largely agree with this nodding along to many of the pitfalls presented. Except numbers 2s good refactor. I hope I won’t sound too harsh/picky for an example that perhaps skipped renaming for clarity on the other parts, but I wanted to mention it.

    While I don’t use javascript and may be missing some of the norms and context of the lanugage, creating lamda functions (i don’t know the js term) and then hardcoding them into a function is barely an improvement. It’s fine because they work well with map and filter, but it didn’t address the vague naming. Renaming is refactoring too!

    isAdult is a simple function with a clear name, but formatUser and processUsers are surprisingly vague. formatUser gives only adult FormattedUsers, and that should probably be highlighted in the name of formatUser now that it is a resuable function. To me, it seems ripe for mistaken use given that it is the filter that at a glance handles removing non-adult users before the formatting, while formatUser doesn’t appear to exepct only adult users from it’s naming or even use! Ideally, formatUser should have checked the age on it’s own and set isAdult true/false accordingly, instead of assuming it will be used only on adult Users.

    Likewise, the main function is called processUsers but could easily have been something more descriptive like GetAdultFormattedUsers or something similar depending on naming standards in js and the context it is used in. It may make more sense in the actual context, but in the example a FormattedUser doesn’t have to be an adult, so a function processing users should clarify that it only actually creates adult formatted users since there is a case where a FormattedUser is not an adult.




  • If you use it frequently, I suggest getting a GUI that have profiles or remember options so you don’t have to mess with commands all the time. I wrote my own little command line wrspper which is Windows only since I don’t have Linux to test on. Though it shouldn’t take much effort to add support.

    Makes it much more convenient when you don’t have to specify things like archive (ignore duplicates), filename to be “artist - title” (where possible), download destination, etc. Just alt-tab, Ctrl-v, Enter. And the download is running. And mine also has parallel downloads and queue for when you got many slow downloads.



  • Not for the rapid update that broke everything.

    See post incident report:

    How Do We Prevent This From Happening Again?

    Software Resiliency and Testing

    • Improve Rapid Response Content testing by using testing types such as:

    • Local developer testing

    • Content update and rollback testing

    • Stress testing, fuzzing and fault injection

    • Stability testing

    • Content interface testing

    • Add additional validation checks to the Content Validator for Rapid Response Content.

    • A new check is in process to guard against this type of problematic content from being deployed in the future.

    • Enhance existing error handling in the Content Interpreter.

    Rapid Response Content Deployment

    • Implement a staggered deployment strategy for Rapid Response Content in which updates are gradually deployed to larger portions of the sensor base, starting with a canary deployment.

    • Improve monitoring for both sensor and system performance, collecting feedback during Rapid Response Content deployment to guide a phased rollout.

    • Provide customers with greater control over the delivery of Rapid Response Content updates by allowing granular selection of when and where these updates are deployed.

    • Provide content update details via release notes, which customers can subscribe to.

    Source: https://www.crowdstrike.com/falcon-content-update-remediation-and-guidance-hub/



  • The difference is, with a build pattern you are sure someone set the required field.

    For example, actix-web you create a HttpResponse, but you don’t actually have that stuct until you finish the object by setting the body() or by using finish() to have an empty body. Before that point you have a builder.

    There is noting enforcing you to set the input_directory now, before trying to use it. Depending on what you need, that is no problem. Likewise, you default the max_depth to a value before a user sets one, also fine in itself. But if the expectation is that the user should always provide their own values, then a .configre(max_depth, path) would make sense to finish of the builder.

    It might not matter much here, but if what you need to set was more expensive struts, then defaulting to something might not be a good idea. Or you don’t need to have Option<PathBuf> and check every time you use it, since you know a user provided it. But that is only if it is required.

    Lastly, builder make a lot of sense when there is a lot to provide, which would make creating a strict in a single function/line very complicated.

    Example in non-rust: https://stackoverflow.com/questions/328496/when-would-you-use-the-builder-pattern