• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Improvements to Chat Program?

 
Ranch Hand
Posts: 282
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic