5 ms·
I absolutely agree. Look, you don't need every single type that C implemented to have a type system. You can just have number, w_string, w_char, byte, object a
by UnoriginalGuy 12y ago
I absolutely agree.
Look, you don't need every single type that C implemented to have a type system. You can just have number, w_string, w_char, byte, object and maybe DateTime as core types. Then build on those. But typeless languages are just maintenance nightmares that just get worse as time moves on. They are also inherently incompatible with any system which does use types (which is most), like databases, XML, libraries, OS APIs, and so on.
I know I am going to get stomped into the ground for this, but JavaScript is bad and I wish we had something, anything, else instead. JavaScript was made in like a weekend and copied Java badly, that's fine, but we've carried this legacy long enough and the longer it takes us to implement the replacement the longer we'll have to keep using JavaScript until every browser/device catches up (10-20+ years from now).
There are many things that could replace JavaScript, but all I want is a strongly typed language, with real classes, strong focus on libraries, a MUCH better core DateTime library, and with maybe some functional programming concepts to make it more maintainable and more optimizable (at runtime).
PS - I am aware of ECMAScript 6, but it is only a bandaid on a bad language at the core.
PPS - Dart is already dead. And "X converts to JavaScript" is also a bandaid.
- eurleif 12y ago>But typeless languages are just maintenance nightmares that just get worse as time moves on. They are also inherently incompatible with any system which does use types (which is most), like databases, XML, libraries, OS APIs, and so on. I can't load the article, so I have limited context here, but note that being dynamically typed is orthogonal to being weakly typed/typeless.
- dragonwriter 12y ago> They are also inherently incompatible with any system which does use types (which is most), like databases, XML, libraries, OS APIs, and so on. This is obviously untrue in practice by any usual definition of "incompatible", as all of those things can be -- and are -- used successfully from languages everywhere on both the strong/weak and static/dynamic axes of typing.
- peteretep 12y agoTypeScript takes an afternoon to learn, and is strongly typed JavaScrupt. It's not perfect, but it's really very good. The JS produced is predictable, clean, and makes sense with virtually zero overhead.
- UnoriginalGuy 12y agoTypeScript as of today is supported by a total of zero browsers with zero planned to add support in the near future. It doesn't replaces JavaScript in any way, just builds a larger house on the sand.
- michaelwww 12y agoYou don't know anything about TypeScript, yet you choose to weigh in on it. Interesting. I think you must be confusing TypeScript with something else, like Dart maybe?
- UnoriginalGuy 12y agoPlease clarify what I said that was incorrect? I said that TypeScript doesn't have browser support (true) and that they have no plans to add browser support (true), and I added that TypeScript is like building a house on sand (i.e. it is all built on top of JavaScript, since there is no browser support for TypeScript). Please, go ahead, and correct my ignorance. Since I don't know anything...
- deleted 12y ago[deleted]
- michaelwww 12y agoThe stated goal of TypeScript was never to run in the browser. That's what confused me about your statement and made me wonder if you were confusing it with Dart. TypeScript wraps JavaScript with static type checking and some other useful contructs. It compiles to very clean and readable JavaScript. It's a tool, not a browser script.
- acjohnson55 12y agoI agree with your sentiment, but your facts are kind of wrong. Javascript has pretty much nothing to do with Java. It's not a copy of Java in any way. The semantics of it are vastly different and much more influenced by Smalltalk, Self, and Lisp. It's an extremely functional language, which is one of the things that has ultimately saved it. Without higher-order functions, you don't have jQuery, Underscore/Lodash, AMD, Backbone, and all the other innovations that made using JS not suck nearly as much. Don't get me wrong, it's a pretty flawed language. But "something better" is practically here now, in the form of ES6 and TypeScript, and to a lesser extent, Google's "use strong" proposal, which basically deprecates a whole bunch of old cruft. We're about a year away from being unshackled from the worst aspects of JS. You can pick TypeScript or Babel today and have many of the best benefits of future JS.
- UnoriginalGuy 12y ago> Javascript has pretty much nothing to do with Java. It's not a copy of Java in any way. I never said it was. I said: > JavaScript was made in like a weekend and copied Java badly The original author knocked out JavaScript's overall design in a weekend, then they tried to shoehorn in Java-like features badly. That's why we have artifacts like the Date() having month at 0 (like Java). They took a whole bunch of Java concepts and tried to clone them into JS after the naming. My post would have made more sense if you understood a little more about JavaScript's history (both before and after naming). There was definitely a sense of making it more Java-y after it was named that. > It's an extremely functional language No, it just isn't. JavaScript has state all over the darn place. I mean heck it has a global scope with no namespaces at all, that alone is a death nail on calling anything a "functional language." I have no way of writing a function in JavaScript which makes a guarantee that it has no internal state, so the optimiser cannot make assumptions about that function either (e.g. inlining it). In fact I can dynamically change a function's definition at runtime, so it never runs the same code twice.
- acjohnson55 12y agoIf it's just Date semantics, that's a fairly insignificant amount of copying. I'm not saying there isn't superficial similarity. But just look at the fact that Javascript until ES6 has lacked a useful `class` keyword, without which you can't even write a Java program. I suppose "functional" is in the eye of the beholder. I see it in terms of what a language allows you to do, not what it prohibits you from doing. You can absolutely choose not to use shared mutable state.
- tosh 12y agoIt sounds like you would really like Dart. Have you tried it? https://dartpad.dartlang.org/ https://dartpad.dartlang.org/