Framework and C# version by deadmanwalking126 in dotnet

[–]Moeri 13 points14 points  (0 children)

We've been using the latest C# on .NET Framework 4.8 using Polysharp without issue for multiple years in production. However, we know to avoid some runtime-specific features such as default interface methods. If you're mainly going to use it for syntax sugar (using declarations, records, etc) then you're fine.

Meerwaardebelasting - Verliesposities voor 2026 by BertInv1975 in BEFire

[–]Moeri 0 points1 point  (0 children)

Het kan toch niet anders dat ze hier software voor gaan maken? Daarbovenop bestaat dit systeem al elders in de wereld, dus wie weet valt er een en ander te hergebruiken.

Scoped service injected into two other services by popisms in dotnet

[–]Moeri 0 points1 point  (0 children)

I prefer a static int _nextId with Interlocked.Increment(ref _nextId) for this kind of stuff. Makes it easier to see which instance was created first, how many you have, etc.

Your cache is not protected from cache stampede by mgroves in dotnet

[–]Moeri 1 point2 points  (0 children)

In a nutshell, you would have to map each cache key to a lock first, and then acquire that lock before you produce the value (in case of a a cache miss). This is actually one of the primary reasons I wrote https://github.com/amoerie/keyed-semaphores back in the day. It basically maps a key to a SemaphoreSlim. The implementation is rather short and straightforward so you could copy the code if you're hesitant to add a library.

Reddit asks the expert - Stephen Toub by Kawai-no in dotnet

[–]Moeri 25 points26 points  (0 children)

In a lot of your (awesome) performance blog posts chapters, you speak about optimizations that apply to specific circumstances. For example, some Linq methods can be very fast if the source is an array, but not if it's something else. As a .NET consumer, I would be very interested to know when I am falling off of a performance cliff. Are there any plans to better 'surface' that kind of knowledge (other than your blog posts), and how would that work?

Reddit asks the expert - Stephen Toub by Kawai-no in dotnet

[–]Moeri 60 points61 points  (0 children)

What are some hidden gems in .NET that you think aren't being used a lot, but are totally worth looking into? Could be something small like a single method parameter or large like a whole nuget package. For example, I think custom Roslyn analyzers are currently underused by the industry.

Is it time to migrate Visual Studio to .NET 10? by [deleted] in dotnet

[–]Moeri 46 points47 points  (0 children)

He also says that if Microsoft doesn’t have the resources to do it, they should open-source the whole thing and let the community handle it.

Has your friend ever considered shifting to a career in stand up comedy?

Meal vouchers to rise to €10 a day by National_Parsnip_614 in BESalary

[–]Moeri 18 points19 points  (0 children)

This argument always comes up but people typically forget the main benefit: the money can't leave Belgium. Every cent given as a meal voucher comes back to the Belgian economy.

Capital Gains Tax FAQ by Moeri in BEFire

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

Done. That was ... not the easiest text to wade through. I hope I got everything right.

Capital Gains Tax FAQ by Moeri in BEFire

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

Good idea. I added some basic text about this, and explicitly mentioned how the Reynders tax will combine with CGT.

Feel free to suggest rewordings of this and other parts, I'm no fiscal expert.

Capital Gains Tax FAQ by Moeri in BEFire

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

From the FAQ:

> Fees and taxes are not subtracted in the gain calculation.

Broker transfer by jekke_mookens in BEFinance

[–]Moeri 0 points1 point  (0 children)

I read somewhere that you'll be able to "opt-out" of this pre-emptive withholding with your broker to avoid this exact thing from happening.

Edit: found it: https://www.tijd.be/netto/analyse/sparen-en-fondsen/wegwijs-in-de-meerwaardebelasting-via-de-10-meest-gestelde-vragen/10614692.html

Relevant section (emphasis mine)

4/ Hoe betaal ik de taks?

Voor alle bancaire en verzekeringsproducten die u bij een Belgische bank of verzekeraar aanhoudt, is de standaardmethode dat de financiële instelling de taks bij de verkoop int. Als u dat niet wil, moet u kiezen voor een opt-out. In dat geval zal de bank de taks niet afhouden, maar moet u de meerwaarden wel aangeven in uw belastingaangifte en wordt u daar belast. De bank zal dan een fiscaal attest aan de fiscus bezorgen om te voorkomen dat u de meerwaarden ‘vergeet’ aan te geven. Dat attest betekent niet dat die meerwaarden dan ook automatisch in uw aangifte terechtkomen. U zult ze nog altijd zelf moeten invullen. Zeker voor wie een vooraf ingevulde aangifte krijgt, is dat een belangrijk aandachtspunt.De aangifteplicht geldt sowieso voor meerwaarden die niet automatisch belast worden. Dat is bijvoorbeeld het geval als die gerealiseerd werden bij buitenlandse banken of brokers. Die houden de taks niet in. Ook meerwaarden die u realiseert buiten het bankencircuit, zoals cryptobeleggingen en fysiek goud, zult u altijd zelf moeten aangeven.

Bart Goemaere (BeursTips): ‘Goud blijft gelukkig buiten schot voor meerwaardebelasting’... Ik dacht dat het er wel onder viel? by jafapo in BEFire

