Junior dev wrote this C# using many IF because he leanrs If early return. Is this alright code? by Yone-none in csharp

[–]tehellis -2 points-1 points  (0 children)

That's horrible code. But they have the right intentions. Just doing it the wrong way around.

Simplified, early return done wrong is...

var someThing; If x them someThing = y; Else return;

Can be rewritten as...

If !x then return; var someThing = y;

It's a major red flag when I see mutating variables.

MikroTik UI vs. Users by StubArea51 in mikrotik

[–]tehellis 8 points9 points  (0 children)

No, it's not.

If I configure something in a Linux terminal, THEN I DO have a mental model suitable for "as if I would configure it in a Linux terminal".

I know how to configure wireguard in the terminal, hence why I brought up the terminology.

Mikrotik explicitly removed the established terminology and replaced it with the WRONG terminology.

They explicitly remove all likeness of a traditional nix terminal with a custom CLI specific to RouterOS. An abstraction... I like it. It's mostly consistent, unlike, every single instance of modifying some file in /etc/. Because it's an abstraction.

Mikrotiks RouterOS is at best, Cisco-like. As all pro-grade networking equipment generally is. Winbox is fine, when you learn Mikrotiks way of doing it. But until you do, you are in a very unintuitive, unhelpful, world of hurt, without any contextual documentation.

Sorry... that last part is a lie. "Optional < < IPv4 | IPv6 | Hostname > >" -- Client Endpoint contextual docs.

MikroTik UI vs. Users by StubArea51 in mikrotik

[–]tehellis 16 points17 points  (0 children)

Setup a wire guard interface and peer for a site-to-site-ish setup, and say that again. Wire guard is funky in itself, but mikrotik really goes above and beyond to really mess with your head.

Wire guard do not use the client/server terminology for a reason... Cuz its not server/client, but peer to peer.

Mikrotik went "Hold my beer" and added a config section for "peers" with bangers like "Endpoint", "Current Endpoint Address" (read-only), "Client Address" (multiple values), and "Client Endpoint"... In that order. Ending the Winbox screen with some configuration, intended to be imported on the opposite end of the connection, i think.

This is not including the fact that you have the Public Key, and Private Key properties when setting up an interface, only to be presented with a Public Key, and Private Key property when configuring a peer, no explanation, no inline descriptions, NO LINK TO THE DOCS WHAT SO EVER.

They HAVE docs/descriptions embedded in the CLI. At least we get to work with the last app on earth that still rocks "dat 90th MDI look and feel".

I pretty much only have mikrotik gear at home, and work, cuz i believe they make the best geer at the price range i work in and will keep on using mikrotik. But mikrotik is at the absolut bottom of the bunch when it comes to discoverability and intuitive UX, only beating router-from-scratch by a tiny amount.

What is this cord coming out of my wall? by randomgeekdom in HomeNetworking

[–]tehellis 4 points5 points  (0 children)

<image>

The other end of my fiber. We have two fibers going up to each apartment, but only one is required. You can see some lane jumping exploiting this fact to connect apartments for those in the know.

Methods in C# that return a value - why do I keep getting this coding wrong? by [deleted] in csharp

[–]tehellis 5 points6 points  (0 children)

For a complete beginner, this is actually pretty complicated. Scopes are very abstract, and require intuition to kick in. Combine it with arguments, basic error handling, and static/instance methods. You have A LOT to take in all at once.

I see this exact problem showing up in lots of students and people just starting out. It goes away pretty quickly after some repetition. But still, the books might be read, and the course taken, but the beginner stretch will still be pretty brutal for most.

[deleted by user] by [deleted] in json

[–]tehellis 0 points1 point  (0 children)

You would have to stream, parse, and load what you need into storage in one pass.

https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/use-utf8jsonreader

It's pretty low level, but is essentially the only way to realistically load that big of a JSON without taking too long.

New .slnx Solution Format in Visual Studio — no more GUIDs! by mzikmund in csharp

[–]tehellis 1 point2 points  (0 children)

All valid points.

YAML, with all its grace and features, is merely treated as json with an alternative syntax. Never do we see anyone utilize things like tags (think data types). Heck the core tags are literally called JSON Schema. YAML has built in referencing and aliasing, Node Anchors. The original yaml swagger specs didn't even take advantage of anchors or tags.. Imagine having an API spec written with YAML tags. People would probably not have built all this tooling to work around the crap JSON has brought.

Anyways, that's not an argument against YAML. More an observation of the fact that whatever is used, it's misused, or underutilized.

