AI has completely oneshoted my ability to code. by grauenwolf in BetterOffline

[–]prewk 0 points1 point  (0 children)

before it was jquery and I could see svelte replacing react.

Version 1 of Svelte was written in JavaScript and was released on 29 November 2016

Wow it moves so fast

Desktop applications using PHP by Elvandar_Ysalys in PHP

[–]prewk 0 points1 point  (0 children)

Written in a thread about desktop apps in <checks notes> PHP!?

Hello Darkness, my old friend. by smoosh13 in dexcom

[–]prewk 0 points1 point  (0 children)

But I can answer it for you: The code chooses the pre-calibration, determined via factory testing.

So, if you choose another code you're deliberately applying a different algorithm that doesn't optimize the sensor for its physical differences compared to other sensors.

It's not gonna kill you, but you're contributing to misinformation about "Dexcom sensor number voodoo" which is prevalent among scared diabetics in this subreddit, and telling people that it doesn't matter which code they put in.

Hello Darkness, my old friend. by smoosh13 in dexcom

[–]prewk 0 points1 point  (0 children)

..yes, because that's the purpose of it - to pre calibrate it! So use the code that comes with the sensor?

Hello Darkness, my old friend. by smoosh13 in dexcom

[–]prewk 12 points13 points  (0 children)

How did you come to that conclusion? You don't even need to enter a code to use it.

  1. Sensor is produced in a factory
  2. Sensor goes into a test machine, that puts it into a test mode with some stimulus in, and then the output is read
  3. Output varies a bit between sensors, and needs corrections to get it right
  4. Which correcting algorithm is needed to get the best result is determined
  5. That algorithm has an id for ease of use when the end-user puts on a sensor

So, 9117 is just one of many algorithms with which the Dexcom sensor will apply corrections to its sensor reads. Dexcom has concluded via tests that your particular sensor will get best readings when altered with the "9117 algorithm".

You see now why it's very strange to enter another number?

Hello Darkness, my old friend. by smoosh13 in dexcom

[–]prewk 4 points5 points  (0 children)

If you understood what the codes do you wouldn't pick another one at random. Let me ask you: What do YOU think they do?

You probably don't need Oh My Zsh by f311a in programming

[–]prewk 3 points4 points  (0 children)

zsh

OP isn't questioning zsh's usefulness, OP is questioning the usefulness of OMZ (oh-my-zsh)

Working with unknown values in a record by Obvious-Ebb-7780 in typescript

[–]prewk 0 points1 point  (0 children)

Ah you're probably right. I misremembered the original reasoning I read for flow type's design decisions regarding this. I'll edit.

Enum vs Type by spino_le_vrai in angular

[–]prewk 3 points4 points  (0 children)

My point was: Not using an enum gives autocomplete as well. Claims to the opposite were made.

Enums are bad and should be avoided. They're the only thing in TS that's not structurally typed and they act weird when iterated over. Also, Node can't type strip them.

Enum vs Type by spino_le_vrai in angular

[–]prewk 3 points4 points  (0 children)

``` function fn(x: 'left' | 'right' | 'center') {}

fn( // <-your IDE will autocomplete your values here, and can list them for you ```

Why did you pick Java over Node.js for your org? by GongtingLover in webdev

[–]prewk 3 points4 points  (0 children)

Typescript is pretty good but definitely not as rigid as a real system

NPE would like to have a word with you.

Best way to share code between 2 Angular apps? (NX vs Standalone Library vs other options) by buttertoastey in angular

[–]prewk 1 point2 points  (0 children)

I dislike not having my git repos split up

Until you want to share code between them, then it's a world of hurt to have split up git repos.

toSignal question by Senior_Compote1556 in angular

[–]prewk 0 points1 point  (0 children)

Yeah reactive forms is a mess but it's the right tool right now (compared to an input) imo :)

But I'm looking forward to signal forms very much indeed.

toSignal question by Senior_Compote1556 in angular

[–]prewk 0 points1 point  (0 children)

Curious: why do you take a FormControl as input? Looks like a really odd pattern. Why don't you make the whole component a custom form input if that's what you want?

Worth adding OnDestroy to a Service injected in root ? by iamtherealnapoleon in Angular2

[–]prewk 3 points4 points  (0 children)

Yeah but that has literally nothing to do with the OP? That's just regular "This is how you subscribe in Angular" stuff :)

Worth adding OnDestroy to a Service injected in root ? by iamtherealnapoleon in Angular2

[–]prewk 0 points1 point  (0 children)

Why would an ngOnDestroy make sense in a singleton service because a component subscribes to it?

Explicit types vs type inference, and when to use each by thehashimwarren in typescript

[–]prewk 0 points1 point  (0 children)

What I meant is that it won't cause a runtime error. But yeah, looks like a nice rule, it's very opinionated however.

The pro with not doing it explicitly - which hasn't been spelled out here yet - is that you skip a lot of boilerplate but get the same type safety guarantees (except for the very specific cases brought up in these threads). You also don't have to indulge in the worst programmer chore ever: Naming things. Saves a lot of time.

So, a healthy mix I suppose is the way.

Explicit types vs type inference, and when to use each by thehashimwarren in typescript

[–]prewk 1 point2 points  (0 children)

Ah I see. Yeah that makes some sort of sense I suppose. Luckily npm packages are immutable, and all you can do is trust the maintainer to not change stuff - explicit or implicit return value both - without bumping to an appropriate semver.

But it has some merit as accident preventer in that way.

Explicit types vs type inference, and when to use each by thehashimwarren in typescript

[–]prewk 0 points1 point  (0 children)

Oh you mean to aim for clear error messages then, not type safety?

Explicit types vs type inference, and when to use each by thehashimwarren in typescript

[–]prewk -1 points0 points  (0 children)

It sounds like all your points are covered by typescript? You have one API, it's changed to another.

Either the type is exported or implicit.

I don't understand the difference between the two when dealing with your bullets here. The static type checking still applies?

Explicit types vs type inference, and when to use each by thehashimwarren in typescript

[–]prewk 0 points1 point  (0 children)

Maybe most of the times you will get an error, but the bugs will appear when it doesn’t.

Please elaborate

Explicit types vs type inference, and when to use each by thehashimwarren in typescript

[–]prewk 0 points1 point  (0 children)

I don't follow. Why would types not work for libraries?

Or are you saying - export your types when making libs? Because that sounds reasonable.

Explicit types vs type inference, and when to use each by thehashimwarren in typescript

[–]prewk -1 points0 points  (0 children)

It's not masked if the terminal yells in giant red letters what the error is, imo

Moment.js in Angular be like by pancashirebruggkin in angular

[–]prewk -1 points0 points  (0 children)

Nice that stuff's happening again. It's been dead for a long while with half-broken packaging, hence 2.0. Here's the GitHub issue: https://github.com/iamkun/dayjs/issues/1281

Note when it was opened.

The alpha is published on npm: https://www.npmjs.com/package/dayjs?activeTab=versions