views:

134

answers:

6

Hi,
What’s the best language and IDE to develope socket server? I want a language I can learn quickly that will work on an enterprise level. Please set me up with some good resources:)
Thanks

RECOMMENDED LANGUAGES
'I only know Flash and scripting languages'
• JAVA
• C languages and VB++
• PHP

I’m tring to get my Flash animations to connect to an old backend system. The IT director of my company left, and I don’t want the project to get canned. I’m willing to stay up nights learning, as long as I can get a prototype made.

WHAT I'M DOING 'Connecting to an archaic back-end system'

alt text

No time contraints or limits

Is any of the languages already used in your enterprise?
C and VB are used

How complex should your socket server be?
Not complex, but have a good library and foundation to expand later

Can you use something already existing?
Yes, but it can't cost anything

What is your purpose
Learning and proof of concept is my purpose. Out of the box solution would be ideal, but sometimes implementing a new framework takes as much time, and could go against what's already in place. I'm likely to go with a language that I can continue use in game development.

+2  A: 

Why is TCP/IP Socket even required? I suppose at some level it is, but wouldn't this be easier using something like JMS to abstract out the socket layer into something more manageable? That's the direction I'd go.

I guess that makes this answer Java. While I don't know any names offhand, I'm sure there are good message brokering systems in C++ as well. It's not about the language, it's about the library! :-)

glowcoder
@glowcoder, I don't know if JMS would work with the old CBASIC machine. I was told TCP/IP socket was the way to go.
VideoDnd
+1  A: 

Your best bet on an enterprise level is C#, but given your current technology stack of Flash with MySQL, you might be better off with Python or Java.

Avoid PHP like the plague.

The biggest place where C# will benefit you is in the communications... Windows Communication Foundation (WCF) is, hands down, the best library for high-level network programming out there right now. Visual Studio is also the best IDE out there, IMO. C# and .NET don't work well with MySql, however, so it may not be the best fit for your stack.

If you go the Java or Python route, both have a decent IDE in the form of Eclipse.

Randolpho
@Randolpho, If C# or Python does the job, that would give me an other language relevant to game development. Java is still a contender, but I don't know what else I would use it for.
VideoDnd
+2  A: 

What’s the best language and IDE to develope socket server?

Any language that supports sockets programming (almost anything). The question is a bit simplistic.

I want a language I can learn quickly that will work on an enterprise level.

You can learn quickly most languages, but to become proficient in them may take time. More than that, the language doesn't matter as much as the library you use.

Here are a few examples of what I mean:

Python takes little time to become proficient with, but I'm not sure how "enterprise level" it is (it's used by NASA, Google and a few other major players so it may be enough).

It is also very high-level, so I wouldn't be surprised if you can write the code for a simple socket server within ten lines of code (it only takes one line of code for creating a web server in python).

Java and C#/C++.cli/VB+ should support the creation of a socket server with relatively few lines of code, as (the same as python) they have already-made libraries supporting most of the functionality.

They are more verbose than Python though so you'll write much more code.

I don't know much about PHP to say how good it would be for this.

C is too low level which means you'll probly write more code than the others mentioned. It's very powerful, but writing the project in C will take you at least a week of writing code and a week (probably many more) in debugging it - especially if you're new with the language.

C++ is ... well across the spectrum (it is both high and low level) but it is difficult to use correctly (it has many quirks and the mistakes you make are not obvious until you understand why it's designed as it is). C++ would probably take more than C to learn and use correctly.

Please set me up with some good resources:)+

I would but your question is too broad. Here are some questions to narrow it down:

  • what are your time constraints?

  • are there any limits?

  • is any of the languages already used in your enterprise?

  • how complex should your socket server be?

  • can you use something already existing?

  • what is your purpose (do you need socket-server functionality urgently? do you need to learn sockets programming? do you need a socket-server-based solution to a problem you have?)

Edit:

Considering your answers, I'd recommend going with C++ and boost (boost::asio specifically). Here's my reasoning:

I'm likely to go with a language that I can continue use in game development.

C++ is the language of choice for game development. It has many pitfalls, but the advantages seem to outweigh that.

If you use good C++ practices you will avoid most of the pitfalls and reasonably manage the ones you can't avoid. ( If you want a list of good practices or common C++ pitfalls ask a new question :) ).

it can't cost anything

Neither C++ nor boost cost anything.

For IDEs, you can download Microsoft's Visual Studio 2010 Express (free) for Windows, and use Eclipse+CDT or Code::Blocks for other platforms (I think they're available for Windows also).

If possible, also use a distributed source control system (like Git or Mercurial). They save you a lot of headaches and make managing the code much easier.

Learning and proof of concept is my purpose.

You will learn a lot :D.

Here are some resources to get you started:

For C++ look at Thinking in C++ (free) and (if you can get your hands on them) Effective C++, More Effective C++ and maybe Effective STL.

For boost, the boost documentation (also free) should be enough, once you get started with C++.

Specifically, have a look at the boost::asio examples. They offer the complete source code for various servers (HTTP servers, echo servers and so on).

boost::asio is an already implemented framework, but learning C++ and the boost libraries on top of it may require a steep learning curve on your side.

utnapistim
@utnapistim, I answered your questions.
VideoDnd
@utnapistim, thanks! Best answer.
VideoDnd
@utnapistim, I posted an other question. This is about an other project in C basic. I guess I had a 6th sense I would be pulled in to a new project.
VideoDnd
+1  A: 

If all you need is to receive some data from a flash app and you don't have high performance or scalability goals you can probably just use URLLoader in flash and something like PHP on the server. A socket server is probably not even required.

If you want to get a deeper understanding of sockets though I suggest you learn some C. Socket are usually implemented in the OS kernel which expose them through as a set of low level system call.

Because of this detailed explanations of the way sockets work and interact with other elements of the system (such as descriptor polling, process, and threads and scheduling) tends to deal with C.

Alexandre Jasmin
@Alexandre Jasmin, it's a TCP/IP socket connection. @Randolpho said to avoid php. I'm not sure what that meant.
VideoDnd
+1  A: 

At a few occasions I had to code socket servers and Java did the job (I don't know Python enough to have an opinion on it.) But I would really start by checking whether or not it is absolutely necessary to go at the socket and tcp/ip level to handle communications with a Flash app.

Java offers quite what you are looking for:

  • Free tools and good libraries: Eclipse IDE, Spring and Jakarta librairies.
  • Good networking, multi-threading and MySql support.
  • Easier and faster to learn than C or C++. Java is a good starting point if you want to move on to C++ later, both languages are used in the game industry.
  • Multiplatform support, you don't have to code for a specific O/S.
svachon
@svachon, thanks for the tip.
VideoDnd
+2  A: 

I thought this would be helpful alt text

pixelGreaser
@pixelGreaser, WOW, I guess that's helpful. +1 for comic relief.
VideoDnd