C++/CLI .Net telnet library [closed] - c#

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am looking to make a Mud as a way of learning programming and enjoying it. Part of this is obviously working out a server client connection via the various clients muds use to connect. This uses Telnet for those who aren't aware. I was going to try to learn to do this myself but my father who is a professional programmer said its not that big of a deal to learn and using a library would allow me to move faster through it.
So my question is, first is using a library a better option here, and is there a good free one I can make use of that either uses C++/CLI .Net(preffered) or C# .Net(Was told this one is faster, but is less precise, so I would prefer to learn C++ for the precision, and I was told learning C++ is basically learning C# anyway)?
If using a library is not the best option, is there any good sites or books for finding a simple description on how to make one from scratch?

Most networking libraries will work with C and any variants thereupon.
C# will allow you to implement something (relatively) quickly and easily, but insulate you from programming issues that arrise from using less "safe" languages.
.Net is in fact a library, and it provides both C++ and C# interfaces.
Using a library is deffinately the best option, as it would be required unless you want to get down to the hardware level in every respect. For example the function printf() comes from the C/POSIX library, it actually fills up a buffer on a character device, which then get pushed to a real terminal over a serial interface, or far more likely a virtual terminal and then to your drawing library. Wether you know it or not everytime you use an #import or #include you are linking against an interface to a library. In the case of these simple libraries the compiler already knows where they are so you don't have to tell it about them.
In short C# will let you do things in an abstract and fluffy manner that may soften your learning in the begining, but will ultimatey prevent you from understanding what happened under the hood(and for many people that's ok). C++ will make your life more difficult, and it's compiler may give more cryptic errors, and it won't try to protect you from yourself, but you will probably learn a whole lot more. .Net is just the library your dad advises you use, as it provides a whole lot of functionality, without having a ton of dependencies.

Related

SDK development in multiple programming languages [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I am working to develop an SDK that will allow the users to use it and write code in C# or Java.
To achieve this most optimally, do I have to write the SDK in both languages? That would be a lot of code repetitions albeit in 2 different languages, and the maintenance overhead would be very high.
Are there efficient ways to solve this problem? What will happen if someday we think of adding a 3rd programming language support for the SDK?
Please note that I don't mind having an API instead of SDK. The idea is simple -- it's basically an interface or kit that would provide users to make simple calls to it to perform certain complex actions, all complexity being abstracted into the API or SDK.
To avoid code duplication, there are different options.
you can create the base library in portable C++. C++ can then be interfaced in both Java (e.g. with JNI) and C# (e.g. with C++/CLI). That means that you can create a wrapper for both target languages using C++. This option is more difficult if you want to target more different operating systems.
you can create the software as a service (e.g. SOAP or a simple json service). You can do that in the language you prefer and then create client applications in Java and C#.
It depends on your project, the people who will implement it and on your future goals what the best solution is.
You could code the SDK in C++ and create java/C# wrapper classes to allow users to interface to the SDK
Also allows for easy extension to other languages as most languages allow you to utilise dlls wrote in C++.
Just an idea.
If you're interested read into DLL creation, the adapter pattern, JNI for java, not sure about C# I've not had that much experience

Is C# truly viable for a modern web-socket server? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I need to develop a fairly scalable socket server for an HTML5 / Mobile based turn-based type game.
Time is a real factor in this as I need to prototype out something in 3 months. I have extensive (years) of experience in C# and zero experience in Node or Erlang which I've singled out as the perfect languages for this project. Unfortunately, both of those languages will have a lot of learning curve associated with them and things such as code quality, unit tests, maintainability I will have no experience with so I imagine the code will be of a poor quality.
How bad of a decision will it be to choose to go with C# for this project to save development time as I will have a lot more headaches with scalability and things down the line.
Is C# seriously considered viable for a modern web-app socket server?
A person can write bad code on any platform. Or good code. Yes you can write a very good low impact highly-scalable server in c#. But if this is the first such you've written (regardless of platform), chances are you'll fail to write it efficiently, and then conclude it was the platform's fault.
As an example, the web-socket server that drives instant updates here on SO/SE is written in c#, handles 60k+ connections, and barely registers as any CPU. But it was designed for that, with fully async network access, buffer-recycling, dedicated worker threads, etc.
Actually, if you are specifically looking for web-socket code, then .NET 4.5 on Windows 8 will include inbuilt web-socket support via HTTP.SYS (with managed wrappers, obviously), but it can be done manually. I could possibly even share the library we wrote to do it.
Short: Yes.
Long: c# is statically typed, and it's actually compiled to native code (on Windows) and the speed is simply awesome in my experience. Consider it like C++ with garbage collector :-) Value types + true generics make things much faster than e.g. Java, and I would consider it good enough, too.
Note that you should not get scared by benchmarks game, it uses Mono.
And if you would really get into trouble, you can do unsafe operations if you really need them. So no need to worry for the future.

Best place to learn C++ for a C# programmer [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I have been developing using c# now since the first release of .NET. I have never really spent time on C or C++ and thought it would be a good idea to get a little more awareness. Does anyone have any recommendations for sites that would provide a good learning/tutorial for someone that has c# experience to venture into C++ a little?
Thanks
Warning: C++ is not C and the following is related only with C++.
If you are already a c# developer I think you should work in three different directions:
1) copy semantic, memory management and const keyword, these are the main differences between c# and c++.
Make yourself familiar with copy constructor, destructor and assignment operator. Learn how to use RAII idiom.
Study the differences between passing a variable by: value, reference and pointer.
I will suggest Effective C++ http://www.amazon.com/Effective-Specific-Improve-Programs-Designs/dp/0321334876 also guru of the week it is a great source.
In More Effective C++ there is a nice chapter on the difference between pointer and reference.
2) you need to make yourself familiar with the standard library, in my opinion this is a really good book http://www.amazon.co.uk/Standard-Library-Tutorial-Reference/dp/0201379260/ref=sr_1_4?ie=UTF8&qid=1314957062&sr=8-4
3) the standard library is great but not enough, you will soon need boost.
I am reading this book at the moment http://www.amazon.co.uk/Beyond-Standard-Library-Introduction-Boost/dp/0321133544/ref=sr_1_1?ie=UTF8&qid=1314957541&sr=8-1
I haven't finished it yet, but it looks good so far.
Keep practise, you are going to love coding in c++.
You've already been given several good suggestions, but the wealth of information available on StackOverflow alone may be a bit overwhelming, so I'll give you a very specific bit of advice.
Rather than look for a tutorial on the web get a good book such as "C++ Primer" by Lippman, Lajoie & Moo. It is useful both as a tutorial and as a reference and is currently the most modern among the good, thorough books about C++.
This tutorial is good Teach Yourself C++ in 21 days.
21 Days is an overstatement by the way, you can breeze through that tutorial a lot faster, but it's comprehensive and easily understandable, and I recommend it.
Good luck!

