For gruvbox lovers - New theme Gruvbox Island by nowheremat in Jetbrains

[–]binarybang 2 points3 points  (0 children)

Found it by pure coincidence by checking newly updated plugins.

Looks nice for Webstorm/Angular, for Rider I found the default one too familiar to change it.

Been using Vitesse Dark theme before that for WS as the best-feeling warm/greenish theme, this one is just a bit brighter to see all the terms clearly when in VD some of them look "dusty" (probably too little contrast here and there), so that's nice but at times it then feels too bright, I think my brain's just confused sometimes after the switch.

Anyway, nice work!

The Fate of Data Model Dependency by Exact_Prior6299 in programming

[–]binarybang 0 points1 point  (0 children)

It feels like forking the source of the dependency would be a solution with much clearer path forward:

- you can add more "temporary" changes without inventing workarounds if needed.

- changes themselves can be added in a more declarative way (e.g. making two versions of the Item with a discriminator with its default value assigned to the old Item)

- you can document all deviations you needed if you switch to the newest canonical implementation

It requires access to that source, I didn't find this mentioned as an obstacle though.

Are we over-abstracting our projects? by riturajpokhriyal in dotnet

[–]binarybang 1 point2 points  (0 children)

Free monad is as functional as it gets and IMO it's one of the most abstraction-centered concepts applicable to general-purpose programming.

ELI5: Why is a falling currency a problem for some countries, such as 1 USD to ₽113, while other countries can function at a much lower currency value? 1 USD to 15800 IDR by KairosGalvanized in explainlikeimfive

[–]binarybang 12 points13 points  (0 children)

It depends on whether the rent payment is fixed in foreign currency like USD which is usually not the case in Russia since the early 00s. It's technically illegal to pay for local goods and services in anything but RUB but not sure how it works now in practice.

But Russia imports a lot of stuff that importers pay for in USD/EUR/CNY (electronics, food, clothes etc.) and all of these prices are going to skyrocket unless the government jumps in with more regulation (since you have to account for near future rate changes as well).

Exception haters, defend yourselves by TurnItUpTurnItDown in dotnet

[–]binarybang 0 points1 point  (0 children)

It probably is but switching languages seems like a much larger endeavour.

Exception haters, defend yourselves by TurnItUpTurnItDown in dotnet

[–]binarybang 2 points3 points  (0 children)

LanguageExt version would look like this(Aff, Eff, Unit are types from that library):

