There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

nickwitha_k , in Imagine

No. Just no.

attero , in Every Single Freaking Time

⌘ cmd >> ctrl toshy.app

Rin , in Needs consent

go home, then touch women

hikarulsi ,
@hikarulsi@lemmy.world avatar

cd ~; touch woman

Can’t touch woman anywhere

RagingRobot , in My poor RAM...

What are you saving your ram for? You bought it to use it!!!

xusontha OP ,

But I like to snack on it…

raubarno , in Imagine

<span style="color:#323232;">~ $ adware
</span><span style="color:#323232;">(...ncurses ad featuring blockchain shows for 10 seconds...)
</span><span style="color:#323232;">
</span><span style="color:#323232;">Sorry, internet connection is required to run adware.
</span><span style="color:#323232;">Aborted
</span><span style="color:#323232;">~ $ 
</span><span style="color:#323232;">
</span><span style="color:#323232;">(plugs in ethernet cable)
</span><span style="color:#323232;">
</span><span style="color:#323232;">~ $ adware
</span><span style="color:#323232;">(...ncurses ad featuring Threads displays for 10 seconds...)
</span><span style="color:#323232;">(...ncurses ad featuring next-gen Android displays for 10 seconds...)
</span><span style="color:#323232;">Press CTRL+C to skip the ad
</span><span style="color:#323232;">[^C[^C
</span><span style="color:#323232;">Got tired from ads? Buy Adware Pro for $5.99/mo [Y/n] n
</span><span style="color:#323232;">
</span><span style="color:#323232;">ADWARE SHELL
</span><span style="color:#323232;">(C) 2023 Buy-n-Large Corp. All wrongs reserved
</span><span style="color:#323232;">---ad---
</span><span style="color:#323232;">How much do YOU think this advanced operating environment is worth?
</span><span style="color:#323232;">Just press F1 to get the answer!
</span><span style="color:#323232;">---ad---
</span><span style="color:#323232;">
</span><span style="color:#323232;">Activate Adware
</span><span style="color:#323232;">Go to Settings to Activate Adware
</span><span style="color:#323232;">% exit
</span><span style="color:#323232;">Please watch all the ads to be able to exit.
</span><span style="color:#323232;">(...ncurses ad featuring alt medicine displays for 30 seconds...)
</span><span style="color:#323232;">(...ncurses ad featuring ad-blocker for 30 seconds...)
</span><span style="color:#323232;">[^C
</span><span style="color:#323232;">Interrupt rejected. Please watch all the ads.
</span><span style="color:#323232;">[^C[^C[^D[^X[^Z[^Z[^Z (unplugs ethernet cable)
</span><span style="color:#323232;">Interrupt rejected. Please watch all the ads. Buy Adware Pro for $5.99 to allow interrupts.
</span>

The last step I leave to you.

TechieDamien ,

Please drink verification can to continue

Sonotsugipaa ,
@Sonotsugipaa@lemmy.dbzer0.com avatar

Your local account has not been verified yet:
please enter your user ID, your SSN, your credit card number, your home address, your credit card’s PIN, the SHA512 hash of your bank account’s password (salted with 0x71a0 at the beginning) and the number of bytes received by your work computer’s primary network interface with a maximum error of 256kb to allow interrupts.

Mechaguana ,
@Mechaguana@programming.dev avatar

Shred *

Johannes ,

We ought to make a satire shell based on this

Acters , in My poor RAM...

People kept arguing with me that not using is a choice and wonder why it is not freedom of choice.

igorlogius , (edited ) in Imagine
@igorlogius@lemmy.world avatar

i could see that as a powershell “feature”, which allows microsoft to sell adspace in the command line that reaches technicans and administrators

!aboringdystopia

edit: fixed link

GhostsAreShitty ,

I was going to say, I’m surprised this isn’t a Windows 11 “feature”

igorlogius , (edited )
@igorlogius@lemmy.world avatar

cut them some slack, they can’t put every annoyance into one version … got to leave something for future “upgrades”

President_Pyrus ,
@President_Pyrus@feddit.dk avatar

If you write !aboringdystopia instead the link is usable for any instance.

igorlogius , (edited )
@igorlogius@lemmy.world avatar

i always forget. i am just to used to markdown. Thanks for the reminder.

SturgiesYrFase ,
@SturgiesYrFase@lemmy.ml avatar

Ahhhh…THANK YOU! r/boringdistopia was one of the few subreddits I have been still missing.

igorlogius ,
@igorlogius@lemmy.world avatar

no problem … enjoy … kind of … maybe.

Brustadnrift ,

Maybe for the first time Ubuntu could get to sue them for infringing on their innovation.

canihasaccount ,

Good lord, I hope no one employed at Microsoft reads this. I would bet they institute it if they think of it.

GlitchSir , in Who is this "Jenkins" and what now has broken him?

The build system issue is getting out of control. Just look at cmake

When your build system is a build system for build systems you know something went wrong years ago

Draces , (edited ) in Golang be like

I wonder what portion of all go code written is

if err != nil {

return err

}

It’s gotta be at least 20%

christophski ,

Can anybody explain the rationale behind this?

fkn ,

Exceptions don’t exists and ask errors must be handled at every level. It’s infuriating.

msage ,

Hahaha, fuck no, I’ve dealt with exception-less code enough in my life, kthxbye

GlitchSir ,

I think you missed a memo. Exceptions are bad and errors as values are in… I’ll have Harold forward it to you

planish ,

I actually kind of like the error handling. Code should explain why something was a problem, not just where it was a problem. You get a huge string of “couldn’t foobar the baz: target baz was not greebleable: no greeble provider named fizzbuzz”, and while the strings are long as hell they are much better explanations for a problem than a stack trace is.

silent_water ,
@silent_water@hexbear.net avatar

a desperate fear of modular code that provides sound and safe abstractions over common patterns. that the language failed to learn from Java and was eventually forced to add generics anyway - a lesson from 2004 - says everything worth saying about the language.

ennemi ,

The language was designed to be as simple as possible, as to not confuse the developers at Google. I know this sounds like something I made up in bad faith, but it’s really not.

The key point here is our programmers are Googlers, they’re not researchers. They’re typically, fairly young, fresh out of school, probably learned Java, maybe learned C or C++, probably learned Python. They’re not capable of understanding a brilliant language but we want to use them to build good software. So, the language that we give them has to be easy for them to understand and easy to adopt. – Rob Pike

"It must be familiar, roughly C-like. Programmers working at Google are early in their careers and are most familiar with procedural languages, particularly from the C family. The need to get programmers productive quickly in a new language means that the language cannot be too radical. – Rob Pike

The infamous if err != nil blocks are a consequence of building the language around tuples (as opposed to, say, sum types like in Rust) and treating errors as values like in C. Rob Pike attempts to explain why it’s not a big deal here.

devfuuu ,

People are scared of monads and think this is better.

serenity ,

My brain is too smooth to imagine a solution to this using monads. Mind sharing what you got with the class?

nick ,

Having a Result[T, Err] monad that could represent either the data from a successful operation or an error. This can be generalised to the Either[A, B] monad too.

psilocybin , (edited )

Someone else and not an expert. But Maybe types are implemented with Monads, Maybe is a common monad.

Its how rust does error handling for example, you have to test a return value for “something or nothing” but you can pass the monadic value and handle the error later, in go you have to handle the error explicitly (almost) all the time.

Nevoic , (edited )
@Nevoic@lemmy.world avatar

Here’s an example (first in Haskell then in Go), lets say you have some types/functions:

  • type Possible a = Either String a
  • data User = User { name :: String, age :: Int }
  • validateName :: String -> Possible String
  • validateAge :: Int -> Possible Int

then you can make


<span style="color:#323232;">mkValidUser :: String -> Int -> Possible User
</span><span style="color:#323232;">mkValidUser name age = do
</span><span style="color:#323232;">  validatedName ← validateName name
</span><span style="color:#323232;">  validatedAge  ← validateAge age
</span><span style="color:#323232;">  pure $ User validatedName validatedAge
</span>

for some reason <- in lemmy shows up as &lt;- inside code blocks, so I used the left arrow unicode in the above instead

in Go you’d have these

  • (no Possible type alias, Go can’t do generic type aliases yet, there’s an open issue for it)
  • type User struct { Name string; Age int }
  • func validateName(name string) (string, error)
  • func validateAge(age int) (int, error)

and with them you’d make:


<span style="color:#323232;">func mkValidUser(name string, age int) (*User, error) {
</span><span style="color:#323232;">  validatedName, err = validateName(name)
</span><span style="color:#323232;">  if err != nil {
</span><span style="color:#323232;">    return nil, err
</span><span style="color:#323232;">  }
</span><span style="color:#323232;">
</span><span style="color:#323232;">  validatedAge, err = validateAge(age)
</span><span style="color:#323232;">  if err != nil {
</span><span style="color:#323232;">    return nil, err
</span><span style="color:#323232;">  }
</span><span style="color:#323232;">
</span><span style="color:#323232;">  return User(Name: validatedName, Age: validatedAge), nil
</span><span style="color:#323232;">}
</span>

In the Haskell, the fact that Either is a monad is saving you from a lot of boilerplate. You don’t have to explicitly handle the Left/error case, if any of the Eithers end up being a Left value then it’ll correctly “short-circuit” and the function will evaluate to that Left value.

Without using the fact that it’s a functor/monad (e.g you have no access to fmap/>>=/do syntax), you’d end up with code that has a similar amount of boilerplate to the Go code (notice we have to handle each Left case now):


<span style="color:#323232;">mkValidUser :: String -> Int -> Possible User
</span><span style="color:#323232;">mkValidUser name age =
</span><span style="color:#323232;">  case (validatedName name, validateAge age) of
</span><span style="color:#323232;">    (Left nameErr, _) => Left nameErr
</span><span style="color:#323232;">    (_, Left ageErr)  => Left ageErr
</span><span style="color:#323232;">    (Right validatedName, Right validatedAge) => 
</span><span style="color:#323232;">      Right $ User validatedName validatedAge
</span>
arc ,

Swift and Rust have a far more elegant solution. Swift has a pseudo throw / try-catch, while Rust has a Result<> and if you want to throw it up the chain you can use a ? notation instead of cluttering the code with error checking.

barsoap ,

The exception handling question mark, spelled ? and abbreviated and pronounced eh?, is a half-arsed copy of monadic error handling. Rust devs really wanted the syntax without introducing HKTs, and admittedly you can’t do foo()?.bar()?.baz()? in Haskell so it’s only theoretical purity which is half-arsed, not ergonomics.

m_f ,

It’s not a half-arsed copy, it’s borrowing a limited subset of HKT for a language with very different goals. Haskell can afford a lot of luxuries that Rust can’t.

barsoap ,

It’s a specialised syntax transformation that has nothing to do with HKTs, or the type system in general. Also HKTs aren’t off the table it’s just that their theory isn’t exactly trivial in face of the rest of Rust’s type system but we already have GATs.

It actually wouldn’t be hard writing a macro implementing do-notation that desugars to and_then calls on a particular type to get some kind of generic code (though of course monomorphised), but of course that would be circumventing the type system.

Anyhow my point stands that how Rust currently does it is imitating all that Haskell goodness on a practical everyday coding level but without having (yet) to solve the hard problem of how to do it without special-cased syntax sugar. With proper monads we e.g. wouldn’t need to have separate syntax for async and ?

Nevoic ,
@Nevoic@lemmy.world avatar

Note: Lemmy code blocks don’t play nice with some symbols, specifically < and & in the following code examples

This isn’t a language level issue really though, Haskell can be equally ergonomic.

The weird thing about ?. is that it’s actually overloaded, it can mean:

  • call a function on A? that returns B?
  • call a function on A? that returns B

you’d end up with B? in either case

Say you have these functions


<span style="color:#323232;">toInt :: String -> Maybe Int
</span><span style="color:#323232;">
</span><span style="color:#323232;">double :: Int -> Int
</span><span style="color:#323232;">
</span><span style="color:#323232;">isValid :: Int -> Maybe Int
</span>

and you want to construct the following using these 3 functions


<span style="color:#323232;">fn :: Maybe String -> Maybe Int
</span>

in a Rust-type syntax, you’d call


<span style="color:#323232;">str?.toInt()?.double()?.isValid()
</span>

in Haskell you’d have two different operators here


<span style="color:#323232;">str >>= toInt &lt;&amp;> double >>= isValid
</span>

however you can define this type class


<span style="color:#323232;">class Chainable f a b fb where
</span><span style="color:#323232;">    (?.) :: f a -> (a -> fb) -> f b
</span><span style="color:#323232;">
</span><span style="color:#323232;">instance Functor f => Chainable f a b b where
</span><span style="color:#323232;">    (?.) = (&lt;&amp;>)
</span><span style="color:#323232;">
</span><span style="color:#323232;">instance Monad m => Chainable m a b (m b) where
</span><span style="color:#323232;">    (?.) = (>>=)
</span>

and then get roughly the same syntax as rust without introducing a new language feature


<span style="color:#323232;">str ?. toInt ?. double ?. isValid
</span>

though this is more general than just Maybes (it works with any functor/monad), and maybe you wouldn’t want it to be. In that case you’d do this


<span style="color:#323232;">class Chainable a b fb where
</span><span style="color:#323232;">    (?.) :: Maybe a -> (a -> fb) -> Maybe b
</span><span style="color:#323232;">
</span><span style="color:#323232;">instance Chainable a b b where
</span><span style="color:#323232;">    (?.) = (&lt;&amp;>)
</span><span style="color:#323232;">
</span><span style="color:#323232;">instance Chainable a b (Maybe b) where
</span><span style="color:#323232;">    (?.) = (>>=)
</span>

restricting it to only maybes could also theoretically help type inference.

barsoap , (edited )

I was thinking along the lines of “you can’t easily get at the wrapped type”. To get at b instead of Maybe b you need to either use do-notation or lambdas (which do-notation is supposed to eliminate because they’re awkward in a monadic context) whereas Rust will gladly hand you that b in the middle of an expression, and doesn’t force you to name the point.

Or to give a concrete example, if foo()? {…} is rather awkward in Haskell, you end up writing things like


<span style="color:#323232;">foo x y = bar >>= baz x y
</span><span style="color:#323232;">  where
</span><span style="color:#323232;">    baz x y True = x
</span><span style="color:#323232;">    baz x y False = y
</span>

, though of course baz is completely generic and can be factored out. I think I called it “cap” in my Haskell days, for “consequent-alternative-predicate”.

Flattening Functors and Monads syntax-wise is neat but it’s not getting you all the way. But it’s the Haskell way: Instead of macros, use tons upon tons of trivial functions :)

arc ,

You can say it’s half-arsed if you like, but it’s still vastly more convenient to write than if err != nil all over the place

vox ,
@vox@sopuli.xyz avatar

btw lua handles error in exactly the same way

fkn , in Golang be like

Also Go: exceptions aren’t real, you declare and handle every error at every level or declare that you might return that error because go fuck yourself.

zorro ,

Because that’s sane and readable?

fkn ,

Wow. I’m honestly surprised I’m getting downvotes for a joke. Also, no. It isn’t. It really isn’t.

gornius ,

It is better than in most languages with exceptions, except from languages like Java, that require you to declare that certain method throws certain error.

It’s more tedious in Go, but at the end of the day it’s the same thing.

When I use someone else’s code I want to be sure if that thing can throw an error so I can decide what to do with it.

fkn ,

Java doesn’t have to declare every error at every level… Go is significantly more tedious and verbose than any other common language (for errors). I found it leads to less specific errors and errors handled at weird levels in the stack.

GlitchSir ,

You know it’s social media when the one that’s right is downvoted

eestileib ,

I’m with you, exceptions sound good but are a bug factory.

r1veRRR ,

It’s better than “invisible” exceptions, but it’s still the worst “better” version. The best solution is some version of the good old Result monad. Rust has the BEST error handling (at least in the languages i know). You must handle Errors, BUT they are just values, AND there’s a easy, non-verbose way of passing on the error (the ? operator).

theneverfox ,

Beyond a quick “hello world” when it came out, I’ve never used rust, but that sounds pretty great

herrvogel ,

There’s nothing sane and readable about how Go insists you format dates and time. It is one of the dumbest language features I’ve ever seen.

GlitchSir , in The lengths we have to go to

Just draw whitespace…

confusedbytheBasics , in Every Single Freaking Time

Select text to copy. Middle click to paste.

Don’t use Ctrl…

jmcs ,

deleted_by_author

  • Loading...
  • BakedGoods ,

    Don’t they ever test shit?

    NotSteve_ ,

    It’s less that it’s broken and more that it hasn’t been implemented yet AFAIK.

    nintendiator ,

    Same difference.

    Jean_Mich_Much ,
    @Jean_Mich_Much@jlai.lu avatar

    I’m using sway and I still can do that with urxvt

    30p87 ,

    To be fair, I would not expect someone using a wayland WM and urxvt to use the mouse to copy-paste.

    Jean_Mich_Much ,
    @Jean_Mich_Much@jlai.lu avatar

    I understand. I’m not using sway and urxvt as someone more skilled would do. I’ve Made this config some years ago to try but nowadays I’m not doing computer things anymore but I’ve kept this config because it’s light, fast and it’s simply working. So basically, today I’m just copying my passwords from pass in urxvt to my webmail in Firefox with my mouse for checking mail …

    Vilian ,

    what?, no

    Bazz ,

    I’m sorry but… it works on my machine

    Trobador ,

    I never realized that was why people used the primaey clipboard on Linux…

    But I’ll be frank : fuck that. I’d rather disable it entirely and stop having to deal with random text pasting in bad places when I’m using the touchpad

    confusedbytheBasics ,

    What wonky touchpad makes that a problem?

    You could use shift -insert instead I suppose.

    fbmac , in Some people just wake up and choose violence
    @fbmac@lemmy.fbmac.net avatar

    are browsers and libs good enough to do front end without a build step yet?

    adrian783 ,

    you’re perfectly welcome to throw hand rolled html/css/js on an ftp server

    kuneho ,
    @kuneho@lemmy.world avatar

    I feel that’s something frontend devs deliberately left behind to make them feel like big dogs do /s

    JDtheGeek ,

    Watching Bun 1.0 release closely, as seems to be helping move web development much closer to that goal. Fingers crossed.

    unsaid0415 , in Some people just wake up and choose violence

    I recently made a small pure JS package at my company. It just fucking worked, can you believe it? No setting up compilation and CI/CD for build + release. Just put it in the repo and publish manually, and it just worked, it’s ridiculous

    jmk1ng ,
    @jmk1ng@programming.dev avatar

    Did it work? How do you know that? A consumer of your package sends a int when your package expects a string.

    What now?

    jet ,

    Hey man it passed the CICD. Not my problem

    nulluser ,

    Theoretically, they’ll test and notice that doesn’t work and fix their code before they deploy it to production.

    Quill7513 ,

    Where can you point to other developers evidence that the code in git matches the code you deployed? Deploying locally built packages to prod is an automatically fireable offense because its not auditable

    nulluser ,

    WTF are you talking about? All I’m saying is that if you write code (that in the context of this discussion passes arguments to a method you didn’t write, that may not be the type the author of the method expected someone to pass, but really, that’s completely beside the point), you should, oh, I don’t know, maybe test that it actually works, and maybe even (gasp) write some automated tests so that if anything changes that breaks the expected behavior, the team immediately knows about it and can make appropriate changes to fix it. You don’t need a strongly typed language to do any of that. You just need to do your job.

    sik0fewl ,

    Consumer just needs to write 4x as many unit tests to make up for lack static typing. Hopefully the library author has done the same or you probably shouldn't use that library.

    marcos ,

    4x as many unit tests

    Well… the people fighting against TS are simply not testing things thoroughly. So they are not writing those tests.

    Some times that’s even perfectly ok. But you don’t want to build things over a complex library that has this attitude.

    (Except for svelte. It’s meaningless for svelte, as TS was always a really bad fit for it.)

    Stumblinbear ,
    @Stumblinbear@pawb.social avatar

    It’s ok, just do what my company does and write no tests at all!

    magic_lobster_party ,

    CI/CD is useful regardless of which language you’re using. Sooner or later some customer is going to yell at you because you didn’t discover the fatal error before deploying.

    jabberati ,
    @jabberati@social.anoxinon.de avatar

    @magic_lobster_party @alphacyberranger @unsaid0415 CI/CD won't prevent that. I wonder what it is for. Not using the CPU on my laptop for tests? And why would I want to commit before knowing the tests pass?

    AstridWipenaugh ,

    CICD isn’t an alternative to testing your own work locally. You should always validate your work before committing. But then once you do, the CICD pipeline runs to run the tests on the automation server and kicks off deployments to your dev environment. This shows everyone else that the change is good without everyone having to pull down your changes and validate it themselves. The CICD pipeline also provides operational readiness since a properly set up pipeline can be pointed to a new environment to recreate everything without manual setup. This is essential for timely disaster recovery.

    If you’re just working on little projects by yourself, it’s usually not worth the time. But if you’re working in anything approaching enterprise grade software, CICD is a must.

    Stumblinbear ,
    @Stumblinbear@pawb.social avatar

    He says as though he’s never had two PR merges conflict logically with each other

    jabberati ,
    @jabberati@social.anoxinon.de avatar

    @Stumblinbear I only worked on small projects so far, that's probably why I don't understand it. But a merge commit is like any other commit and the person pushing this commit has to make sure it works.

    Stumblinbear ,
    @Stumblinbear@pawb.social avatar

    When working in teams, merging in two pull requests with seemingly unrelated changes is common practice. If I had to rebase and re-run tests every time another PR got merged in while mine was awaiting reviews, I’d spend most of my time running tests

    Ranman ,

    deleted_by_author

  • Loading...
  • Pyroglyph ,
    @Pyroglyph@lemmy.world avatar

    I thought it was clear: they’re implying JS is simpler/faster to write and deploy because transpilation is necessary when using TS (unless you use a modern runtime).

    ObsidianBlk , in Which side are you? Javascript or Typescript
    @ObsidianBlk@lemmy.world avatar

    My issue with typescript… and, correct me if I’m wrong… is it doesn’t exist without Javascript. Typescript needs to be compiled down into Javascript to be run. It has no stand alone interpreter (that I’m aware of) and definitely not one baked into web browsers or NodeJS (or adjacent) tools. In essence, Typescript is jank sitting on top of and trying to fix Javascript’s uber jank, simultaneously fracturing the webdev space while not offering itself as a true competitive and independent language for said space.

    That’s my amateur two cents for what it’s worth.

    madcaesar ,

    You are correct.

    That says I would never ever EVER start a project without TS.

    It’s like coding with hands vs coding with your elbow.

    EarMaster ,

    I also don’t want to compile my C++ code myself. I’m pretty happy with letting a compiler do it’s job…

    fidodo ,

    I really don’t get how people can feel more productive in JavaScript. With typescript the code practically writes itself. Sometimes when refactoring I’ll change a functions input and output signature and just fix compiler errors until it stops complaining, and the code just works without me having to really even think about what the code is doing.

    Any time I’m forced to go back to js I feel like I’m going crazy trying to keep track of what’s in all the variables. With typescript I can use more powerful object structures without having to constantly double check where they came from.

    CanadaPlus ,

    What we really need is a browser that runs something other than Javascript. Until then, stack of jank it is.

    SoBoredAtWork ,

    WASM?

    CanadaPlus ,

    Is that a standalone thing? This is obviously not my specialty but I thought it was part of Javascript.

    SoBoredAtWork ,

    I’ve never worked with it and don’t know in detail, but it lets you compile several languages into web based client/server code (basically, converting other languages into website code). Works with C, C++, C#, Go, Rust, Swift, etc)

    brian ,

    I don’t think it really fractures anything considering you can call a ts package from js without knowing. The other way also works with third party typings in DefinitelyTyped.

    It really just adds a bit of extra type info into js, looks like js, and transpiles into js that looks almost exactly like the input, including comments and spacing and such if you like, so there isn’t any lockin.

    There isn’t any competition, it’s just an extra optional tool for the js ecosystem in my eyes.

    shasta ,

    I think too many people ITT are conflating Typescript with Typescript frameworks like Angular.

    fidodo ,

    The transpilation that typescript does doesn’t really have anything to do with typescript, it’s just there because typescript wants to support the latest ecmascript features, so transpilation is necessary for that, but technically you could simply strip out the type info and have another transpiler like babel handle the backwards compatibility. I think there are a few minor exceptions to that, like enums. There was even a proposal to add some typescript types to native JavaScript that would be ignored by the interpreter and just act as comments.

    brian ,

    I mean, tsc without any of the backporting functionality is still a transpiler since it goes from a high level language(ts) to another high level language(js). Transpilation as a concept doesn’t imply that it is for backporting language features or that the source and destination languages are the same, just that it is a transformation from source code to a similar or higher abstraction level language source code

    fidodo ,

    Yes, it’s still a transpiler, I’m not saying it isn’t, but what I mean is that it doesn’t add any functionally specific to the typescript language. There’s a transpiler for TS that doesn’t even do any type checking at all and just does the type stripping and back porting. But of course, that’s not why people use typescript. All the features that are actually important to typescript could be done through a linter instead. If type annotations were added to JavaScript you could get most of typescript’s features with linting rules and just handle back porting in a more standard way.

    lily ,

    Just fyi, while they don’t help with running TS in the browser, the Bun and Deno runtimes both natively run TS without any compilation.

    severien ,

    That’s not true, deno compiles TypeScript to JavaScript, it just does it transparently. The code still runs on v8.

    brian ,

    V8 also doesn’t run js, it does some byte code compilation stuff amongst other things, then interprets that. But that’s all a bit pedantic too, V8 runs js, deno runs ts.

    fwiw deno.com even has as one of their first bullet points that they have “native support for TypeScript and JSX”

    severien ,

    Sure, but part of the claim was “without any compilation”. But bun/deno do compile TS into JS.

    Anticorp ,

    As a professional with 25 years of experience I agree with you. The entire modern architecture was created by people who don’t like simple things that work. I’m pretty sure there are a couple of high ranking master developers sitting at the head of W3C competing to create the most convoluted system possible.

    DogMuffins ,

    I agree.

    I’m a hobbyist. I don’t work on really large or complex projects. I just want to get the most productivity for my spare-time-dabbling and having tried a few times to get into typescript it seemed to create more “extra steps” for me than it saved.

    JakenVeina ,

    The fact that TypeScript doesn’t attempt to obfuscate JavaScript, and just fills in the gaps, is what makes it the best solution to the problem.

    It’s not a separate language, it’s Javascript tooling

    fidodo ,

    I’ve used JavaScript since its creation. I would describe typescript as JavaScript as it should have been. I’ve always actually liked JavaScript’s simplicity, but I’ve never liked its lack of type safety. At its core, JavaScript has a tiny conceptual footprint, and that’s actually pretty refreshing compared to other very complicated languages. But it was plagued with terrible implementations and the inherent messiness of dynamic typing. I’ve watched it evolve over the years and it’s improved beyond my greatest hopes. Between the advent of transpilation, tooling, and typescript, I’m very proud of where the language has gotten to. Having made websites in the 90s and 00s, I feel like people don’t realize how much work has gone into getting the ecosystem in a much better place.

    guts ,

    Like 2023 CoffeeScript?

    fidodo ,

    Typescript doesn’t have strong typing but static typing still gets you really really far. It means you need to be more careful with your io and avoid dangerous type assertions, but I don’t think that’s a bad thing. Having used typescript an absolute ton, the only real jank I’ve encountered is from bad library typings that either use it lazily or incorrectly, but for code bases that use it through and through it has been smooth sailing, and having professionally used both traditional static typed languages and dynamically typed languages, I really enjoy typescript’s type inference and structural typing. I think you should give it an honest try before judging it. But that’s just my 2 cents as an industry professional who has used many languages and have been programming for decades for what it’s worth.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines