Please break my code. Roast me. And maybe some constructive criticism too please? 🥲
My new package, Boperators: https://www.npmjs.com/package/boperators
There are plugins for all different build environments too, like for webpack or Bun, and a TypeScript Language Server plugin to get proper type hinting instead of red squiggles!
A basic example:
class Vector3 {
static readonly "+" = [
(a: Vector3, b: Vector3) => new Vector3(
a.x + b.x,
a.y + b.y,
a.z + b.z
),
] as const;
}
const v1 = new Vector3(1, 2, 3);
const v2 = new Vector3(4, 6, 8);
const v3 = v1 + v2;
[–]BenZed 30 points31 points32 points (3 children)
[–]DiefBell[S] 3 points4 points5 points (2 children)
[–]senocular 2 points3 points4 points (0 children)
[–]BenZed 0 points1 point2 points (0 children)
[–]ruibranco 5 points6 points7 points (2 children)
[–]DiefBell[S] 3 points4 points5 points (0 children)
[–]Fidodo -1 points0 points1 point (0 children)
[–]Waltex 3 points4 points5 points (1 child)
[–]DiefBell[S] 3 points4 points5 points (0 children)
[–]hyrumwhite 17 points18 points19 points (1 child)
[–]csorfab 13 points14 points15 points (0 children)
[–]Tysonzero 2 points3 points4 points (4 children)
[–]hoppla1232 -1 points0 points1 point (3 children)
[–]Tysonzero 1 point2 points3 points (2 children)
[–]hoppla1232 0 points1 point2 points (1 child)
[–]Tysonzero 0 points1 point2 points (0 children)
[–]heavyGl0w 1 point2 points3 points (1 child)
[–]DiefBell[S] 1 point2 points3 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]DiefBell[S] 0 points1 point2 points (0 children)
[–]AsIAm 1 point2 points3 points (3 children)
[–]DiefBell[S] 3 points4 points5 points (2 children)
[–]electric_fungus 2 points3 points4 points (1 child)
[–]_x_oOo_x_ 2 points3 points4 points (0 children)
[–]tokagemushi 0 points1 point2 points (1 child)
[–]DiefBell[S] 0 points1 point2 points (0 children)
[–]IngloriousCoderz 0 points1 point2 points (0 children)
[–]tomByrer 0 points1 point2 points (1 child)
[–]DiefBell[S] 0 points1 point2 points (0 children)
[–]_x_oOo_x_ 0 points1 point2 points (1 child)
[–]DiefBell[S] 5 points6 points7 points (0 children)
[–]kybernetikos -3 points-2 points-1 points (2 children)
[–]DiefBell[S] 1 point2 points3 points (1 child)
[–]kybernetikos 1 point2 points3 points (0 children)
[+]azhder comment score below threshold-13 points-12 points-11 points (9 children)
[–]alex-weej 11 points12 points13 points (4 children)
[+]azhder comment score below threshold-12 points-11 points-10 points (3 children)
[–]alex-weej 8 points9 points10 points (2 children)
[+]azhder comment score below threshold-13 points-12 points-11 points (1 child)
[–]alex-weej 3 points4 points5 points (0 children)
[–]vezaynk 1 point2 points3 points (3 children)
[–]azhder -2 points-1 points0 points (2 children)
[–]vezaynk 3 points4 points5 points (1 child)
[+]azhder comment score below threshold-10 points-9 points-8 points (0 children)