4 ms·
At work, all of my function has at most 3 parameters: deps (dependencies), params (for parameters), ctx (for context), which covers all of my use cases, easy to
by revskill 4y ago
At work, all of my function has at most 3 parameters: deps (dependencies), params (for parameters), ctx (for context), which covers all of my use cases, easy to test, debug, isolate.
- niux 4y agoCan you give an example of a function?
- 0xb0565e487 4y agofunction something(deps, params, ctx) { // put something here }
- deleted 4y ago[deleted]
- jiggawatts 4y agoThis is the equivalent of a relational database schema where there's only a couple of tables with columns such as: (EntityId,RowId,ColumnId,Value). In very rare cases this type of design is required, but the key word here is "rare". It shouldn't be the norm for ordinary apps such as typical web apps! If you find yourself doing this type of thing regularly, then you've likely made some sort of mistake.
- revskill 4y agoYou're making assumption ? The code is absolutely maintainable, simple by design, simple to test in isolation , simple to debug in isolation, simple to scale features, simple to replace,... I'm not sure what you want more for a production-ready code.