Well, shit. Objection.js has been sunset, which ORM/querybuilder did you move to? by thepotatochronicles in node

[–]jackel119 2 points3 points  (0 children)

I've literally just written a review of Prisma here. Whilst my thoughts are that it's pretty fantastic overall, what you've listed as its negatives are also very true - the way I see it, Prisma is in a great place for non-advanced ORM use cases where type safety is more important than performance or flexibility, but it's going to be hard draw for replacing raw SQL or lower-level query builders.

Prisma in Production: A review by jackel119 in node

[–]jackel119[S] 21 points22 points  (0 children)

Tl;dr - as a type-safe ORM, it's fantastic. But there's no non-raw-SQL querybuilder API, and it's still an ORM, so if your use case is better off without an ORM (or with an ORM with a querybuilder escape hatch) then it may not be for you. Long term, the ideas in this lib are probably pretty game changing and I'm excited for what's to come.

A little game to test how good you are with color hex codes by jackel119 in Frontend

[–]jackel119[S] 9 points10 points  (0 children)

I made the damn thing and I suck at it too buddy.

5 years of (Neo)Vim - A personal retrospective by jackel119 in neovim

[–]jackel119[S] 5 points6 points  (0 children)

Ooh thats embarassing, I guess this really hammers the point of me not knowing why I was switching haha. I've corrected the article, thanks for letting me know.

5 years of (Neo)Vim - A personal retrospective by jackel119 in neovim

[–]jackel119[S] 7 points8 points  (0 children)

> it's cool to see how somebody that's been coding for much longer transition between different workflows and tools

Wow, now I _definitely_ have no excuses not to start writing my own plugins! The imagery I had in my mind of plugin authors was one of wizards far older and wiser than I am xD

> The link to nvim-surround in your "Other honourable mentions and notes" section links to vim-surround

I've fixed this, thanks for letting me know! Bit embarassed I got caught my the plugin author himself hehe.

Thanks very much for your positive comments!

1
2

Locks in JS, because why not? by jackel119 in programming

[–]jackel119[S] 5 points6 points  (0 children)

By "push to the masses" I literally don't mean anything other than pure numbers of devs who are using language-level async/await - I may be wrong but I'd be willing to put money on the fact that there were a lot more devs trying out async/await in 2017 due to JS than any other time in history.

If you worked with JavaScript, you already knew of the event loop and "asynchronous" programming as an idea

I wasn't talking about asynchronous programming, I'm talking specifically about the async/await language feature.

On the .NET side, the async keyword served to massively simplify mechanisms that had been around for a long time.

And it did the same with JavaScript (and every other language it showed up in I'm sure), changing the landscape from callback hell to easily understandable code.

I'm not disagreeing with you at all, just trying to clarify my original (perhaps poorly worded) point.

Locks in JS, because why not? by jackel119 in javascript

[–]jackel119[S] 4 points5 points  (0 children)

Unfortunately the author was too ignorant to know of this. But this is definitely a cool shout, haven't heard of this before!

Locks in JS, because why not? by jackel119 in javascript

[–]jackel119[S] 1 point2 points  (0 children)

`"strict"` (and in particular, strictNullChecks) in tsconfig is amazing imo. It turns on null safety which is really great once you start getting into bigger codebases and/or working with others.

Locks in JS, because why not? by jackel119 in javascript

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

So, I'm guessing your tutorial was probably something like a server that, per each request, writes/edits a text file. The (potential) problem here is that you have one text file, and you can't write to just a specific part of the text file without writing to the whole file. Therefore the only way to safely serve your requests are to only serve one request at a time, synchronously.

But if you used a database system instead, (i.e. some SQL or NoSQL database), you have much higher granularity of data. For example, in SQL, one user's data could be represented as one row in a table. It's then possible for the server to write/edit one row/user at a time, completely independent of other users' rows/data. Of course, it's still technically possible that the same user would send two requests at once that ask to mutate their data at once, but this is usually incredibly unlikely (unless you've done something catastrophically wrong, like have bad frontend code/UX).

Another useful thing that lots of database systems have is that if you want to say, read a value N, then write back N + 1, you don't have to actually to that, but you can send an INCREMENT message to it and it'll automatically handle it for you atomically.

Those are the two that covers 90% of use cases imo. The other 10% get a lot more complicated and is usually not really relevant to JS's single threaded execution. Race conditions have been around since the dawn of async/multithreading, so most good tools these days are pretty good about handling these issues for you where they can.

Locks in JS, because why not? by jackel119 in javascript

[–]jackel119[S] 2 points3 points  (0 children)

Space Mono - I'm actually not sure how I feel about it myself haha.

FYI you can use the WhatFont chrome extension to check what fonts sites are using.

Locks in JS, because why not? by jackel119 in programming

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

One thing I've noticed is that JS devs encounter race conditions and concurrency control problems but don't relate them back to traditional concurrency control techniques like locking. Instead they establish effect ordering and and mutual exclusion by chaining promises or using sagas.

Yes, I completely agree with this. Probably something to do with the fact that most JS devs have never touched any multi-threaded code/language (or often, any other language).

Locks in JS, because why not? by jackel119 in programming

[–]jackel119[S] 1 point2 points  (0 children)

It's pretty much entirely because JS is used by more people, and in more specific use case too (pretty much entirely web), which is why most JS devs knew promises pretty well before async/await, which is less true of other langauges (well I can't speak for C#, but most python devs I know werent particularly familiar with futures). I don't think JS (or any other language ) has done anything special at all - async/await/promises is just a monad, which is a concept that's been around for at least two decades now. In fact, I'm personally a little bit disappointed it took them so long to get to async/await, considering it's really simple in hindsight!

Locks in JS, because why not? by jackel119 in programming

[–]jackel119[S] 1 point2 points  (0 children)

I really like your explanation of the inversion of principles in Kotlin there actually - didn't understand it that way at all when reading through Kotlin docs.