Touchscreen App, Do I need to learn a new language? [closed] - c#

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
I'm making a multitouch-screen app that for its function will just have to get positions of objects on the screen, have them ordered, be able to select them and drag them (sounds basic). I will also have to have a kind of history of actions so I could press the typical "Ctrl+z" and get X number of actions undone
The only language I know is C++ and I have made two simple GUI programs for Windows 7 in the past. For the porpoise of my app which is meant to be used by professionals, the screen should be 14inchs or bigger, considering there are 2 O.S. that support touch-screen events: W8 and Android, and how the app needs to be (explained in the first paragraph):
Should I have to learn another language to get this done?
If yes, what should it be: C# or Java? By what reasons?
If no, could you recommend any C++ libraries to: manage touch-events, make the GUI (both libraries should be free for commercial use).

Have you considered using libgdx to write multiplatform stuff: http://libgdx.badlogicgames.com/features.html
there is a C++ plugin for it here:
http://aevumlab.com/libgdx-cpp/
The beauty of libraries like this (and there are quite a lot when you google them) is that if you haven't got the time to learn a new language you can work around it this way. That being said if you see yourself working closely with Android in the future it wouldn't hurtto dip your toe in Java.

First of all, what do you mean there are two operating systems that support touch-screen events? What about iPhone and Blackberry? Or Google Chrome OS?
In any case, I think you've got your question backwards, or I don't understand it. You do not choose a programming language and then decide your target platform. That hardly makes sense. You will usually have requirements by customers dictating the target platform, and only then you start to think about programming languages.
If there are multiple target platforms, then you may choose to reimplement the same application in different programming languages for each system. Or it may turn out better to use shared native C++ or C code which can be reused, at least partially, on several platforms. These are classical software-engineering tradeoffs, and it's impossible to tell you in general what's easier or more efficient.
You've tagged your question as "Android". For an Android app, you will usually want to implement as much as possible in Java and resort to native C++ or C code only if necessary. You do not use C# on Android. Mind that the often-heard assumption that native code is automatically faster is typically wrong and is made by people who do not measure but guess. Native code may be faster, but it may also be slower because of the extra indirection. However, as I said, reusability of native code on other platforms may be an important advantage and beat related disadvantages, such as reduced robustness or harder development.

C# does have some nice support for touch screen, and it is a great next step from C++. Learning an extremely object oriented language such as C# or Java is almost a must these days. Though a touch screen application isn't exactly 'Hello World', making a small, touch-based app is a good way to get into the WPF side of C#.
To get you started, see this MSDN article: http://msdn.microsoft.com/en-us/library/ee649090(v=vs.110).aspx

Related