XNA vs a C++ Engine [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I realize that this is the sort of question that tends to result in arguments, but because I never learn, I'll ask it anyways:
I'm a Computer Science student with a couple years of experience who is currently looking into doing more serious work with game development. Thus far I have about half a year's knowledge of C++ and Java and a year and a half of C#. I've worked a lot with the XNA framework, but in looking around for advice, I've found a lot of people suggesting that C++ or Java is a better place to start for building games.
So my question is this: Given that I already am comfortable with XNA, what are the major disadvantages inherent in the format that would be avoided by instead using C++/Java?
When answering with regards to optimization and such, please consider my current lack of experience. Telling me that an optimized C++ program is faster than an optimized C# program is meaningless to me if that optimization requires an expert programmer to implement.
Edit: Allow me to rephrase: My question is not "Why should I use C++?", it's "Why should I not use XNA?" I'm aware that C++ will give me more options, but my question was whether or not those options are useful enough in amateur game design to be worth seeking out C++ immediately.
The advantage of using C++ is that you can do literally whatever you want.
Another advantage is that the C++ might be faster, in tight loops where you are doing a lot of math where the C# equivalent is using a lot of little structs.
The disadvantage of using C++ is that you will be programming in C++. This means memory management woes, pointer dereferencing bugs, and all kinds of unmanaged problems that you don't get in .NET.
Another disadvantage is that you don't get support for XBox or Windows Phone that you would get with XNA.
Okay, so let's completely ignore the argument which one is better. Let's go with the assumption you wish to pursue a career in game development.
I am going to be straight forward and say that 90% of games, if not more, are developed using some portion of C++ (either the complete thing, a framework, libraries, etc) so learning C++ would be essential to any game developer.
If you are doing it purely for a hobby XNA is a fast way to get in the door without learning the other programming elements (such as 3D graphics, file management, etc). However that being said, learning that stuff is also key.
So, to sum up, my suggestion is to learn C++. There is no reason not to. If you know C++ you can learn C# in half a second (well not really, but fairly quickly). Once you have an understanding of the basics (3D programming, physics, etc) you can do pretty much anything.
Good luck.
yes use Xna if you want fast results. i just started with c++ but i have to said that xna is quite easy. you just have to know OOP(object orientated programming) with C# and youll make good games with xna too.

Opensource projects to learn from [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I often read that one of the best ways to continue learning how to programme is to study great opensource projects out there in the wild. Can somewhere recommend a good open source C# project that they learned a lot from. I've been coding a couple of years, both windows and web apps, pretty standard stuff, sql server, asp .net. I'm particulary interested in improving my skills in building well architectured n tier apps
Thanks,
Brendan
Microsoft's own ASP.Net MVC project is open source. It's under their own license, which is probably pretty restrictive about what you can actually do with the code. But it's a pretty large project and interesting to look at.
Have you looked at Codeplex? There are over 800 open source C# projects there.
At the general level, I've found that standard library code is often good to learn from. Reading the source to application code is certainly useful. However, reading the code to STL, or D's std.algorithm or something that is similar, teaches you how to think on a higher level, and to create generic, reusable code. In contrast, application code is often more ad-hoc and heavier on boilerplate, and therefore not as educational.
For your specific case, I'd read the code to the libraries/frameworks you're using. It's interesting in and of itself to know how these things work instead of taking them as magic, and they're written by top-tier programmers and probably much higher quality and much more dense in terms of significant programming concepts per line than most application code.
MediaPortal. Some of it is fabulous, some of it is bad. However, if there is anything you want to do, its in there somewhere.
How about the OpenJDK (the open source version of the
Java Development Kit)?
Here is OpenJDK 6
Here is OpenJDK 7 (release planned for 2010 or so)
Have a look at the NHibernate code its fantastic
their repository is here

Categories

Resources