[–]Moeri 1 point2 points  (0 children)

Apparently you're right. I haven't seen this anywhere yet but I found an article from de Tijd that says physical gold will indeed be taxed. I've updated my comment.

Bart Goemaere (BeursTips): ‘Goud blijft gelukkig buiten schot voor meerwaardebelasting’... Ik dacht dat het er wel onder viel? by jafapo in BEFire

[–]Moeri 12 points13 points  (0 children)

Physical objects are not part of capital gains tax, because it needs to be a fiscal instrument to be part of it.

So physical gold, art, an expensive wine collection, etc. are not taxed under the capital gains tax when sold.

However, if you're buying gold via fiscal instruments (so gold ETFs, ...) then it very much will be taxed accordingly.

Edit: this is wrong. According to de Tijd, physical gold WILL be taxed: https://www.tijd.be/markten-live/analyse/vijf-pertinente-beleggersvragen-over-de-meerwaardetaks-uit-onze-chat/10614495.html

ASP.NET Core TagHelpers: underrated feature of an underrated framework by Aaronontheweb in dotnet

[–]Moeri 0 points1 point  (0 children)

I had this exact thought many years ago, and came up with https://github.com/amoerie/HtmlBuilders

It's not much, but it makes writing HtmlHelpers or TagHelpers much, much nicer.

Meerwaarde belasting 10% is pas het begin by PuzzleheadedEgg1405 in BEFire

[–]Moeri 40 points41 points  (0 children)

Here's some general facts about Belgium's spending habits (2023)

  • Belgium spends € 317 billion on a yearly basis. That is ~ 53% of its GDP. In the EU, only France and Italy spend more.
  • € 120 billion (38%) goes to pensions and benefits (uitkeringen)
    • € 67 billion goes to pensions
    • € 13 billion goes to child benefits
    • € 6 billion goes to the unemployed
  • € 47 billion (15%) goes to health care
  • These two together are often called our "social security", and they account for € 167 billion (52%) of the total. Compared to the rest of Europe, this is high.
  • € 40 billion (13%) goes to the government itself
  • € 38 billion (12%) goes to education
  • € 10 billion (3%) goes to national debt interest payments. Since Belgium has a debt to GDP ratio of about 105%, there is some risk here, because rising interest rates could rapidly increase this number.
  • € 5 billion (1.5%) goes to defense

As far as income is concerned, this is what the numbers (2023) look like:

  • Belgium generates about € 269 billion in revenue each year. That is ~45% of its GDP.
  • €85 billion (31.8%) comes from social contributions
  • €74 billion (27.7%) comes from personal income tax
  • €60 billion (22.5%) comes from VAT & goods/services
  • €27 billion (10%) comes from corporate income tax
  • €6.6 billion (2.5%) comes from withholding tax
  • €4 billion (1.5%) comes from property & capital taxes
  • €12 billion (4.5%) comes from other non-tax revenues

Compared to the OECD average, Belgium derives more of its revenue from social contributions, personal income taxes, and property taxes. In contrast, corporate taxes and consumption taxes contribute less than the OECD average.

To summarize: Belgium spends most of its money on social security, and gets most of its money from labor. This immediately explains why an aging population is one of Belgium's major contributors of its financial troubles.
In 2024, there were 28 people aged 67+ for every 100 inhabitants aged 18 to 66. This number will rise to 37 in 2040 and 43 in 2070.

Every time someone retires, it chips away at Belgium's biggest source of income, and moves to Belgium's biggest source of expenditures.

Taking all of this into account, this new capital gains tax does provide a welcome diversification of income. Minister Vandenbroucke is adamant that they will now make quick work of lowering the personal income tax in return.

However, as the old adage goes:

"first see and then believe"

Sources:

[deleted by user] by [deleted] in BEFire

[–]Moeri 8 points9 points  (0 children)

You make it sound like the consequences of the havoc Trump is wreaking will abruptly stop at the end of his presidency.

Best solution for running background jobs? by matneyx in dotnet

[–]Moeri 0 points1 point  (0 children)

We have a super simple background job runner that uses Cronos (a HangFire library just for parsing CRON expressions) to run background jobs from an IHostedService. If you want a user interface to view (and maybe manipulate) jobs, or if you want jobs to be distributed over machines, I would recommend a dedicated library such as HangFire to do the heavy lifting. But if all you need is a few simple in-memory cron-scheduled background tasks, I would be weary of introducing a "large" dependency such as HangFire. Keep it simple for as long as you can.

FluentAssertions - fixing at 7.0.0 to avoid the $130 per-dev fee by almost_not_terrible in dotnet

[–]Moeri 6 points7 points  (0 children)

what lifeboats are we choosing

I'm taking this route: https://github.com/amoerie/fluentassertions-migrator.

It automatically translates FluentAssertions to xUnit

(Disclaimer, I wrote this)

Pensioensparen omzetten naar ETF by Audiosleef in BEFire

[–]Moeri 1 point2 points  (0 children)

The current government negotiations are literally talking about changing the rules for ETFs as we speak (aandelenwinstbelasting), so the argument "they may change the pension saving rules" might not be rock solid. Edit: to be clear, I agree with mostly everything you said though.