5
Answers

DLL creation y not possible??

SUNIL GUTTA

SUNIL GUTTA

12y
1.1k
1
Hi friends

Well coming to pint 

Cant c# developers lets say .net developers cant create libraries like Write & read etc which communicates with hardware if i am not wrong ??

is it right that some C# Pre-defined libraries are not possible to create using our .Net languages so we implement them using other languages c++,c, forton etc and re-implement here. 

I am deeply hurted the thing why cant we create a libraries which can communicate with hardware as our C# or .net lang's is more advanced then c++,c etc ??

If anything wrong in my question please correct me :)

 just please share your valuable view on it , i am dying to know it 

Ty
Answers (5)
1
Vulpes

Vulpes

NA 98.3k 1.5m 12y
C# and other .NET languages can produce dlls but they contain IL (intermediate language), instructions rather than native code.

The CLR (common language runtime) then converts the IL to native code as the program runs, a process known as 'Just in time' compilation.

In contrast C and (unmanaged) C++ produce native code dlls which typically execute faster than .NET dlls. 

Also the Windows operating system itself is programmed in C/C++ (plus some assembler) and kernel mode device drivers, which require special libraries, are nearly always written in C. In fact, it's not possible to write kernel mode programs in C# because the CLR can only run in user mode.

Consequently, applications which access hardware at a low level are usually written in C.

This is no surprise as C# was designed from the start to be a simple, general purpose, high level language which, whilst reasonably efficient, is not as efficient as C or assembler.

The advantage is that most kinds of apps can be developed much more quickly in C#, and are easier to maintain, than corresponding apps written in unmanaged languages. 

However, C# also has excellent facilities for interoperating with unmanaged dlls (via P/Invoke and COM Interop). This enables languages which are better suited to low level coding to do the 'heavy lifting' and the C# programmer to enjoy the results :)

Accepted
1
Vulpes

Vulpes

NA 98.3k 1.5m 12y
No programming language is perfect and they all have strengths and weaknesses which makes them more suitable for programming some types of applications than others.

C# and Java have much shorter development and maintenance times than C or C++.

In contrast, C and C++ have faster execution speeds than C# or Java. However, the latter two are still much faster than dynamic languages such as Javascript, Python or Ruby.

There's not much to choose between C# and Java. Both are 'safe' managed languages with similar execution speeds though C# currently has more features than Java.

To all intents and purpose, C++ is a superset of C and is certainly the most powerful language I've ever used as you can write virtually any type of program with it. However, this power comes at the cost of a very steep learning code and massive complexity.

In contrast C is much simpler (simpler even than C# or Java) as it's not object oriented but still takes a long time to master and can be very error prone. It probably has a slight edge on C++ in execution speed but managing very large projects is not easy.

For the sorts of applications that most programmers write nowadays, I'd say C# or Java offer the best balance of ease of development/maintenance combined with reasonable power and execution speed.

However, for system and games programming, C and C++ are still the kings. 
0
Vulpes

Vulpes

NA 98.3k 1.5m 12y
User mode drivers are usually written in C++/COM but kernel mode drivers are nearly always written in C. 

User mode drivers can also be written in C# but I don't think you'll find many in practice. 

Whilst (unlike C#) it's technically possible to use C++ for kernel mode drivers, there are a number of issues which are explained here:

http://msdn.microsoft.com/en-gb/library/windows/hardware/gg487420.aspx

Although you could restrict yourself to the C subset of C++, it's easier to just use 'straight' C which ensures that no problematic features creep into your code.     

C++ is technically multi-paradigm i.e it supports both object oriented and procedural programming paradigms as well as (in the latest version) some functional aspects as well.

In contrast C# and Java are pure object oriented languages (C# also has some functional aspects), albeit their single inheritance models are much simpler than C++'s multiple inheritance model.

You certainly can program some decent games using C# and Java and, until it was effectively deprecated by Microsoft when Windows 8 came out, the former had its own XNA framework for this purpose which was very popular.

However, as execution speed and real time response are vital in today's 'state of the art' games, most professional games developers prefer to work in C or C++ which are 'closer to the metal' than managed languages.

A 'standard' C++ compiler produces native code for the target platform which enables it to do a large number of optimizations which aren't feasibly for C#'s just in time compiler.

Although C# is certainly a high level language, I tend to think of C++ as middle level since it has facilities for both high level and low level programming tasks.
0
SUNIL GUTTA

SUNIL GUTTA

NA 1.1k 286.3k 12y
well i heard somewhere that drivers are developed using c & c++ . 

My doubt is as c++ is object oriented (lol not fully) & high level language like c# or java . if i am right y can't i design same games,drivers etc in via java or c# . 

As coming to my real doubt everything developed using c++ like drivers will neglect OOP concepts and do it ????
is that right ..!

C++ and c# compilers are different haa ?? as both are high-level ?

TY
0
SUNIL GUTTA

SUNIL GUTTA

NA 1.1k 286.3k 12y
Ty dude for very quick response 

Well can i come to such conclusion very fast like C & assembly are Best next to that c#.net or java etc gives best compared to c++ ?? 

IS .net lang or java is Superior than C++ taking every aspect into context ??

Please share ur view

TY