4 ms·
Oh how I miss those code inspections and refactorings available for Java. Unfortunately I am forced to used Javascript at the moment and this language just plai
by jansan 9y ago
Oh how I miss those code inspections and refactorings available for Java. Unfortunately I am forced to used Javascript at the moment and this language just plain sucks compared to Java, although Webstorm is trying really hard to support me. I really hope something like Java, or even better Kotlin, will replace Javascript in future for programming browser applications.
- salimmadjd 9y agoHave you looked into Elm or other strongly typed/functional languages?
- jansan 9y agoNo, because I did not exprect my project to become as big as it is now. Also, I am using a lot of third party libraries, and I am not sure if they would work seamlessly with another language that compiles to Javascript.
- Aeolus98 9y agoScala.js scratches that itch for me. I rarely write frontend code, but when I do the extra IDE support given to me by IDEA for Scala.js is pretty great. I'm a full time Scala dev though, so I'm totally biased
- virtualwhys 9y agoIt is kind of surreal to look at a source file and not immediately know if it's Scala or Scala.js (like, oh wait, this is the front end). Just finished porting a legacy 5K Coffeescript front end over to Scala.js. Having a typed front end with all the power of Scala completely transforms the browser development experience. Great stuff. Only major drawback is generated js binaries incur a 160KB "tax", primarily due to size of Scala collections. Though, FWIW, the front end weighs in at 232KB non-gzip'd, and was able to scrap jQuery + DataTables + Modal window and Validation plugin dependencies -- shaved off about 200KB compared to previous front end.
- deleted 9y ago[deleted]
- kakarot 9y agoThere are projects of differing scope like TypeScript, ClojureScript, WebAssembly (not standardized but getting there) etc that are all helping to ease our pain. Javascript isn't going away but writing in pure JavaScript is. Combine those with Babel or other ES6 transpilers, a linting and build system, and you've got yourself a pretty decent environment. Personally I find working with JS far more fun (this phrase is used loosely) than working with Java.
- nalllar 9y ago> I really hope something like Java, or even better Kotlin, will replace Javascript ... Have you tried Kotlin's javascript backend? https://kotlinlang.org/docs/reference/js-overview.html https://kotlinlang.org/docs/reference/js-overview.html
- jansan 9y agoThose things are nice, but how would I work with third party libraries like Paper.js? I feel that the difficulties would outnumber the benefits in my case.
- nalllar 9y agoIf it's in typescript or has type definitions available you can convert those type definitions with ts2kt. Failing that, you can use the dynamic type. ts2kt - https://github.com/kotlin/ts2kt https://github.com/kotlin/ts2kt type definitions for many libraries - http://definitelytyped.org/ http://definitelytyped.org/ dynamic type - https://kotlinlang.org/docs/reference/dynamic-type.html https://kotlinlang.org/docs/reference/dynamic-type.html
- virtualwhys 9y ago> Have you tried Kotlin's javascript backend? Generates large js binaries, poor js interop; it's well behind the curve compared to Scala.js and Clojurescript on the JVM. Think they're putting all their developer eggs into the Native basket, which makes sense, iOS + Android would be huge for the language's adoption.
- swsieber 9y agoThe teams are different - the native team has a distinctly different team than the one working on JS. I'm not sure what the overlap between the JVM and JS team is though. I'd say quite simply that the JS target is just still quite young.
- scalatohaskell 9y agoScalajs easily
- bebop 9y agoI have been learning Clojurescript with re-frame (basically react + opinions about how to write apps). This has been the most fun and logical way to write SPA's I have ever experienced. Bonus points because it will hot-reload code (figwheel) without destroying your current state. Speaking of state, you can see the entire state of your application with re-frisk, which also shows all the events going into the system. Really wonderful stuff.
- mmargerum 9y agoI’m learning it as well. Was pretty blown away when I created a reagent SPA app skeleton with one lein command. Been doing imperative / oo for years so this is quite different but I’m persevering because I’ve bought into the reactive UI for web apps and JS just seemed like a total mismatch
- drinchev 9y agoYou can get far better IDE experience if you use TypeScript, instead of plain JS. Webstorm does a lot of things that are quite popular in IDEA, because it can rely on the type system. This includes refactoring and realtime compiler errors.
- yourkin 9y agoI used to love Webstorm. It works great for a simple layout and the code inspections and suggestions really speed things up. But a modern setup with ES6, Vue and Webpack almost completely render the IDE unusable for me -- everything slows down to an unbearable speed and most of the inspections either don't work at all or trip over themselves. With that, I've switched to Sublime Text almost exclusively. Any pointers on how to adjust Webstorm, apart from using TypeScript?
- drinchev 9y agoWebpack watch mode is how I use it. On top of that you can run webpack outside of the IDE, just like you do with sublime text. My setup is i7 with 16 GB, and only electron app ( webpack + react ) will make my setup really slow. Anything else usually is swallowed by webstorm
- slackingoff2018 9y agoTypescript with TsLint VNext extension and VSCode is amazing. They just added code refactoring support a few weeks ago too. Make sure you set your linter and typescript compile settings to be really strict. It will remind you a lot of Java/C#