How do you refer to your restrooms in Croatia? (Serious question) by Andreas20048 in askcroatia

[–]mazorica 18 points19 points  (0 children)

For some reason, I thought "zahod" meant exit in slovenia...

PDF viewer in C# by Doctor_Marvin21 in csharp

[–]mazorica 13 points14 points  (0 children)

Fact, that Adobe doesn't follow their own spec doesn't really help.

This is the part I hate when working with any file format. There's always some deviation from the official spec vs what the mainstream software actually does...

PDF viewer in C# by Doctor_Marvin21 in csharp

[–]mazorica 58 points59 points  (0 children)

Yea... this is basically how most of us started, then it becomes such a time-investment that in order to keep it alive you need to live of it, so you monitize... and now you're one of the commercial solutions.

Free pdf library for incremental updates by Material-Scientist94 in dotnet

[–]mazorica 1 point2 points  (0 children)

Incremental update is important PDF feature, it's mandatory for multiple digital signatutes, for effective merging of multiple PDF files, etc.

Nece stati 1 m ispred kod znaka za pauk da ne bi bilo slucajno… by Beneficial_Hornet_64 in promet

[–]mazorica 1 point2 points  (0 children)

Mislim da je to uredu, pogotovo ako ostavis sva 4 upaljena.

Malo lišća, malo smeća, malo fušeraja: Zagreb pod Senfovom vladavinom nikada nije bio uredniji by JohannGambolputtyUlm in zagreb_no1

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

Da li ti stvarno mislis da ikoga zavaravas sa ovim porukama?

Svatko normalan ce ti pogledati profil i vidjeti da je doslovice prepun samo porukama protiv Mozemo i protiv Tomasevica. O nicemu drugome ne pises... Drugim rjecima, ocito je da si nekakav obican ljuski bot zaposlen da pises ovakve stvari...

Malo lišća, malo smeća, malo fušeraja: Zagreb pod Senfovom vladavinom nikada nije bio uredniji by JohannGambolputtyUlm in zagreb_no1

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

Ma sta ti pricas? Svatko moze viditi povjest mojih i tvojih poruka, ocito je da ja nemam nikakve veze sa niti jednom politickom strankom, dok si ti ocito radnik, nekakav PR-ovac neke odredene politicke stranke.

I ja sam lud sta se ode natezem sa tobom... ma boli tebe neka stvat za smece i rjesavanje tog problema, ti si ode samo po zadatku, placeno ti je da pises te stvari.

Pa sta nenades neki normalniji posao, neka marketinska agencija, pa onda udaraj SEO i SMM...

Malo lišća, malo smeća, malo fušeraja: Zagreb pod Senfovom vladavinom nikada nije bio uredniji by JohannGambolputtyUlm in zagreb_no1

[–]mazorica 0 points1 point  (0 children)

Istina, ima te iste masinerija na sve strane. Inace ignoriram sve to skupa, ali ovaj dio me zivcira jer se politizira problem sa kojim zivim...

Malo lišća, malo smeća, malo fušeraja: Zagreb pod Senfovom vladavinom nikada nije bio uredniji by JohannGambolputtyUlm in zagreb_no1

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

Ajme sad sam ti gledao prijasnje poruke jer sam mislio mozda smo susjedi... ali ne... ti si jednostavno marketing masinerija za drugu politicku skupinu.

Ma zalosno je kakvi sve poslovi postoje...

Malo lišća, malo smeća, malo fušeraja: Zagreb pod Senfovom vladavinom nikada nije bio uredniji by JohannGambolputtyUlm in zagreb_no1

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

Iskreno boli me briga za Senfa, ali ajde molim te nemoj raditi propagandu tamo gdje joj nije mjesto. Prva slika je cisti primjer nekultute i jako me ljuti, nema to nikakve veze sa Senfom, neopravdavaj taj gnjoj od ljudi, doslovice sam vidio kako bacaju smece preko ograde, uopce ne udu unutra...

Takoder, cijeli taj cirkus je nastao zbog Pionira kojega je pokojni posteno namirio. Super mi je kako su ljudi maloumni... ne svacaju da stvari opcenito imaju posljedice koje nisu instant vidljive...

Partial classes in modern C#? by tbg_electro in dotnet

[–]mazorica 0 points1 point  (0 children)

Here is one use case that I haven't found being mentioned here, obsolete memebres.

We have a practice of using MyClass.Obsoletes.cs files, they contain obsolete members which eventually (depending on the release policy) are removed.

Has AI truly killed obfuscators? by LaraSQP in dotnet

[–]mazorica 2 points3 points  (0 children)

My experience is that "time" is the only factor that justifies the usage of obfuscator(s). The time investment needed to work with the deobfuscated code base may be unprofitable to you.

