Versatile software engineer with a background in .NET consulting and CMS development. Working on regaining my embedded development skills to get more involved with IoT opportunities.
I feel you hard on this. I come from a C# background in which everything is type-checked to an extent that you become far more comfortable with generics than you thought possible. At my current position, we exclusively use TypeScript. Some of our codebase is still ES6 and some JS libraries really just feel super awkward in TS.
I've learned to embrace it a little bit, I still try to minimize my use of declaring stuff any, but sometimes that or creating incredibly specific interfaces are the only way I know to make my code compile.
However, I've also been embracing discriminated unions as a solution to a lot of my issues. It isn't applicable to every situation, but I feel like it's a big level-up for my expressibility
How’s it going, I'm a Adam, a Full-Stack Engineer, actively searching for work. I'm all about JavaScript. And Frontend but don't let that fool you - I've also got some serious Backend skills.
Location
City of Bath, UK 🇬🇧
Education
10 plus years* active enterprise development experience and a Fine art degree 🎨
Ah C# I plan to try this out one day, but as a close relative of TS In terms of parentage, I can see the appeal.
Most of the time TS works fine but there's always a... "Hang on I don't need to protect this bit, it's already safe" or you may need an any.
In the early days I used Typescript for everything but now I use of for stuff that will be maintained, preferring prototype work in JavaScript.
Anyway for this task I have turned on type checking in js and not wrote a single TS file, only including a tsconfig file, not standard stuff, the JavaScript is executed in a sandbox ran from the Java side and we are injecting variables into that context, the entire Java stdlib is just too much to write out by hand but I do want some of the good bits...
It's too complex I fear, I may try flowtype instead, see how that works
Versatile software engineer with a background in .NET consulting and CMS development. Working on regaining my embedded development skills to get more involved with IoT opportunities.
I feel like your best bet to "do it the rightish way" would be creating some sort of code generator which could either parse the Java stdlib, pull method signatures from library files, or maybe even read code-completion data from another IDE like Eclipse. But I can see that getting out of hand and becoming a thesis project really quickly, haha.
I have used Flow before, and there is definitely a lot less support in terms for editor/IDE extensions, and I had the impression that the project had lost a lot of steam.
Thanks for posting this adventure though, I always love reading the insightful questions you post!
How’s it going, I'm a Adam, a Full-Stack Engineer, actively searching for work. I'm all about JavaScript. And Frontend but don't let that fool you - I've also got some serious Backend skills.
Location
City of Bath, UK 🇬🇧
Education
10 plus years* active enterprise development experience and a Fine art degree 🎨
Oh man the result of this was a 5 hour build job, even declaring all the globals as any from the Java stdlib was really slow for the language server and vscode to handle. Unserpising.. I think I will give up on this for now
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I feel you hard on this. I come from a C# background in which everything is type-checked to an extent that you become far more comfortable with generics than you thought possible. At my current position, we exclusively use TypeScript. Some of our codebase is still ES6 and some JS libraries really just feel super awkward in TS.
I've learned to embrace it a little bit, I still try to minimize my use of declaring stuff any, but sometimes that or creating incredibly specific interfaces are the only way I know to make my code compile.
However, I've also been embracing discriminated unions as a solution to a lot of my issues. It isn't applicable to every situation, but I feel like it's a big level-up for my expressibility
Ah C# I plan to try this out one day, but as a close relative of TS In terms of parentage, I can see the appeal.
Most of the time TS works fine but there's always a... "Hang on I don't need to protect this bit, it's already safe" or you may need an any.
In the early days I used Typescript for everything but now I use of for stuff that will be maintained, preferring prototype work in JavaScript.
Anyway for this task I have turned on type checking in js and not wrote a single TS file, only including a tsconfig file, not standard stuff, the JavaScript is executed in a sandbox ran from the Java side and we are injecting variables into that context, the entire Java stdlib is just too much to write out by hand but I do want some of the good bits...
It's too complex I fear, I may try flowtype instead, see how that works
I feel like your best bet to "do it the rightish way" would be creating some sort of code generator which could either parse the Java stdlib, pull method signatures from library files, or maybe even read code-completion data from another IDE like Eclipse. But I can see that getting out of hand and becoming a thesis project really quickly, haha.
I have used Flow before, and there is definitely a lot less support in terms for editor/IDE extensions, and I had the impression that the project had lost a lot of steam.
Thanks for posting this adventure though, I always love reading the insightful questions you post!
Oh man the result of this was a 5 hour build job, even declaring all the globals as any from the Java stdlib was really slow for the language server and vscode to handle. Unserpising.. I think I will give up on this for now