Menu

Skip to content
  • Home
  • About
  • Color Coder
Hamid Mosalla
Twitter Email LinkedIn GitHub Stack Overflow RSS

Hamid Mosalla

Programming Adventures

.Net

.NET is a large collection of a bunch of different things really; including compilers, runtimes, programming languages and a bunch of different tools and technologies.

It provides a lot of common functionality that can be tapped into rather than recreating it from scratch.

C# is one language that can be used on .NET. It get compiled initially by Roslyn and can get additional compilation at runtime by RyuJIT. Other languages include F#, which can all be compiled and run against its runtimes.

This works because it’s generally not compiled to a particularly low level language but rather to an Intermediate Language that can be executed by a .NET runtime. The runtime then does the appropriate translations to actual system/hardware calls allowing you to not have to worry about it.

When you create at least C# projects, you have to specify what runtime you’re targeting so that it can be compiled appropriately to work; not just whether it’s Framework or Core, but also the version number since functionality of the same thing may be different.

One of the goals with .NET 5+ is to reduce the confusion by bringing many of the parts together under one umbrella, but it’s going to be a while before that replaced enough existing software to really get rid of the confusion (especially since .NET 5 isn’t going to have Long Term Support).

February 17, 2019 by Hamid Mosalla on .Net, C#, Unit Test

Moq: What’s Wrong With Using VerifyAll

There are some features in the isolation framework (Mocking framework) Moq which I see is used blindly. Most of the time it can which reduce test readability and maintainability. One of the worst offender in this regards is VerifyAll. In this post I’m going to elaborate why this method is so pernicious to readability and … →

 
November 25, 2018 by Hamid Mosalla on .Net, C#, Design Pattern

Stop Using Repository Pattern With an ORM

There a tendency in software developers to want to follow a specific formula. Whether it is adhering to a methodology like agile or using a specific design pattern. This happens so often that we have a specific term for it in our field called Cargo cult programming. In these situation a programmer don’t ask themselves … →

 
September 18, 2018 by Hamid Mosalla on .Net, Asynchronous And Parallel Programming, C#

TPL Dataflow Blocks: Post vs SendAsync

I was reading an excellent series of articles about TPL Dataflow from Jack Vanlightly the other day. He draw my attention to the difference between Post and SendAsync when we want to post something to a block. I wasn’t thinking about it much at the time. But as I progressed through my readings, I saw … →

 
August 30, 2018 by Hamid Mosalla on .Net, C#, Unit Test

xUnit BeforeAfterTestAttribute: How to Run Code Before And After Test

Sometimes we need to run a piece of custom code before and after a test and set of tests. One example of this might be when we want to change the thread culture. In this case we change it before test start to run and restore it to its original after test is finished. One … →

 
August 24, 2018 by Hamid Mosalla on .Net, Asynchronous And Parallel Programming, C#

More Robust Asynchrony and Parallelism With TPL Dataflow ActionBlock

.In my previous post, I explained what TPL Dataflow is and when we should and shouldn’t use it. But I haven’t got into much detail about how it can help us solve real world scenarios. Since my last post, thanks to a comment on my previous post, I went though different Stackoverflow questions. I saw … →

 
August 16, 2018 by Hamid Mosalla on .Net, C#, Unit Test

xUnit: Control the Test Execution Order

Sometime in our tests, we need to control the test execution order. This mostly happens in our integration test and not as often as our unit tests. Some people might even argue that controlling the execution order of unit test is bad practice. You can read more about it here. The main reason to not … →

 
August 4, 2018 by Hamid Mosalla on .Net, Asynchronous And Parallel Programming, C#

What is TPL Dataflow in .Net and When Should We Use It

There are various ways to write a concurrent or parallel program in .Net but they’re often don’t have the flexibility and robustness needed. That’s where TPL Dataflow comes in, it helps us build a more robust concurrent program and it can helps us reduce a lot of complexity. For example when we use other paradigms … →

 
July 31, 2018 by Hamid Mosalla on .Net, C#, Unit Test

xUnit: Share an SUT Instance Between Two Class Using Collection

In my previous post I talked about how we can Share Expensive Object Between Tests By Using IClassFixture. My previous post is about situations when we want to share a class instance between all test methods. Because a test class is created once per test method so its constructor is executed per test methods. But … →

 
July 21, 2018 by Hamid Mosalla on .Net, C#, Unit Test

Share Expensive Object Between Tests By IClassFixture

When XUnit run a test method, it’s going to create a new object of our test class for each and everyone of our test method. This can create a problem when the creation of the object is expensive and slow our tests down. But there’s a solution to it, we can use IClassFixture to share … →

 
July 17, 2018 by Hamid Mosalla on .Net, Asynchronous And Parallel Programming, C#

Asynchronous Programming Series

Recently I wrote a series of posts regarding asynchronous programming. You can find the links to this series down below. In these series of posts I started from the definition of concurrency and how it’s different with parallelism. Then I moved on deeper into the subject by each post. My 10th post in this series … →

 
Older Posts →
Page 3 of 6
← Newer Posts

Archives

Categories

 
Subscribe!
Copyright © 2022 Hamid Mosalla
Casper Theme By Lacy Morrow