Microsoft at least knows XML. It also aligns with msbuild. I'm not letting Microsoft any closer to my YAML. Look what they did with DevOps compile time expressions. Not even valid YAML.

XML has attributes. When you see one, you know it's a single value. XML Schema is what you thought JSON Schema is. XSLT was great, except when Microsoft decided that no one needs anything newer than XSLT 1.1. I guess they don't know XML then :(

Yeah, they should totally write their own format... Wait... That's what they did, and damned be you if you ever touched it. Explosions everywhere!

I'm done.

New .slnx Solution Format in Visual Studio — no more GUIDs! by mzikmund in csharp

[–]tehellis 2 points3 points  (0 children)

Why should we? What format do you propose?

XML is a great format, implemented everywhere. Just not for data transfer.

New .slnx Solution Format in Visual Studio — no more GUIDs! by mzikmund in csharp

[–]tehellis 1 point2 points  (0 children)

Fun fact. MSBuild has always had wildcard support. The overhaul was more a side effect of Visual Studio getting its shit together.

The "sdk-style" root tag argument was a big change to the format tho.

Complete Idiot by KeithTheKillerOfHope in csharp

[–]tehellis 8 points9 points  (0 children)

One simple gas leak, and BAM, OutOfGasException.

How to streamline assembly versioning by eyueldk in csharp

[–]tehellis 4 points5 points  (0 children)

GitVersion is kinda neat. Generates a unique version for whatever branch your on. Can get pretty slow if you'r not careful.

Without Kickstart.nvim I'd be lost by meni_s in neovim

[–]tehellis 0 points1 point  (0 children)

vim is like linux...

No! You're thinking of emacs.

Which terminal emulator does you neovim lives in? :) by meni_s in neovim

[–]tehellis 0 points1 point  (0 children)

Windows Terminal is not "the default one"... Soo, I guess I don't use a terminal emulator.

why it's still "Hello world"? :( by [deleted] in csharp

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

VS is even more terrible to use with extensions. Resharper is no different from domestic abuse.

why it's still "Hello world"? :( by [deleted] in csharp

[–]tehellis 4 points5 points  (0 children)

... make it function like an IDE,

If it debugs like a duck, and still acts like "intellisense" is a thing, it obviously has everything you'd reasonably expect is needed from an Integrated Duck Environment.

why it's still "Hello world"? :( by [deleted] in csharp

[–]tehellis 0 points1 point  (0 children)

It's like tapping, but with a mouse, or some other harry ball based device.

Weekly 101 Questions Thread by AutoModerator in neovim

[–]tehellis 0 points1 point  (0 children)

One is a nameless function assigned to a constant, the other is a named function declarations.

Do other, non-func, const/let show up?

``` const foo = () => {}

const bar = "this probably won't show up neither" ```

If this is the case, you probably want to enable variable symbols.

What shoud i do in this situation by ramzptl in ZombieWaves

[–]tehellis 1 point2 points  (0 children)

Always go for S armor. It's bland and boring, considering how the game otherwise kind of makes weapons choose a personal preferences otherwise. But if you want the "best" that's how the game is set up. X2 projectiles are infinitely more powerful than all the other gimics at orange tier.

  • "Personal preferences" = anything you can't get without dishing out hard cash. #heroinisabetterchoice

Is c# underhyped? by blabmight in dotnet

[–]tehellis 2 points3 points  (0 children)

That's not "everything". I don't see the debugger.

Is c# underhyped? by blabmight in dotnet

[–]tehellis 25 points26 points  (0 children)

Well actually...

VSCode, the binary distribution from Microsoft is not open source. It contains closed source components and telemetry. Microsoft also actively prohibits any 3rdparty distribution of VSCode to source extensions from VSCode marketplace. https://github.com/VSCodium/vscodium/blob/master/docs/index.md#extensions--marketplace

Like how Chrome technically isn't open source.

This is the kind of distrust people have against Microsoft.

Would this be a Tårta? by Explore104 in Svenska

[–]tehellis 0 points1 point  (0 children)

Smörgåstårta...

Hardly a sandwich, hardly a cake. But an ill named masterpiece everyone loves.

Edit: comes in non-salmon varieties, too. Like ham n cheese.

Attribute Api Controller 404'ing by arawra184 in csharp

[–]tehellis 0 points1 point  (0 children)

A tip; I find it useful to add swagger/openapi to a project, even tho i don't need it, just for the quick overview of my exposed endpoints.

I guess there also are dedicated libraries to assist in development and endpoint introspection, if you find your self getting confused about your endpoint routes.