33 Matching Annotations
  1. Apr 2025
  2. Mar 2025
    1. 3.9.4. Recursive Variants

      Actually, saying that good programers write parametric code may lead to complex code written by juniors. A rule of thumb I tend to teach juniors is that : - 1 copy paste is okay, - 2 is a sign of something wrong, - starting at 3 you must make your code generic.

      But starting of with the generic formulation may lead to harder to understand production code.

  3. Oct 2022
  4. Aug 2021
  5. Feb 2021
  6. Nov 2020
  7. Oct 2020
    1. export const validationSchema = {
        field: {
          account: [Validators.required.validator, iban.validator, ibanBlackList],
          name: [Validators.required.validator],
          integerAmount: [
      

      Able to update this schema on the fly, with:

        React.useEffect(() => {
          getDisabledCountryIBANCollection().then(countries => {
            const newValidationSchema = {
              ...validationSchema,
              field: {
                ...validationSchema.field,
                account: [
                  ...validationSchema.field.account,
                  {
                    validator: countryBlackList,
                    customArgs: {
                      countries,
                    },
                  },
                ],
              },
            };
      
            formValidation.updateValidationSchema(newValidationSchema);
          });
        }, []);
      
  8. Sep 2020
    1. Svelte will not offer a generic way to support style customizing via contextual class overrides (as we'd do it in plain HTML). Instead we'll invent something new that is entirely different. If a child component is provided and does not anticipate some contextual usage scenario (style wise) you'd need to copy it or hack around that via :global hacks.
    2. Explicit interfaces are preferable, even if it places greater demand on library authors to design both their components and their style interfaces with these things in mind.
  9. Aug 2020
  10. Nov 2019
  11. Oct 2019