165 karma · joined Jul 13, 2015 (11y ago) · 41 submissions
comment 11mo ago · link · parent
Best thing for me was not removing the code transformation (convert ts to js), but separate runtime code with documentation code, like the types. Gives you much more clear insight that the types you write to describe what you expect the type will be is not forced on runtime, but is just for you as developer to know it. And when you validate the input is the right type, it is much more clear that it is the runtime type validation.
You can still use JSDoc in your typescript files, but why do you want to do that? There is no reason to do that.
So using JSDoc or Type Annotation, both works the same, same benefits, it is only personal preferences. Both have its pros and cons. For me the JSDoc has more benefits. Some other people prefer annotations. But there is not 1 that is better in controlling the types, has more options. (Also the enum can be done if you are using JSDoc, but is a little different)
comment 1y ago · link · parent
comment 1y ago · link · parent
For me, it isn't a framework I want to use in any production environment. Your system is too much depending on something you have no influence on. Like in your own code, it is good to decouple, don't make things depend too much on something, not in your own code, but also on external code like frameworks and libraries.
That is why I prefer to build things like I can (kind of) easy drop my dependencies, for what reason, and use something else, or build it in my own codebase. If some framework doesn't allow it, and you have to work it their way, and is the base of everything, that should be a big red flag.
comment 1y ago · link · parent
So OpenAPI/GraphQL, tests and types and proof that the system works like intended. Always start with that before writing code. The specification is a solid base that doesn't change a lot if you start with it. How the code works, you can refactor it, and proof with the specification if it sill does the same like before.
Code is less important than the specifications.
comment 1y ago · link · parent
I think there are just a few that know XSL(T) these days, or need some refresh (like me).
comment 2y ago · link · parent
comment 2y ago · link · parent
It is like the TDD approach, design before build.
Writing or generating tests after you build the code, is the same as this. It is guessing what it should do. The OpenAPI specification, and the tests should tell you what it should do, not the code.
If you have the specification, everyone (and also AI) can write the code for you to make it work. But the specification is about what you think it should do. That are the questions and requirements that you have about the system.
comment 2y ago · link · parent
I also try to move centralized computing to decentralized computing more and more. And that can also be done to let the client do more computing. And also storage, is it needed to store in central, or can the user store it.
Many times people thinking that we should have a central system, with all the truth. But let it be a part of the users.
It makes also the central part simple, and because the central part is simple, it is easier to scale.
comment 2y ago · link · parent
comment 2y ago · link · parent
comment 2y ago · link · parent
comment 2y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
For me typescript syntax and jest is a no go.
Typescript is useful to check types, but i write just JavaScript with JSDoc, and check it with eslint in typescript modus.
comment 3y ago · link · parent
For type checking on development, you can do it with ESLint and JSDoc in Typescript modus. You have the same type checking like you have in ts files. You can even import types from typescript files, like .d.ts
Best of both worlds, no transformation of the code, and on development you have some help from Typescript.
comment 3y ago · link · parent
To use Typescript or not doesnt matter, it is about runtime validation. The one like the native JS way with JSDoc, the other likes Typescript and doesnt matter the build step for the API.
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
Javascript is easy to write and understand, easy to play with, without transpiling, e.g. in your browser. When you write code in the native language, you know what you write, how it will run on the system. When you write in Typescript, it generates some Javascript that is sometimes hard to recognize as your code.
comment 4y ago · link · parent
I think typescript is a temp hype just like jQuery, useful for many, but a few people can just do the vanilla JavaScript way.
comment 4y ago · link · parent
On your car, i also like old cars, because you can bring it to every mechanic, or do it yourself. I like the basic car, and hope EV's will come that are also simple and build like Lego, so you can easy switch some (electronic) parts.
Who need large displays, self driven cars, and other gadgets. A vehicle is just a useful thing to bring you from A to B on a save way, we dont need distraction from all the expensive gadgets, just safety and comfort.
Just keep cars simple please.