Why do you want to use C # if it is slower than C ++?

I am looking for a new language to learn after C ++ and Java. I was going to try C #, but a bunch of people say that it is very slow because it is a high-level language. So why would anyone use C #? Isn't C ++ much faster? Does this help development, but only has a slower end product?

Also, what can C # be used for? You use it with a lot of .NET materials in windows and with ASP.NET, but what are other situations when you need to use C #? Will there be many job opportunities?

+33
c ++ performance c #
Apr 24 '09 at 20:08
source share
11 answers

Who exactly is this "bunch of people"? What do they compare with this?

For the vast majority of things, C ++ is not much faster than C #. This, of course, has advantages in various situations, especially if you want more deterministic memory processing, but, in my experience, the bottleneck in most applications is not in those places where C ++ would help. According to the interlocutor, great design performance instead of accurate implementation - and there, it helps to easily try various projects.

Why will we use C # if it is a bit slower than C ++? Because it is usually considered (that is, some disagree :) to be much easier to develop without shooting yourself in the foot.

How can one use C # for ... what do you want to use it for? If you do not want to develop drivers and kernels, this may be good for you. (Even OS development has some people using C # ...)

Job opportunities? Loads.

Downsides? Well, .NET itself is only available on Microsoft platforms. There is Mono , but it does not have the same degree of portability as Java (without a doubt, another β€œslow” language according to the same bunch of people).

+69
Apr 24 '09 at 20:11
source share

Code written in the assembly can be incredibly fast. Why not just write in the assembly?

Do not believe everything you hear. C # was very fast for all my projects. Typically, performance is a more important design factor than platform performance.

+37
Apr 24 '09 at 20:11
source share

I would say that the people you talked to just don't know what they are talking about. Simply and easily.

Many enterprise applications are built on top of C # and other .Net languages. Nothing initially slows them down. Yes, it tends to be slower in launch time, but pretty much where it ends.

I noticed that you mentioned Java in the list of languages. If you're comfortable with Java speed, C # presents no problem. Generally speaking, C # performs, at least in the same way as Java, on different types of labels.

+20
Apr 24 '09 at 20:12
source share

My last company was founded by 5 C ++ veterans with over 15 years of experience. They spent more than a month creating a specific Windows service. One of them found and swallowed C #. A week later, he received more than the team in his month. Soon after, they all switched to C #.

Why C # if it can run slower: what price do you charge for this degree of rapid development?

+20
Apr 24 '09 at 20:17
source share

Why should it be slow? In fact, C # is compiled into the "Intermediate Language", which is JIT at runtime, but this can give you a performance advantage, since the runtime can generate the most optimized platform for running the code ...

Depending on the application you want to record, the β€œspeed” of the language will have little effect. The performance of your application will be mainly determined by how you develop your application, if you make good use of the tools / technologies used, etc. Undoubtedly, C # is not a silver bullet, and there are projects in which you should not use it, simply because it is not the right tool for the job, but it will be great for most business / enterprise applications.

+6
Apr 24 '09 at 20:13
source share

I have not found many examples where C # is not a good choice of languages, and .Net (or Mono) is not a decent platform. Notable exceptions are the kernel development level or drivers. There are many areas where low levels and raw productivity are needed. For most, if not all, business or corporate applications, C # is one of the best development options. It is well supported, it works with many other systems, libraries, communication channels and components that are already available, not to mention a pretty good language (for example, 3.5) for work.

ASP.Net was not a bad platform, I usually think that the object / control stack is one of the short adventures for complex interactions. I think ASP.Net MVC is better suited for more scalable web applications. The same thing is better than many other systems I've worked with in the past.

In terms of service levels and even GUI design, this is pretty good. I have much more experience working in web applications, as well as at the level of services / communications / business processes, than on graphical applications for desktop computers, so I can not comment on them much. I feel that GUI development is more about IDE / Toolkit than about specific language.

As for the slow one, you specifically specify Java, in most cases, C # /. NET is just as fast and faster than Java. IMHO development specifically runs smoothly with C # (Visual Studio) over Java (Eclipse). For web applications, I like ASP.Net MVC (and even ASP.Net) for Swing. It's just me, though.

+5
Apr 24 '09 at 20:56
source share

The people you talked to do not know what they are talking about. C # is a very similar language in Java, everything is said; It has most of the advantages and disadvantages. The way it all works is pretty similar (Java / C # compiled into an intermediate language / bytecode that is interpreted or JIT compiled into native code with various similar optimizations that you don't need to worry about as a programmer). It is used in many situations, such as Java, and is really aimed at the same market. It moves much faster and brings a lot of innovation as a language, but (in practice) it depends heavily only on Windows if this applies to your problem. The labor market is similar. Both are very popular languages.

As for the language to learn, I would suggest something different. You say you know C ++ and Java; C # shouldn't be hard to pick up. Potential employers know this. Try Scala or Python. Both will give you some new perspectives on things (C # isn’t so much), and make you a better programmer by teaching you new ways to think, and not just add another tool to your box.

+4
Apr 24 '09 at 21:25
source share

C # is not always slower - in many cases, it can work just as well as any language you specify. Typically, an algorithm has more to do with speed than choosing a language.

However, C # is very expressive and has an excellent base class library for working with super-fast compilation. This means that it is very easy to work with and can allow you to be much more productive than many other languages, especially C ++. For example, I just had a small project that I would pay for 1 person-week in C ++, and we finished it in less than a day in C #, mainly because the base class libraries simplified so many tasks.

+2
Apr 24 '09 at 20:12
source share

one big reason to use C # over C ++ ......... look at all the buffer overflow problems that C ++ has, where people take your computer because they inject executable code into your lines or leaks memory .... garbage collector is very convenient IMHO

0
Apr 24 '09 at 20:20
source share

Even if C ++ starts up faster, the difference on today's computers is small. Therefore, on mobile devices where cpu and memory are quite limited, C / C ++ is still widely used.

But think about development times. If you need 2 months using C ++ and 1 month using C #, what would you do? And when you need to make big changes / refactoring, a higher level language makes it much faster and easier!

0
Apr 24 '09 at 20:33
source share

I would definitely use C #. This is actually average speed, and if you liked java, it is almost exactly the same as it is based on C ++.

0
Feb 16 2018-12-12T00:
source share



All Articles