<story><title>The melting pot of JavaScript (2017)</title><url>https://increment.com/development/the-melting-pot-of-javascript/</url></story><parent_chain><item><author>orangeeater</author><text>&amp;gt; Js barely even supports reflection. This is a huge underrated shortcoming of js if you&amp;#x27;re doing anything complicated&lt;p&gt;Can you explain what Java offers with regard to reflection that JS doesn&amp;#x27;t?&lt;p&gt;My feeling is that reflection is almost moot in JS since you can inspect&amp;#x2F;mutate objects at runtime however you like.  But maybe I&amp;#x27;m missing the point of reflection.&lt;p&gt;There is a Reflect object with a bunch of static methods on it in ES6.  It mostly just replicates functonality that already exists in the language, and my suspicion is that it&amp;#x27;s mainly there so it can be extended at a later date without breaking backwards compatiblity.</text></item><item><author>spricket</author><text>I really like the kind of sanity that TypeScript brings to JS, super well designed and usually a pleasure  to work with. That said, I&amp;#x27;ve worked in many languages and I can&amp;#x27;t see any reason you would willing write your backend in JS or TypeScript.&lt;p&gt;Java, C#, Rails, and to some extent Python are much saner choices. The massive churn of the JS ecosystem bleeds through to the backend, hard.&lt;p&gt;JS could use a little more of the cruft and process that makes Java and C# especially so &amp;quot;uninteresting&amp;quot;.&lt;p&gt;Java especially is kind of a joy to work in if you ignore the cruft. Everything is generally well documented, the libraries are mostly very solid, code is almost always backwards compatible, there isn&amp;#x27;t a zillion ways to do everything, frameworks tend to live for a decade or so.&lt;p&gt;And it&amp;#x27;s faster than JS, and uses way less memory, and mostly solved dependency hell and bloat over a decade ago.&lt;p&gt;Java feels like it was designed, not grown. Everything follows similar convention so it&amp;#x27;s easy to pick up new libraries. The advantages are many. The drawbacks are few as long as you use things like Lombok and code generation liberally. By the way; code generation using agents, annotation processors, and bytecode manipulation is pretty much standard and a godsend for doing interesting things (and getting around the cruft) .&lt;p&gt;In java, I can write code on  the fly at runtime, or even during compile time using standard tools. Js barely even supports reflection. This is a huge underrated shortcoming of js if you&amp;#x27;re doing anything complicated</text></item></parent_chain><comment><author>orf</author><text>&amp;gt; Can you explain what Java offers with regard to reflection that JS doesn&amp;#x27;t?&lt;p&gt;Among hundreds of other things, getting the return type of a method and getting the input parameter names (+ types) in a way that doesn&amp;#x27;t revolve around literally parsing the functions toString() representation.&lt;p&gt;Oh, and typeof checking that isn&amp;#x27;t disgustingly broken.</text></comment>
<story><title>The melting pot of JavaScript (2017)</title><url>https://increment.com/development/the-melting-pot-of-javascript/</url></story><parent_chain><item><author>orangeeater</author><text>&amp;gt; Js barely even supports reflection. This is a huge underrated shortcoming of js if you&amp;#x27;re doing anything complicated&lt;p&gt;Can you explain what Java offers with regard to reflection that JS doesn&amp;#x27;t?&lt;p&gt;My feeling is that reflection is almost moot in JS since you can inspect&amp;#x2F;mutate objects at runtime however you like.  But maybe I&amp;#x27;m missing the point of reflection.&lt;p&gt;There is a Reflect object with a bunch of static methods on it in ES6.  It mostly just replicates functonality that already exists in the language, and my suspicion is that it&amp;#x27;s mainly there so it can be extended at a later date without breaking backwards compatiblity.</text></item><item><author>spricket</author><text>I really like the kind of sanity that TypeScript brings to JS, super well designed and usually a pleasure  to work with. That said, I&amp;#x27;ve worked in many languages and I can&amp;#x27;t see any reason you would willing write your backend in JS or TypeScript.&lt;p&gt;Java, C#, Rails, and to some extent Python are much saner choices. The massive churn of the JS ecosystem bleeds through to the backend, hard.&lt;p&gt;JS could use a little more of the cruft and process that makes Java and C# especially so &amp;quot;uninteresting&amp;quot;.&lt;p&gt;Java especially is kind of a joy to work in if you ignore the cruft. Everything is generally well documented, the libraries are mostly very solid, code is almost always backwards compatible, there isn&amp;#x27;t a zillion ways to do everything, frameworks tend to live for a decade or so.&lt;p&gt;And it&amp;#x27;s faster than JS, and uses way less memory, and mostly solved dependency hell and bloat over a decade ago.&lt;p&gt;Java feels like it was designed, not grown. Everything follows similar convention so it&amp;#x27;s easy to pick up new libraries. The advantages are many. The drawbacks are few as long as you use things like Lombok and code generation liberally. By the way; code generation using agents, annotation processors, and bytecode manipulation is pretty much standard and a godsend for doing interesting things (and getting around the cruft) .&lt;p&gt;In java, I can write code on  the fly at runtime, or even during compile time using standard tools. Js barely even supports reflection. This is a huge underrated shortcoming of js if you&amp;#x27;re doing anything complicated</text></item></parent_chain><comment><author>spricket</author><text>Java uses reflection and annotations to support all kinds of language extensions. Js has a lot of nasty issues with the &amp;quot;prototype chain&amp;quot; and annotation support is still experimental. For example, in java, scanning your classes and their annotations to generate code for them at compile time is a standardized feature.&lt;p&gt;Maybe I&amp;#x27;m just complaining that JS is too dynamic, but being able to generate code at compile time with reflection and know it will generally work (type checked) is nice.</text></comment>