• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Improvements to Chat Program?

 
James Hambrick
Ranch Hand
Posts: 282
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the source code to my Java Chat program on my blog. If anyone wants to download the txt files and look over them that would be great! Please reply here with any suggestions to make the code better. I think this was written with Java 1.5 so any improvements to Java have not been added.

http://jameshambrick.com/project/java-chat-program-2/

Also comments on my blog to help others that do not frequent this site would help too.

Thanks!
 
Winston Gutkowski
Bartender
Pie
Posts: 10087
55
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
James Hambrick wrote:I have the source code to my Java Chat program on my blog. If anyone wants to download the txt files and look over them that would be great! Please reply here with any suggestions to make the code better. I think this was written with Java 1.5 so any improvements to Java have not been added.

Any suggestions you get here are more likely to do with design improvements that specific release features.

But, from the top of my head (and by a cursory glance of your "client"), I can see a couple:
1. Your Client includes GUI logic, which is almost always a bad idea, because the problem that your program was written to solve is "chatting". How it's displayed is an entirely different issue; so it's usually best to keep the two completely separate.
2. I hate massive try...catch blocks. If you have logic that throws a checked Exception (or one that you're particularly interested in), put it in a well-named method that throws the same Exception, and call that method from your try...catch block. Modularity.

Like I say, just a cursory glance. We're volunteers here...

Winston
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic