C# - Assembly unit

C# defines new translation unit of application composition called assembly unit. Microsoft MSDN website defines assembly unit in following way:

Assemblies form the fundamental unit of deployment, version control, reuse, activation scoping, and security permissions for a .NET-based application. Assemblies take the form of an executable (.exe) file or dynamic link library (.dll) file, and are the building blocks of the .NET Framework. They provide the common language runtime with the information it needs to be aware of type implementations. You can think of an assembly as a collection of types and resources that form a logical unit of functionality and are built to work together.

In short, assembly unit is translation unit having some integral functionality compiled to one .dll or .exe file. In C# solutions assembly unit usually is one C# project or C# library.

Read more »

C# - PascalCasting vs camelCasting

PascalCasting vs camelCasting - types of naming function or variables names.
  •  PascalCasting - naming when we starts with capital letter and each next word start with capital letter. Used for properties, methods, types
  •  camelCasting - naming when we starts with lower case letter and each next word start with capital letter. Used for parameters, fields, variables.
Read more »

C# - XML Documentation Comments

C# allows create create XML-styled comments which are used by Visual Studio to create tooltips with information about function. XML-styled commets starts with /// characters. When you put /// characters above particular function definition Visual Studio will generate you template of XML-styled comments for that function.

See below image as example of XML-styled comments and effect of those comments on toolkit.


Read more »

C# - basic definitions

Today I will present few basic definitions related to C# and .NET Framework environment. If you will develop some code in C# and .NET you will definitely meet those definitions.

Common Language Runtime (CLR) - it is virtual machine component used in .NET Framework (similar to JVM). It is responsible for managing and execution of .NET programs. Its main task is converting Intermediate Language code to native platform code. C# compiler create IL code, but such code cannot be run in OS environment (ex. in Windows Environment). It has to be translated to native platform code. CLR does such translation. It also has additional functionality like: memory management (including garbage collection), error handling, thread management.

Intermediate Language (IL) - this is binary code which is created by C# compiler (or any other .NET language compiler). This code cannot be directly executed in OS environment. It does not contain platform CPU instruction. IL has to be translated to CPU instruction using CLR in order to run application on particular CPU

Managed code - code which is compiled to IL and run (managed) using CLR virtual machine.

Just-In-Time (JIT) compilation - type of code translation which is being done during program running. In .NET, JIT compilation is done by CLR which translate (JIT compile) Intermediate Language (IL) to set of CPU instruction. In general, JIT improve performance of running application.

Call stack - stack of last called functions. Ex. we have following nesting functions
test1(){
test2();
}
then call stack is test2, test1
Read more »

C# basics - Difference between float, double and decimal

decimal values has better precision and should be used for financial operation but work slower than double, so double values should be used when performance is priority.
In general, c# floating points have following precisions:

  • float - 7 digits
  • double - 15-16 digits
  • decimal - 28-29 digits


See below example:
Output of that example is as follows:
As you can see output output of conditions for float and double values is True. It is because float has 7 digits precision and our float1 value is equal 1 in relation to 7 digits of precision. The same situation is for double value in terms of 15 digits precision.
Read more »

Welcome C# and .NET lovers

Welcome all C# and .NET framework lovers. I am starting this blog to share my C# adventure with you. I will try to explain here usage of some C# features as well as I will describe my experience with working as C# developer. I hope you will find a lot of useful informations here. All comments are welcome.
Let's start our common C# adventure. Hello world :) 

Read more »
Powered by Blogger.

Sample Text

Sample Text

Sample text

Sample Text

Social Icons

Social Icons

Followers

Featured Posts