C# or C++ for making a game engine (in depth) [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
What is best C# or C++ for making a game engine. I currently am a .NET C# developer and really want to use C#. Although I know C++ does support memory management and that is why a lot of big companies go for it. That being said C# is quicker in the development process and extremely familiar to me. Before anyone suggests it, yes I've used unity. I like it but want to go the long and hard extra stretch to own 100% of my own built game.
What do I lose by not going to C++? and what kind of libraries do I use, for graphics and stuff? Is that what DirectX is for? I'm trying to wrap my head around this and any help would be much appreciated.
I need some opinions
Perhaps I shouldn't presume to tell you what you need, but I think you'd be much better off receiving information you need to form your own opinion. Asking for opinionated answers (notice irony here) in my opinion isn't generally desirable here.
C# and C++ are both very powerful general purpose programming languages. Either language is 100% capable of creating full fledged high performing games. With that said, there are some (mostly) objective differences one can point out that may effect your decision.
Garbage Collection
Whether this is a pro or con for you is for you to decide. Some people want to save themselves work and have to spend little time taking care of memory. Obviously C# shines in this regard. C++ can have elegant and easy memory management if you know how to properly use smart pointers of course, but that's still more effort than garbage collection. If you're very concerned with having tight control over resources, then C++ might be more your thing.
Libraries
When you want to write software without reinventing wheels (and you should) a language's libraries can be just as important as the language itself. This isn't an obvious pro for either language, as both have lots of libraries supporting games. If you have to pick a winner though, I'd say it's probably C++. The language has essentially been the vernacular of game programmers for years now, and has a lot of maturity in this domain. C++ can directly leverage APIs as low level as OpenGL and as high as Ogre3D. There's no guarentee that your game will actually benefit from a C++ library over a C# library though. It depends on your use case.
Standard Libraries
Continuing on the theme of libraries, this could be a pro for C#. C and C++ are two languages that have an enormous amount of libraries available. If you only count their standard libs though, then things change. Some people don't mind, or even like this. One may also want a more expansive standard set of functionality however. C++ doesn't have a small or incapable standard lib by any means, but C#'s is definitely more feature rich.
Platform
Unless you're going to use Mono, C# is not portable. Mono is a great option, but it does have cons (that you'll have to research yourself). C++ can't tow a line like "Build once, run anywhere", but it does all the same offer damn good portability if that's what you're going for. With an OpenGL renderer (or some higher level wrapper API like SDL/SFML) you can build for pretty much any desktop environment. If you're only worried about making games for Microsoft platforms though, then this point is probably mute.
Virtual Machine or Native
This just like garbage collection is just a factor to consider. It'll be up to you to decide if it's right for your use or not. VM's sometimes have a stigma among game programmers it seems because of supposed performance issues. It's true, if C++ is used intelligently, it will probably be a better performing game. C#'s performance isn't anything to laugh at however. A lot of games that are written today can perform fine with a C# implementation. Is using C++ really an advantage if it means 450 FPS vs 400 FPS? Sure, there's a measurable difference, but it doesn't mean much to anyone playing your game, even if they have a 144hz monitor. Memory overhead is in a similar boat. Usually C++ isn't actually a necessity until you start getting into seriously heavyweight games.
Learning
Last but not least, consider the fact that you have tools you know, and tools you don't know. You already know C#, the time you have to invest learning is probably going to be much less if you choose to pass up on C++. C++ simply has additional concepts and responsibilities compared to languages like C# and Java. Some of these things you can choose to ignore. C++ won't hold you at gunpoint and force you to use multi-inheritance, and hey, that's probably easy to pass up on. Will you pass up on destructors though? Those are pretty important. What about the STL in general? Passing up on that is probably not a great idea, no best you learn STL if you're going to use C++. If you think this is worthwhile doing, then by all means go ahead. Again though, it's just something to weigh in.
Creating a game engine in C++ while learning C++ is a big challenge.
C# is more enjoyable than C++
Why?
In C++, pointers are powerful and you need to know how pointers work and how to use them
In C++, finding libraries is not as easy as pulling a nuget package
In C++, creating/refactoring header and source files is annoying
In C++, need to compile for every CPU architecture
In C++, syntax may be harder to grasp at the beginning
In C++, using the compiler and optimizing it is a topic on its own
But if you want your game/game engine to be fast then you should go for C++
When i see people coding for games in C++ they mainly use OpenGL but thats a common mistake since most of the non-console gamers are Windows users.
My advice is to first start creating a small game using DirectX, if you feel comfortable with it, then take the next step and create your own game engine

Unmanaged C# versus C++ [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I am a wanna-be Games Developer and I prefer using C#. When I asked what the disadvantages of writing real-time applications in C# were I got 1 significant point back: Garbage Collection and the unpredictable impact it can have on performance.
My counter question is, what about Unmanaged C#? How does it compare (performance-wise) to C++? Is it a valid option for developing software?
I don't hear much about unmanaged c# and all the "unmanaged c# versus C++" questions I saw were unanswered or answered inaccurately. These questions were not on stack overflow.
EDIT:
I believe umanaged C# is "Unsafe Code".
Unsafe code in C# is not for developing separate applications. You can use unsafe code for some kind of time-critical operations, but generally it's not the most effective and the most convenient way of doing this. IMHO, it is primarily designed to give C# an opportunity to integrate with unmanaged dynamic link libraries and unmanaged code, so from my point of view the primary reason is INTEGRATION.
I can see 3 common ways of managed and unmanaged code integration:
Unsafe code in C# and P/Invoke. Build C# wrappers over compiled unmanaged DLLs.
Managed C++. Build managed assemblies over existing C/C++ code.
COM interoperation. Call Runtime Callable Wrapper from .NET client or call COM Callable Wrapper from COM client.
On the other hand, it's your architectural and conceptual decision: if you need a full memory and performance control, you develop in C++ or even pure C. If you need advantages and simplicity of modern language and modern technologies, you develop in .NET C#. Or you can use both, and how to integrate them is described above.
You can use C# to build games. The question is what exactly are you intending to do? What platforms do you intend to target, and how polished do you intend the finished product to be?
Others have mentioned Unity, which uses C# and provides a ready-made game engine and development suite. The only downside is that the free version has limitations.
If you want to build your own engine for the sake of understanding, look into XNA. Or you can use a wrapper around OpenGL like SharpGL. Or maybe you can find the long-dead Managed DirectX floating around somewhere. Or if you are really brave, you can use unsafe code and wrap GDI calls so that you don't have to deal with the horribly slow GDI+ implementation. The last two really aren't recommended, and only XNA is going to provide you more than a way to draw things on the screen. There are sure to be countless other possibilities, especially considering what becomes available to C# developers with Mono.
Whatever you decide, the garbage collector isn't going to get in your way, and unsafe code wouldn't be a solution if it did.
Edit:
As mentioned by cdoubleplusgood, XNA is no longer in active development. Look into Monogame and consider the wonders of cross-platform development a bonus.
For general purpose applications C# (managed) is a very suitable language with great performance. Unless you have extremely high demands you can certainly use it for games. Have a look at Unity:
Unity
Nevertheless, most AAA game studios use C++ as their main programming language. That being said, if you want a career in such studios you are better off investing some effort in C++.

