|
Yeah - I've found TypeScript and never want to go back.
Our own @Pete-OHanlon has written a book on the topic. It's a lifesaver.
cheers
Chris Maunder
|
|
|
|
|
Thanks, Chris. The beer's on me
I have to admit, I am very fond of TypeScript. The more I use it, the fonder I am. So much so, I'm currently writing my second TypeScript book.
|
|
|
|
|
cool!
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Pete O'Hanlon wrote: So much so, I'm currently writing my second TypeScript book.
Very cool!
|
|
|
|
|
|
'Tis the one. And I thank you.
|
|
|
|
|
The title says 'Advanced'. Is there a basic book that you recommend for TypeScript dummies like me?
|
|
|
|
|
Sorry I haven't had a chance to reply. This[^] book is a decent place to start.
|
|
|
|
|
|
I tried it once and quickly went back to JavaScript.
For years I thought TypeScript would fix all my JavaScript woes, but by the time I started using it I was so used to JavaScript that all the extra typing (like literal keyboard typing ) wasn't worth it
|
|
|
|
|
I have to agree. I have trouble wrapping my head around transpiling a language that I know and am comfortable with into, well, something else. For...reasons.
I'll be honest, though, using webpack for a little bit has sort of made me re-evaluate that thought process.
"Never attribute to malice that which can be explained by stupidity."
- Hanlon's Razor
|
|
|
|
|
Exactly.
Although that's different for SCSS/SASS and CSS though
Now THAT is a must have!
|
|
|
|
|
I'll let the designers have their fun with that. For my money, I'll just snag BS or vuetify :/
"Never attribute to malice that which can be explained by stupidity."
- Hanlon's Razor
|
|
|
|
|
Nathan Minier wrote: vuetify Didn't know that one, but I do know Vue.
I'll have to look into that sometime (for the little front-end work I have to do)
|
|
|
|
|
It's a material design framework for Vue that brings teh sexy. If you setup the loaders right, it's not even terribly big after packing (in production mode, anyway).
"Never attribute to malice that which can be explained by stupidity."
- Hanlon's Razor
|
|
|
|
|
Nathan Minier wrote: I have trouble wrapping my head around transpiling a language that I know and am comfortable with into, well, something else.
I've taken on a strange view when it comes to javascript. It's basically a virtual machine with a very complex instruction set.
Looking at it that way, the familiar becomes new again. And then targeting javascript with other languages (see also, TypeScript, asm.js - the precursor to webassembly) makes more sense conceptually.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
JavaScript is a scripting language. It interacts with an interpreter, such as a browser or node.js. If you want to stretch things, it's similar to a runtime, not wholly dissimilar to .NET or JRE.
Ergo: JavaScript is to browser as C# is to .NET
Now, when I said that I can't "wrap my head around" using TypeScript, I'm basically saying that I don't know why I would want to use VB.NET instead of C#, when I'm already an expert at C#. Or worse, why I would write something in VB, transpile it into C#, and then evaluate it against the runtime.
"Never attribute to malice that which can be explained by stupidity."
- Hanlon's Razor
|
|
|
|
|
that is the traditional way to look at javascript, but i find it's not nearly enough to conceptualize it that way anymore, but then like i alluded to, asm.js influenced by thinking on that.
Nathan Minier wrote:
Now, when I said that I can't "wrap my head around" using TypeScript, I'm basically saying that I don't know why I would want to use VB.NET instead of C#, when I'm already an expert at C#
Well I can think of one reason in this case - type checking, but that doesn't hold to your analogy since both C# and VB.NET do it.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
honey the codewitch wrote: Well I can think of one reason in this case - type checking,
Type safety is a compilation-level feature, as any bad cast will tell you very quickly. It has exactly zero impact on well-behaved code, it's just a development tool.
Coding against JS means handling type cases at runtime, which is the proper way to approach a duck type language.
I would argue that by trying to make the language look like something that it is not, TypeScript encourages bad code practices.
"Never attribute to malice that which can be explained by stupidity."
- Hanlon's Razor
|
|
|
|
|
That's an interesting argument. I don't necessarily agree but I do see where you're coming from.
But given my views on the JS/RTE as a "VM in disguise" we'll just have to disagree there.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
if you had a choice, would you rather port Typescript to C#, or javascript to C#?
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Why would I port them?
My front-end code would do absolutely nothing in back-end C#
|
|
|
|
|
i mean just in general.
as i said i ported a Splay tree function from typescript to C# and it went beautifully.
i was impressed by TS for that.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
In a complete hypothetical case that will almost never happen I would prefer to port TypeScript to C# rather than JavaScript.
But I'm not going to write all my front-end code in TypeScript in case I'll ever have to.
The only reason I'd use TypeScript is because some people really can't handle the dynamic nature of JavaScript.
So it's more a tool to "fix" the incompetence of others (I have a very specific someone in mind because I once had to use some JavaScript he wrote )
Who the hell has three different return types for a single function!?
|
|
|
|
|
Sander Rossel wrote: Who the hell has three different return types for a single function!?
Do you really have to ask me that? Who do you think would do something so diabolical?
Sander Rossel wrote: But I'm not going to write all my front-end code
A splay tree isn't front end specific and frankly I have no idea why someone wrote it in typescript.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|