5 ms·
> Make a language that is only the TypeScript extensions to JS, and drop all the JS parts. So? Is there a reason left then to use Typescript instead of C or C+
by siempreb 7y ago
> Make a language that is only the TypeScript extensions to JS, and drop all the JS parts.
So? Is there a reason left then to use Typescript instead of C or C++? I cannot think of one. Especially for education you better use a real language that will stay for more than 10 years at least. Microsoft is doing a great job taking over the Javascript community, and now this.., would love to see their hidden agenda.
IMAO Typescript is only interesting as a (painful) intermediate solution for large Javascript code bases until there is a serious replacement for Javascript through WebAssembly. I'd never choose Typescript as a language, even stronger, I recently moved away from full-stack web development partly because of it. Back to C++, what a relief..
- tlarkworthy 7y agoTypescript has a unique typesystem that embraces duck typing. This is quite different to how you would type e.g. a scala program. C++ adds a load of additional burden on the programmer (memory) and has a relatively weak typesystem. Clearly Typescript has a niche, has familiarity to subset of programmers, so there are plenty of reasons for this to have its place.
- kjeetgill 7y agoI'm less familiar with Typescript but this sounds quite close to how go does interfaces! Maybe you could speak to that. I've been pretty impressed with static duck-typing and miss it when I'm in Java.
- austincheney 7y agoI am not sure where you are going with that. C++ is largely popular and enduring for the same reasons as Java: institutionalization (taught in school).
- otabdeveloper4 7y agoThat's simply not true. I'm not aware of any place where C++ is taught. (And in fact C++ programmers are very hard to find.) C is very common and anybody with even a bit of format education has been exposed to C. Then you get people who know a bit of C and throw in a couple 'class' and a couple 'cout', and call it 'C++' for some reason. Which is wrong, obviously.
- Crinus 7y agoThis isn't wrong and that is one of the largest issues people have with C++: if something is syntactically correct in a language, chances are you'll find it in any relatively big codebase - and with C++ there are a LOT of things that are syntactically correct. It may feels nice preaching that C++ is only whatever subset you may like (and there are a LOT of C++ programmers, or "programmers who write code that happen to be accepted by C++ compilers" if you prefer, that do that - personally i like pre-C++98 subset that was implemented in Borland C++ Builder 1) but in practice when you have to deal with a real world big C++ codebase (especially something you didn't write yourself and didn't start last month) you'll see all the faces of C++ at the same time, either you like it or not.
- pjmlp 7y agoPlenty of options to learn C++ at several European universities.
- m00dy 7y agoC++ is the biggest cancer in the industry. I can't really understand how people can easily say its name. A C++ programmer needs to understand not only language syntax but also underlying operating system and its internals. This is completely different job and therefore needs completely different expertise. I don't even want to mention hardware limitations, cpu architectures, etc. So, don't use C++. It is not mainstream anymore and hopefully it will be a thing of past.
- pjmlp 7y agoNot mainstream?!? I guess we have been using different platforms, so is the bubble of web development. Just for your education, Python ML research, is just glue for GPGPU libraries written in C++, NVidia nowadays specifically targets their GPGPU designs to match C++ semantics, Apple, Google and Microsoft use C++ for their drivers, Metal shaders use C++, AAA game industry breathes C++, Fintech uses a mix of Java/.NET and C++, LLVM and GCC, the beloved FOSS compiler stacks are written in C++, AUTOSAR requires C++14, Arduino Sketch is actually C++,… C++ might have a couple of flaws, not being mainstream is certainly not one of them.
- otabdeveloper4 7y ago> A ... programmer needs to understand ... underlying operating system and its internals Oh the humanity! I weep for mankind and for the industry if this is where we have fallen. Quick question: are you a Javascript programmer?
- Allower 7y agoWell I mean that is the point of abstraction.. if we always had to have our heads at the lowest level we would not be productive what-so-ever.
- zbentley 7y ago"understanding the basics of the operating system internals and how your code interacts with them" is far, far from the lowest level. It is also an essential understanding for writing quality, performant code in any context--web development included, even frontend.
- agentultra 7y agoDefinitely painful. After trying to get a team to adopt and gradually type a large codebase for the last 2.5 years I can say that gradual typing is a dream. In practice you write more code than you end up typing as you go and the project is never 100% complete. If something gets typed as `any` all bets are off and there are no benefits. So people don't end up running the type checker during development anyway. Which defeats the purpose. There are small places where it is useful -- some developers on the team had never used a type system before and found that it helped them eliminate errors from their code before they even ran the program. But overall... agree, Typescript/Flow -- they were great experiments and useful -- but I'd rather see ways for us to adopt better languages. Elm, Purescript, Haskell, F# -- Javascript is great for projects of a certain size... but once you get to a large team and many tens-of-thousands of lines of it... discipline will only get you so far.
- spraak 7y ago> If something gets typed as `any` all bets are off and there are no benefits. Then why allow `any`? Using TS without the compiler and linter configs tuned to your benefit is like trying to use a plane only as a car. No discipline required if you let yourself fly with settings that set you up for long term success later. Also, Flow is not on the same level as TS. It's a dead project and was never fully baked.
- agentultra 7y agoBecause sitting around and typing tens of thousands, maybe hundreds of thousands of lines of code is not super productive? That was the whole sell of "gradual typing," was it not? That you could turn it on, type everything as `any` then add better types as you go with the goal of eventually having a fully typed code base. Except in our experience you'll always be playing catch up and never get to the promised land.
- spraak 7y agoDon't do gradual typing, is what I'm saying. Start a project with the compiler and linter tuned strict and you'll do well. But if you have to go gradually and you have a goal of typing an untyped codebase, then just introduce a rule at a time from a list of rules you'd like in the end. Each rule should be a single commit or single PR (or Epic, or whatever granularity required) > Because sitting around and typing tens of thousands, maybe hundreds of thousands of lines of code is not super productive? Your project either doesn't benefit from static types or you're not seeing the benefits. I agree it's annoying to convert a JS project to TS, but TS in the end has been a huge boon to our overall velocity (long term) considering bugs, refactoring, and service to service edges.
- gameswithgo 7y agoI'm mostly on board with the idea of moving away from the mess of the Javascript ecosystem. But going back to C++ doesn't really get you away from the big mess problems!
- darzu 7y ago> So? Is there a reason left then to use Typescript instead of C or C++? I cannot think of one. How about memory safety and type inference?