DEV Community

Discussion on: Meme Monday

Collapse
 
ezpieco profile image
Ezpie

"an idiot admires complexity a genius admires simplicity"
- Terry Davis

Image description

Collapse
 
ezpieco profile image
Ezpie

Yes I can totally agree that many web apps where made without TypeScript because of this!

But it's still kind of amazing to see that TypeScript can literally make something so simple as that add function into something so complicated.

Collapse
 
parimaldesign profile image
Parimal

tbh that same code can be rewritten with JS as well type checking both variables and then IF Else of all 3 possible combinations..

Collapse
 
eerk profile image
eerk

The typescript part is verbose on purpose, to make it look silly. In reality you would write it like this:

function addNumbers(a:number, b:number) {
     return a + b
}
Enter fullscreen mode Exit fullscreen mode
Collapse
 
ezpieco profile image
Ezpie

It's for the memes. But still

Collapse
 
syeo66 profile image
Red Ochsenbein (he/him)

I'm pretty sure you might be surprised by this Javascript function...

Collapse
 
getsetgopi profile image
GP

The only reason why we don't use Typescript! Millions of application were build without it, Millions are in products without it, Millions are in development without it and they all just work fine.