Journal jawtheshark's Journal: Java vs C for network connections. 27
Well, for now I'm still programming some C at work. At least it's a bit motivating. Now, for the thing I need to make, I need a network connection and thus use sockets. I was initially a bit scared of it, because I've never done network programming in C. Besides, back when Java was launched, the word was that "nerworking is so much simpeler on Java" so I was naturally a bit scared.
Frankly, that's a load of bullshit. Creating and communicating over sockets in C is really straighforward and easy. Okay, it took a while before I found the shutdown function, but everything has got a learning curve. Frankly, the way sockets work in C feels much more natural than what Java does and I've been programming Java for 10 years.
That itching on my chin must be my greybeard that starts to grow
Same here... (Score:2)
Re: (Score:1)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:1)
One of the examples I found online for C socket programming was indeed an echo server and client. That was one of the better ones. I have the bookmark at work, will try to add it to this thread if I think of it tomorrow.
Re: (Score:1)
Re: (Score:2)
Re: (Score:1)
java is NOT a network server language (Score:2)
Re: (Score:1)
Re: (Score:2)
I knew you'd see the light eventually :-) I've never done any network programming in Java, but yes, it's easy in C. New alternatives may come along every so often, but C remains to this day my favourite programming language.
Re: (Score:1)
My name is Chris, and I am recovering from Java (Score:2)
Delving into the guts, it appeared that there was an XML parser, and this app server was digesting all of the XML configuration files at boot-time, then using reflection to generate all of the security realm stuff for the server.
I just figured that something about the Java community encourages relatively more self-flagellation than any
Re: (Score:1)
Thoughts?
My reply: True. I say this as a 10 year Java developer. Telling people their solutions are crap because over-complication (and introspection is one of the biggies in that!). Nobody ever listens to me.
Re: (Score:2)
I don't even play the "I told you so" card that much.
My stock reply to "How are you doing?" is "I can't complain."
(confession: I was an "angry young man" 15 years ago)
Re: (Score:1)
Re: (Score:2)
Re: (Score:2)
(first day, new eyes)
i kind of don't agree.. (Score:1)
I've actually done Java to C/C++ networking and I can tell you that being able to write platform oblivious code is such a treat! On the other hand, it's quite a challenge to match the same socket setup in C and get a decent connection going.
That said, I'm writin
Re: (Score:1)
Yes, I loved Java sockets in the beginning, but frankly the C way just seemed so much more simple. To get it done fast, Java is the way, to have more control C is better.
For threading: yes absolutely. However, you don't *need* threading for sockets. It's nice to have both, but in the context I needed it, a single thread was more than enough.
Re: (Score:1)