Windows Mobile Development: C ++ or C # - Which One is Better? What for?

During the development of Windows Mobile, in which language should I use? C # or C ++ or something else? Why is one better than the others?

+4
source share
5 answers

It depends on what you code.

Making your own OS calls is possible using P / Invoke with C #, but widespread use is probably easier with native C ++. You will also need C ++ to use some equipment that has not been wrapped by the Compact Framework.

Most hardware (GPS, camera, etc.) is available through CF. If you are working with a Win Mobile 6.x device, you will probably be better off with C #. In addition to hardware, the Pocket Office Object Model (POOM) is also available for C #, so you can integrate with it.

It is worth noting that most of the links to Windows Phone 7 relate to managed code and Silverlight features. With Silverlight in the mix, you have to write C # code.

If your application has high performance or is extremely low on memory, use C # or VB.NET.

Scott

+5
source

It mainly depends on the task.

C ++ has the following pros / cons:

  • Direct access to resources, faster programs
  • Access to very deep parts of the OS that are not required for high-level applications.
  • more difficult to develop and requires developer resource management

FROM#:

  • Runs under a virtual machine (CLR), therefore slower
  • Faster and easier application development.
  • Rich built-in library
+2
source

There is no right answer for this, because there is no "better" definition of one size. If you know C ++ and have many C ++ code assets, C ++ surely looks attractive. If you know C #, not C ++, then C # certainly looks attractive.

C ++ applications load faster, but for many applications this is not relevant. C # applications can certainly be written faster, but they also lack determinism. I never even try to use the UI in C ++, and I do not think about making access to the database in C ++. I would not write a driver in C #, though, or a shell extension.

Generally speaking, most of the solutions I have ever supplied were a combination of them. C # has its own strengths. Itโ€™s quick to write, itโ€™s easier to debug and unit test, itโ€™s difficult (though not impossible) to create leaks, and for some operations (for example, accessing data or parsing XML) it is simply simpler.

C ++ also has its own strengths, such as speed of execution (although C # can be done just as quickly for many things), determinism, and the ability to connect to things that want built-in entry points.

So my answer? You need to know both and probably write your solutiuon using both. The percentage of each of you ultimately depends on your ultimate goal.

+2
source

It depends.

At least indicate a specific use case. And maybe use SO search? :)

C ++ or C # for programming a mobile barcode device?

Edit: Apparently, others were faster in a draw and gave clearer answers. However, I still recommend reading the SO stream above.

+1
source

In my experience, itโ€™s easier to start with C #, and if the api provided by the compact structure is enough for you, then you're fine.

On the other hand, if your project is somewhat complex, or if you want to do something that is not in a compact structure, you may need to create a .dll helper in C ++. Even so, you may be doing well your main program in C #, as well as a dll dll for programming in C ++.

If you go directly to a C ++ program, you can take advantage of the fact that you have raw performance better than C #, which is good if you make a game.

But you will also suffer more from the limitations of Windows. At most 32 MB per process, or that all .dlls use the same address space.

So, in the end, it really depends on what you plan to do, and on your experience.

+1
source

Source: https://habr.com/ru/post/1302769/


All Articles