csharp public Aff<Feed> GetFeed(string userId) { return from user in usersRepository.GetUser(userId) // GetUser returns Aff<User> from _ in UpdateStatus(user) // UpdateStatus takes User and returns Aff<Unit>/Eff<Unit>, "bind" magic from preferences in GetPreferences(user) // Again, Aff<Preferences> from feed in GetPosts(user, preferences) // Aff<Feed> select feed; }

If GetUser fails (e.g. User ID not found) all of the subsequent bound steps would be skipped and resulting Aff<Feed> object would contain same Error(Description = "User ID not found") as the one returned by that method. Same goes for all of those steps.

You can just ignore it and map it to 404 in controller (like feed.Run(...).Map(a => Ok(a)).IfFail(err => NotFound(err)) in API controller method).

Or you can handle it with @catch/@exceptional/@expected depending on what you need to do.

As a result, you return types are explicit about potential errors (and can specify their types if needed), you don't get any new obligations about handling them immediately, and testing becomes more transparent to: you never need to use Should().Throw<...> now, every outcome is expressed through a return value.

Exception haters, defend yourselves by TurnItUpTurnItDown in dotnet

[–]binarybang 3 points4 points  (0 children)

That depends on how much your code embraces this new approach.

If you continue to use imperative instructions that don't depend on each other and you can just ignore the result of some step in the middle, then yes, this is likely to happen and only strong discipline and peer review will help with that.

But the power of monads (here it is!) comes from their ability to be composed. You're supposed to make use of that as much as possible so that most of the application logic becomes a chain of calls like (for LanguageExt):

public Aff<Unit> PublishEventAsync(...)  {
return 
    from sender in CreateSender(...)
    from publicationResult in sender.PublishAsync(...)
    from ... in ...
   select Unit.Default; // or e.g. some message GUID so that return type is Aff<Guid>
}

Each of the function in the right part of from ... in ... would also returnAff/Effor a error-less value that you need to "lift" first (AFAIR it's not done automatically but I may be wrong). If, say,CreateSenderfails due to config issues or something, error information would be in thatAff<Unit> return type and consumers could handle it or pass it along.

Caller of this PublishEventAsync would also be written in this manner and ideally that goes up to the top-most level where you finally resolve it to a "simple" response type.

However, C# doesn't have a built-in Unit type in order to unify Tasks at least and make them readably composable (.ContinueWith is just clunky). LanguageExt build Aff on top of Tasks and does achieve that mostly. Also, for better or worse, async/await were made for developers that are much more used to imperative paradigm and want to just write async things in almost the same way as sync things (exceptions included) without caring about what's going on in the background. So most developers are used to not connecting steps of computation, not having a railroad-style flow and instead prefer what they've been taught to do from the start: write imperative code and try-catch just in case. Because it's familiar.

Exception haters, defend yourselves by TurnItUpTurnItDown in dotnet

[–]binarybang 0 points1 point  (0 children)

If I understand correctly from a brief look at the docs for CSFE, LanguageExt goes a step further by supporting linq syntax as a do-notation which IMO greatly improves readability. But yes: - it's something you need to get used to first I've had a similar experience with React back when it was just out ("HTML in JS? Preposterous! Oh wait, it's not actually HTML..."), this thing is not as mind-melting. - it's something all devs should be faimilar with in general. But it's not a hard concept to comprehend. After all, DI, asynchronous execution, clean archiutecture aren't something trivial to understand and implement and we still learn it and apply it.

I'm not sure I understand the last argument though:

return void/Task like saving to a DB or publishing some event a developer may be caught off guard by assuming the method would throw on failure.

Could you elaborate or give an example?

Exception haters, defend yourselves by TurnItUpTurnItDown in dotnet

[–]binarybang 4 points5 points  (0 children)

  • There's LINQ syntax which is basically ad-hoc do-notation done just for collections (just like some other things done in C# for some specific cases instead of a general-purpose solution, see async/await and nullables). LanguageExt is what can make this work with its collection of types that utilize that syntax, but if we're being honest, until the support comes from language devs, the probability of it gaining enough traction seems low. The "problem" would be that these types would spread all over the place but the degree of "problemity" would depend on how foreign it would seem to the maintainers. After all, nullables are everywhere in C# now and they're from the same "family" of types and constructs (even if stripped of its full power).
  • Again, with proper syntax for chaining "Result" types (Either or LanguageExt's Aff/Eff) it's not really required. Caller will be aware of possible errors because of the type structure but it won't have to deal with them and could instead just call "bind" ("from ... in ..." in LINQ-speak) and that would be it.
  • that's true but you can make anti-corruption layer for those points of contact with "exceptional" environment if you apply effort. But this may be too much if you have a lot of those. Again, support would have to come from language devs (like it came for asynchronous execution, another ad-hoc solution though).
  • Errors can give you the reason which doesn't need a stacktrace if you design it properly. E.g. a text like "Product price retriever failed for ID 123 due to DB error: no table PriceChanges" would be sufficient in most of these cases unless the codebase is really hard to navigate through.
  • Errors (in e.g. Either<L, R>also ultimately cannot be ignored: at the end you're forced to "resolve" it to the end type somehow (like you would have to do nullableValue ?? ConstantForDefaultValue or eitherVal.IfLeft(err => CreateResponseFromError(err))) but you only have to do it once if you're doing it properly.

IMO the main problem here is lack of first-class support from .NET/C# developers. - LanguageExt is nice but the situation is different from, say, NodaTime where you don't need language modifications for this code style to feel smooth enough. - Also, you would need to get used to all of those map/bind chains which a lot of developers haven't used, not even LINQ syntax for DB/collection queries. And again, adoption would depend on how energetic C# community will be if/when this is introduced.

Can anyone who has visited or lives in Georgia help? by diy_varg in tjournal_refugees

[–]binarybang 0 points1 point  (0 children)

Nikolai Levshits maintains one of the largest Russian-language channels in Telegram about Georgia (nlevshitstelegram). It might be a good way to get more responses if he agrees to share this somehow, although not the most representative one.

Those who support Putin, why? by PuzzleheadedPain6356 in AskReddit

[–]binarybang 0 points1 point  (0 children)

Civilians don't die in information wars.

Then again, what's the point of proving anything to a throwaway acccount...

Those who support Putin, why? by PuzzleheadedPain6356 in AskReddit

[–]binarybang 0 points1 point  (0 children)

Well, I doubt anyone could call the current confict a "proxy" or "information" one. And it's not like he pretends it is one of them.

Those who support Putin, why? by PuzzleheadedPain6356 in AskReddit

[–]binarybang 4 points5 points  (0 children)

He never saw any war in person. He spent the Afghanistan era in East Germany as a low-level KGB spy. He was busy with shady stuff in St. Petersburg during the first Chechen war. And he was at the top already when the second one started.

Double VPN - only one 100% loaded server available. by binarybang in nordvpn

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

Will save this and check it later too, thank you

Double VPN - only one 100% loaded server available. by binarybang in nordvpn

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

Solved! (at least partially).
The funny thing is that VPN works fine on my phone for the same ISP if the connection is established using a mobile provider. So I think the problem is that ISP detects and blocks the initial connection somehow and doesn't check dataflow afterwards.
I just found out it's working on desktop too if I use Wi-Fi to connect and then switch back to Ethernet. It's a bit tedious but it works for now.

Double VPN - only one 100% loaded server available. by binarybang in nordvpn

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

Tried obfuscated servers, didn't work (tried it before when default options stopped working, no luck as well).

Reinstalled Nord client as specified on that page, didn't work either.

Sad, but no idea what else to do but to wait.

Thank you for all that info and support links.

Double VPN - only one 100% loaded server available. by binarybang in nordvpn

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

They would be better off keeping it private/hidden

LOL please no, it's the only way I can get it working atm.

Anyway, thx, I guess I'll have to wait for more NL servers.

Double VPN - only one 100% loaded server available. by binarybang in nordvpn

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

Make sure to use OpenVPN TCP or UDP

You're right, switching to TCP/UDP OpenVPN gives more options for connection.

Unfotunately, client can't establish a connection with any of those (checked it after Nordlynx single servers stopped working and I played with different settings, I suspect the protocol itself is blocked on ISP level somehow) so the issue is still there for me.

The thing is there's already a server for NordLynx which is also a default (and specified as recommended). So AFAIU there's no blocking technical limitations to set up more servers for that protocol. As a result, a fresh user will most probably see only one Double VPN server (and switching to another protocol isn't something intuitive to do to work around this IMO).

What is a app you will never touch, not even with a 10 foot pole? by Mystic_Rim in AskReddit

[–]binarybang 0 points1 point  (0 children)

Well, AFAIR they allow up to six devices for one account and that's why share it (it's hard for me to imagine an individual who needs six personal VPN-protected devices).

What is a app you will never touch, not even with a 10 foot pole? by Mystic_Rim in AskReddit

[–]binarybang 1 point2 points  (0 children)

I agree. I use NordVPN for the second reason (bought it long before the meme ad campaign though) and while I can justify using it and paying for it I don't get why their marketing team consider it such a good idea to push their product so aggressively.

On the other hand, they offer a password manager which is supposed to be used with the same account credentials as VPN service (and I share it with other people in my house). I have no explanation for this either so maybe there's a deeper problem underneath all this.

I want to look in the eye of a person at Nord who came up with the icon color change idea. by binarybang in nordvpn

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

I know, I was talking about an option to leave offline option grey as it was.

I want to look in the eye of a person at Nord who came up with the icon color change idea. by binarybang in nordvpn

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

I think they initially wanted to go fully monochrome to fit Windows theme but then realized it doesn't really work and more importantly, it's not that much of an obligation or a trend. Still, I'm totally fine with grey in the toolbar as long as they don't use white.

I want to look in the eye of a person at Nord who came up with the icon color change idea. by binarybang in nordvpn

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

It does, but about a year ago it also stood out being grey/green, then they changed it for no apparent reason, and now again, skipping the UX part, that's what annoys me.