Tag Archives: .NET

C++ unsafe and unsecure ?

My colleagues in the Microsoft world and others tell me that C ++ is outdated, too difficult, too old, too hard to master and there are even some who tell me that it is unsafe and unsecure!

I laugh.

If C ++ had all of these flaws, Microsoft wouldn’t make 95% of these products with it. I’m going to come back to unsafe and unsecure because it’s very interesting. But before a reminder: EVERYTHING YOU HAVE ON YOUR PC AND MAC IS DONE IN C ++. Windows, Office (Word, Excel, PowerPoint, Outlook), IE, Chrome, VLC, Notepad ++, Calc, MSPaint, Photoshop, File Explorer, Process Explorer, etc…

To sell .NET Marketing has tried to discredit C ++ because it is too rich, too powerful and does not need advertising or marketing. In the 2000s, marketing tried to sell the idea that a language that manipulates memory finely is likely to crash and that the panacea was the Garbage Collector. This reasoning is an intellectual scam.

Just because a language like C or C ++ allows you to manipulate memory finely to the byte does not mean that it crashes or corrupt memory. Marketing, which is a contingent of people coming out of business schools, knows nothing about the technique and therefore these people are making crude short cuts. It must be said.

For those who are curious, the NET or CLR (Common Language Runtime) virtual machine is made in C ++ so here, the loop is complete. If C ++ was that bad, CLR would not be done in C ++. The garbage collector and the JIT either! The problem is that NET has to fight against an opponent that was there before it, namely Java and that the competition is raging. Java is much more established in companies than NET and that in spite of billions invested in marketing and publicity.

So I ask the question: was trying to discredit C ++ a good way to sell NET to the developer world? I do not believe. C ++ is ISO standardized and has millions of developers. The C ++ language does not need advertising, it is the language of industry, medical, software publishing, games, etc. C ++ has been there for 40 years and has undergone extensive renewal. It’s no longer C ++ at Papa, the famous C ++ 98 or C + 03. We moved to Modern C ++, the one that frees memory automatically via intelligent pointers or smart pointers, that of lambdas, that of move semantic. Marketing doesn’t talk about it, of course… Marketing isn’t mathematics, it’s not scientific and that’s why we should be wary of it.

In the field of software design, you should never believe in marketing and always rely on scientific reasoning. You have to test the technologies and make your own opinion and always be factual.

I have access to the Windows source code and everything is done in C / C ++. It’s modern C ++ and it’s clean. Windows will always be written in C ++.

The last news of the moment is to push Rust as a kernel language to solve memory problems. This is a false debate because the kernel includes a Memory Manager (mm) which manages virtual memory and only C ++ can write such a module. Some researchers have no knowledge of operating systems and are trying to make the buzz around Rust with a marketing approach … that’s it, they are setting the scene. Let them speak, Microsoft will never rewrite Windows in Rust. There are millions of lines of code. And contrary to what newspapers say for managers like 01 Informatique, Microsoft does not rewrite the OS from scratch. That would be known. Microsoft has been evolving Windows for 25 years. And it’s C ++. No offense to Marketing.

Large software is made in C ++. Another Nth example? Chrome and NodeJS. We cannot salute the JavaScript revolution without thinking of C ++. NodeJS is pure C ++ and Chrome too. Microsoft has made it its new browser with Chromium. Chrome is browser-based software that powers billions of computers and is fast, reliable, and powerful. Long live C ++!

C ++ RENAISSANCE

POWER AND PERFORMANCE

“THE WORLD IS BUILT ON C ++”, Herb Sutter.

Send me your comments on my email: christophep@cpixxi.com.

Microsoft’s UI development model

The future of graphic world (UI) at Microsoft is called WinUI. WinUI are the XAML controls of Windows 10. They’re made of C/C++.

Windows 10 makes extensive use of them and offers them (finally) full access to everyone: NET, C++, Win32.

Microsoft is committed to C++. Windows too. Microsoft makes its software in C/C++ because It’s fast and efficient. Do you understand my innuendo? On the Microsoft site, if you are looking to do software development, you are referred to .NET by default. I ask the question: but why?

Microsoft doesn’t. Why would I? Microsoft is no longer in dog-fooding as before. There is an internal discourse and an external discourse.

Internally, there is no debate, we do almost everything (90%) C/C++. Windows, Office, Edge, etc.

Externally, we only promote .NET, the web, JS/TS, Angular and python!

Where I laugh is that Microsoft evangelists who spend their time taking pictures of their hamburger meal on twitter know nothing about the native world and there is a problem for example, on WinUI. There is no one left to explain the real Microsoft, the one from the inside.

On WinUI, you have to promote XAML Islands, Controls in C++ and how to explain how to mix it with MFC and Win32 controls for example. Result: nothing. There’s no one who knows how to do it.

As an MVP, I’m going to focus on that. but it’s not normal for Microsoft not to fulfill its share of Learning.

Sometimes I have discussions with developers who think that Windows is made in C#???? WTF! The level of knowledge of the Microsoft company is leveled from the bottom. .NET architects believe that desktop graphics interfaces should be made in WPF. Oh, yes? Why doesn’t Microsoft do it then?

The future is C++ and .NET Core. It’s not ony .NET and C#. NET and its CLR is powered by C++.

Create a simple cache in C# .NET

Here is a little sample of code I have written to simulate a cache, wich write the data every second on disk in the background in a dedicted thread.

Using this class Engine, you can write data to the internal dictionary and keep it safe because the database is written to disk… I do not have handled the reload of the data in the ctor… Here the client program who write any number of values you want:

If I run the console application using different values, here is the result:

D:\Dev\MyCache\ConsoleApp1\bin\Debug>ConsoleApp1.exe 10
Count: 10
Time elapsed set: 0 ms
Time elapsed get: 0 ms
Writing DB…
Writing DB OK

D:\Dev\MyCache\ConsoleApp1\bin\Debug>ConsoleApp1.exe 100
Count: 100
Time elapsed set: 0 ms
Time elapsed get: 0 ms
Writing DB…
Writing DB OK

D:\Dev\MyCache\ConsoleApp1\bin\Debug>ConsoleApp1.exe 1000
Count: 1000
Time elapsed set: 1 ms
Time elapsed get: 1 ms
Writing DB…
Writing DB OK

D:\Dev\MyCache\ConsoleApp1\bin\Debug>ConsoleApp1.exe 10000
Count: 10000
Time elapsed set: 7 ms
Time elapsed get: 13 ms
Writing DB…
Writing DB OK

D:\Dev\MyCache\ConsoleApp1\bin\Debug>ConsoleApp1.exe 100000
Count: 100000
Time elapsed set: 98 ms
Time elapsed get: 140 ms
Writing DB…
Writing DB OK

D:\Dev\MyCache\ConsoleApp1\bin\Debug>ConsoleApp1.exe 1000000
Count: 1000000
Writing DB…
Writing DB OK
Time elapsed set: 3656 ms
Time elapsed get: 4023 ms
Writing DB…
Writing DB OK

Source code here: MyCache.zip

poster conference.net

Conference.net the poster !

poster conference.net

In 2001, I have assisted the conference.net event where MS guys and kids presented the .NET Framework. Amazing.