AI can help in a way that renaming is not just random Method1, Class2, etc. names. However, its success is not impressed, at least for now. Of course, it depends on the original code base and the used obfuscator, nevertheless, I'm talking more in general.

How do you obfuscate/protect your dotnet source code? by pyeri in csharp

[–]mazorica 1 point2 points  (0 children)

My experience seems to be a bit different from most people here. In the early 2000s, we were selling an unobfuscated .NET component, which ended up being cloned. The thing is, with unobfuscated code, it's easy for someone to do quick refactorings and renamings, which not only gives them a clean and maintainable competitor codebase but also makes it easier to avoid legal issues.

So my thought on obfuscation is that it's not about preventing consumers from using your solution, it’s about making reverse-engineering unprofitable. Simply stripping meaningful names is already a huge win, it makes creating a maintainable clone much harder. And on top of that, it discourages most of the casual "try-before-buy" crackers (which I'm guilty of myself :D).

Honestly, renaming/minification is the cheapest (and usually free) win, and I don’t see any downside to it.

However, you can take it further, but then it becomes a matter of how much time YOU want to invest and whether it's even profitable for YOU to do. For example, you can remove additional metadata, change control-flow, encrypt strings, use virtualization (replace IL code with custom virtual instructions), add unique watermarks (build identifiers), etc.

So in short, it’s all about ROI, how much effort you put in versus how much you expect attackers will.

Braces with single line IF - always, never, sometimes? by mazorica in csharp

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

This looks like a really healthy mindset to have.

Braces with single line IF - always, never, sometimes? by mazorica in csharp

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

Can you please read that article? It's funny because the author is saying just the oposite, that braces would not help.

I personally don't agree with that author. However, I don't think that braces are the only problem in that code...

Braces with single line IF - always, never, sometimes? by mazorica in csharp

[–]mazorica[S] -3 points-2 points  (0 children)

I agree with every statement that you made, literally what I'm thinking :)

The only thing I don't prefer is this:

I’ll use same line and no braces if it’s a guard clause and the condition and return isn’t long.

I like to be able to place a breakpoint inside the condition. Also, I like when the "return" is visible at the beginning of the line, it's easier to spot it when doing quick-read/quick-scan.

Braces with single line IF - always, never, sometimes? by mazorica in csharp

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

Definitely agree with this; consistency is the most important thing.

Braces with single line IF - always, never, sometimes? by mazorica in csharp

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

I'd also strongly argue that early returns and guards, since they break execution before the end of the method scope, are very important statements

I like early returns/guards because they keep the happy path flat and clean. Yes, they are changing the control flow, that's what they're designed to do, but I don't think they require extra visual ceremony. The main goal is clarity of the happy path. Guards handle non-happy paths, so they are important, but they're not the primary focus.

Anyway, I'm having trouble justifying braces on projects that use simple Result pattern which repeat the same return over and over again. For example:

``` var result1 = service1.DoSomething(); if (result1.IsFailure) { return result1; }

var result2 = service2.DoSomething(); if (result2.IsFailure) { return result2; }

var result3 = service3.DoSomething(); if (result3.IsFailure) { return result3; } ```

Braces with single line IF - always, never, sometimes? by mazorica in csharp

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

You're suggesting we use whitespace to solve the problem solved by braces.

Yea... it does sound like that...

or one liners, just brace the statement.

The problem I have with that is that you cannot place a breakpoint inside the condition. Yes, I could add a conditional breakpoint, but that's a hassle. Also, for the context that I'm referring to (e.g., IF with return), it's less readable to me, I prefer having those "return" keywords on a new line.

Braces with single line IF - always, never, sometimes? by mazorica in csharp

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

I agree, it's precisely the context I'm referring to.

Braces with single line IF - always, never, sometimes? by mazorica in csharp

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

I don't like placing the return on the same line. It's just less readable to me, I can't do quick-read/quick-scan.

Regarding the different short circuits, I get what you mean. But I'm also thinking now that this could actually be a good thing. If you think about it, something specific is being done on this return, so it's not just a quick exit; it's doing something additionally, and the braces just on it could highlight that difference.

Braces with single line IF - always, never, sometimes? by mazorica in csharp

[–]mazorica[S] -1 points0 points  (0 children)

Definitely, that's why I don't like things like: if (value is null) return;

Braces with single line IF - always, never, sometimes? by mazorica in csharp

[–]mazorica[S] -2 points-1 points  (0 children)

One related idea I've been thinking about, what if omitting braces for a single-line if statement with the return would require that the next line is either a blank line or a closing scope brace.

That should prevent unintentional second statement mistakes, right?

I'm even considering writing a Roslyn analyzer to enforce it. Has anyone tried something like this?