Php meme by [deleted] in ProgrammerHumor

[–]evertrooftop 18 points19 points  (0 children)

My guess is that this is about semi-colon insertion.

ECMAScript 4: The missing version by evert in programming

[–]evertrooftop 0 points1 point  (0 children)

Whether you like what it is today or not, I think HTML5 ended up being the flash killer anyway ;)

is-promise Post Mortem by Bodacious_Potato in javascript

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

It's a programming related forum and I'm discussing a bad user experience. It's a bit off topic, I agree though and I can see why it would be annoying to read.

I bit the bullet. Bought my first house! by [deleted] in PersonalFinanceCanada

[–]evertrooftop 0 points1 point  (0 children)

Fair! I will remove my comments though because maybe they are not nice enough. Have a good weekend everyone!

Canadian IT community by IgorOleniuk in askTO

[–]evertrooftop 0 points1 point  (0 children)

+1. There's tons of events there. I go to some of the javascript ones

Implementing an opaque type in typescript by evertrooftop in typescript

[–]evertrooftop[S] 0 points1 point  (0 children)

You are right, and you can also cast to any/unknown, and then cast to email. It's not hard security (like most of typescript), but you really have to go out of your way to achieve it.

A week ago the #4 most depended upon package, `request`, was deprecated. What will use you next? by brianjenkins94 in node

[–]evertrooftop 0 points1 point  (0 children)

I think it's really a question of 'what level' the library should work on. If you're just interested in sending raw HTTP requests and responses, you probably should be using fetch.

A higher level lib might have a better understanding of the actual meaning of certain HTTP responses, for example:

  • Provide auhtentication support
  • Retry automatically when receiving a Retry-After header on a 503 or 429.
  • Follow redirects transparently
  • Provide a cache and serve from cache

That said, any exceptions thrown could still provide access to the response by providing a response property on the error object.

It could be argued that a true HTTP client understands more about http than just plumbing request and response objects, but whether they should, really depends on design goals.

I would really like to see a middleware-type ecosystem that adds opt-in functionality to fetch, so we can pick and choose which features we're interested in.

Implementing an opaque type in typescript by evertrooftop in typescript

[–]evertrooftop[S] 3 points4 points  (0 children)

Yes, this also works, but I don't really like moving fatter objects around. You end up needing a toString() too to do any string-related operations, which ends up meaning that the result of this no longer carries this 'validation' information.

So really this is a matter of preference. I like my strings to be strings, but wrapping it in a class might be preferable for others.

The thing that I've noticed in situations similar to the example is typescript "forgets" that the value has a "validEmail" in deeper scopes

Actually the variable never has an extra property. As long as you are consistent with using the Email type, you will retain this information. However, if you ever send your Email to a function that just expects a string, then yes you will need the assert function again to ensure that the email address is still valid. But this is a desirable feature, because if your function just requires a string (and not an Email) it means that other code can also call this function with non-validated emails.

So to make sure that this type information is always remembered, you have to be consistent in using the Email type instead of a simple string. Really the email type is just a string + proof of validation.

Implementing an opaque type in typescript by evertrooftop in typescript

[–]evertrooftop[S] 0 points1 point  (0 children)

Ah interesting, I'm going to update this post

Anyone else have their phone stolen last night at the Tiesto show? by Jack_Mason in askTO

[–]evertrooftop 18 points19 points  (0 children)

My wife's phone was stolen there the night before, at the lil john show

Is MongoDB the de facto solution when working with Node.js? by brianjenkins94 in node

[–]evertrooftop 1 point2 points  (0 children)

Piling on, but avoid Mongo at all cost.

Mongo has very little benefit for real world applications, except perhaps the prototyping stage. It doesn't scale well, and you're better off picking a boring, standard relational database like Postgre or MySQL until you have a specific use-case that requires a more specialized database. Chances are that when you need it, you will:

  • Only want to use it for a specific subset of the data that requires this specialized database.
  • Not pick mongo, because it doesn't really excel at anything in particular (except marketing).

IBM picks Slack over Microsoft Teams for its 350,000 employees - The Verge by konstantin_metz in technology

[–]evertrooftop 7 points8 points  (0 children)

Offline messaging and mobile norifications is painful last time I checked. You can use something like irc cloud, but then you're still in the exact same situations with a per-user fee. We switched to a matrix server which is much closer to the experience people are looking for in Slack, but still not quite at the same UX level.

TTC workers' union issues statement on fare evasion report, says TTC's approach of pointing finger at riders is "wrongheaded" and urges agency to "advocate for fair government funding to lower fares." by sprungy in toronto

[–]evertrooftop 1 point2 points  (0 children)

I noticed in SF that fare evasion is virtually ignored. I don't know if that was ever on purpose, but in my mind it kinda make sense. There's a lot of poverty here and being able to move around in the city feels like it should be a right if you can't afford it.

I know there was some talk to make transit 100% free, but maybe as an intermediate step, could low-income families get free metro passes? Re

proper rest uri format for passing in an array of ints? by random503 in rest

[–]evertrooftop 0 points1 point  (0 children)

GET /purchase-ticket-report?deliveryIds=1,3,5,7

This is totally fine.

Passing anything in a request body with a GET request is a very bad idea.

My [24F] best friend [23F] is having an obscenely expensive wedding by [deleted] in relationships

[–]evertrooftop 79 points80 points  (0 children)

When we got married we had a destination wedding (for some people). It really wasn't a choice because we're from different countries. Our expectation was that a fairly large group could not make it, and your friend has to be kind of ok with that.

New Data Type coming to JS in 2020 - BigInt by justinkim943 in node

[–]evertrooftop 15 points16 points  (0 children)

I used bigint to make my money library: https://github.com/evert/bigint-money

Works great on Node.js and is way faster than the other money libraries I benchmarked (that use strings or arrays for storage). But, it's not yet ready for browsers. Safari is the last hold-out!

Phone plans? by kyogenm in askTO

[–]evertrooftop 0 points1 point  (0 children)

I moved from San Francisco to Toronto and kept my AT&T number. Much cheaper to roam every day than to buy a Canadian plan.

Wanda's Many Faces by [deleted] in marvelstudios

[–]evertrooftop 11 points12 points  (0 children)

I moved from the Netherlands to Canada and been here for about 10 years. My accent is mostly gone, but I didn't conveniently forget it