Resources to successfully making applications scriptable [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
In the process of designing an application we've come to the conclusion that the user needs to be available to add custom behaviour to the program and we want to allow this through scripting, however, none of us got any experience embedding a scripting engine in an application and even less designing the application to successfully allow the scripting to place.
We suppose that the key to making the application scriptable is to create a large set of events that the scripts can respond to, as well as exposing functions for the script to use. Instead of rushing into scripting recklessly we would prefer reading up on some resources on the topic.
We're looking for resources (preferably books) which covers the process of designing an application for scripting. Any advice would be awesome as well. More or less any advice on the topic would be nice.
If details of the project in question is needed just say so an I'll add a paragraph explaining more in-depth detail.
How techy do you want to make your scripting?
If your users are happy to use .Net then this artice gives an introduction to making an extensible application.
http://www.developerfusion.com/article/4529/using-net-to-make-your-application-scriptable/
When I was investigating a similar thing a while back I also found the technical notes for the sharpdevelop application to be very helpful.
http://www.icsharpcode.net/TechNotes/ProgramArchitecture.pdf
http://damieng.com/blog/2007/11/08/dissecting-a-c-application-inside-sharpdevelop
Embedding scripting capabilities into an application will depend very much on the language and technology that make up the application. In your case, developing with C# there are some interesting options because of the work on the Dynamic Language Runtime. You should probably take a look at the IronRuby and IronPython projects since they will provide the best overall integration with .NET applications since they are themselves implementations of the Ruby and Python scripting languages on the .NET platform. As my experience centers on Ruby predominantly I would look at the information on hosting IronRuby in a .NET application.
As far as a general book goes I would probably start here: Language Implementation Patterns: Create Your Own Domain-Specific and General Programming Languages. For specifics on IronPython there is this title from Manning: IronPython in Action. And for IronRuby there is this book still in Beta: IronRuby in Action.
This may also be a solid resource coming out of Microsoft's Professional Developer's Conference: Using Dynamic Languages to Build Scriptable Apps.
Can you wait for C# 4.0 and the DLR (or deploy the beta)?
See Application Extensibility and Embedded Scripting.
How hard this is really depends on your requirements. It can be quite easy.
In my app, I built a small set of classes that exposed the basic data model that I wanted to be made available to scripts. I built a scripting manager that creates an instance of the IronPython engine, adds an instance of the data model's root object as a global, and loads and executes the script.
Now, in my case, I'm actually the one doing all the scripting. So I don't need any kind of fancy development environment or testbed application, and I have essentially zero security considerations. The problem would be a lot harder if I needed to worry about any of those things.

C++ vs C# for GUI programming [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am going to program a GUI under windows (will be about 10,000 line code with my estimates) and don't know C# or C++ (QT library) to choose for my needs. Please help me to choose.
If you have to debate on using C# or C++ then the correct answer is probably C#. I would stay away from a low level language like C++ unless you absolutely have to as the amount of time required to develop/debug with it will be much greater. C# has a lot of GUI functionality that it harnesses from the .NET framework. There isn't a lot you can't do with it right out of the box as opposed to C++ which you'll have to hand code a lot of functionality.
If you are developing a Windows application I'd suggest using C# and the .Net Framework as they are the 'native' solution. Using QT is just going to add complexity as it's a cross-platform library and has additional concerns therein. I'd also suspect the support for the .Net Framework is likely to be greater and more widespread.
The overarching question would be, which programming language are you most familiar with. If there is a Windows compiler for it then use that!
Use .NET if your only target is Windows. It is much more productive and you have better IDE support for development of GUI. The disadvantage is that you need to have .NET framework installed on the machine your application will run on.
If you consider going cross platform, or you think you master Qt (and C++) more than .NET, then go on with Qt.
I'd prefer C#.. In some cases is easier to distribute (windows 7 comes with .NET). Microsoft showed that the future is in WPF, so why wait to adopt it
Choose the GUI toolkit based on your requirements, then choose the language.
if QT fits the bill, then C++, if WinForms looks good, C#, if MFC (and the new feature pack) is good enough, C++ ....
Also, depending on your skill (and the skill of your team) of one language or the other, your decision might be easier.
What are the requirements? If the performance is not an issue then I would go with C#.
I think the question should be using c++, .net winforms or wpf.
You will never use c# lonely to build it, you will use the IDE.
If you need something visual I should use wpf, otherwise I would use .net winforms. You can mix them too.
Regards.
One other option you may want to consider is gtksharp if you want to use c# but would like to target multiple platforms.

CAD/CAM without C++ [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
Is it possible to do CAD/CAM software without having to use C++? My company developed their software with c/C++ but that was more than 10 years ago. Today,there is a lot of legacy code that switching would force us to get rid of but i was wondering what the actual risks are. We have a lot of mathematical algorithms for toolpath calculations, feature recognition and simulation and 3D Rendering and i was wondering if C# can handles all of that without great performance loss.
Is it a utopia to rewrite such algorithms in c# or should that language only deal with UI.
We are not talking about game development here (Halo 3 or Call Of Duty) so how much processing does CAD/CAM really need?
Can anybody enlighten me on this matter? Most of my colleagues are hardcore C++ programmers and although i program in c++ i love .NET but i am having a hard time selling .NET to them other than basic UI. Does it make sense to consider switching to .NET in such a field, or is it just not a wise idea?
Thank you
If you have a lot of legacy code that would need to be rewritten, I don't see it making business sense to switch to a different language. Even if there were gains to be had from using a different language (which is questionable), the cost of testing and debugging the new code would more than overcome them. You also have a development team that are experts in C++. There would be a big productivity drop while they came up to speed on the new language.
C# Can interop with C++ code. You can start writing new code in C# and have it call existing c++ code when needed. It wouldn't have to be just for UI. Look into C++/CLI and the C# Interop methods for information on how to use existing c++ code with new C# code.
Also, I asked a similar question here:
C# Performance For Proxy Server (vs C++)
CAD/CAM applications are fairly calculation intensive, and speed will definitely be one of the criteria for selecting a package, so I would be wary of moving to a slower language.
You need to think very carefully about the reasons for switching language. Is it because you don't like C++, or because C# will bring real benefits. It is quite likely to slow your application down. Check out the C++ C# speed comparisons.
Computer Language Benchmarks Game C++ vs C#
In my humble opinion, you'd be better off keeping all of the toolpath calculations in C++, and if you really must move any code over to another language, move it over to a scripting language which the user can easily edit, without re-compiling.
I use CAD/CAM applications every day at work, and there are a number of things in the UI which get on my nerves. They would be simple fixes if only I could get at the source.
If your company makes a CAD/CAM application which has a UI written in a scripting language which I can tweak (Lua, Python etc), I'll buy a copy.
Hugo
Have a look at pythonocc. Its provides you with a python module that wraps the OpenCASCADE CAD kernel. OpenCASCADE is the sole industry strength open source kernel I'm aware of. Nice features are STEP and IGES support and the ability to generate FEM meshes from BRep data.
Another thing you need to consider is platform independence - if there is a possibility that you/you company need to migrate your CAD software to Linux/Unix (Of course, for bussiness decision), it will be quite painful. Currently, even C++ with MFC/Win32 calls gave us many headache...
The Open Design Alliance library is cross-platform. They have recently introduced a beta of the .NET version of their library. See my answer to Open source cad drawing (dwg) library in C# for more details.
Having said that I concur with the other answers here - if it ain't broken, don't fix it, both the code and the coders. MSFT still use C++, as does the ODA - their codebase originates in C++ & is wrapped for .NET.

Categories