• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to write better software  RSS feed

 
Rupjit Chakraborty
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I am coding a small application - Warehouse Management System, using Java Swings. During the course of coding this application I have come to realize that there must be more writing good software like how to divide the application into modules of reasonable size and functionality, how to ensure application security(secure coding I guess?), 3-tier architecture and more such things.
So my question is show should I write good software? Please tell me the books(or websites) to follow. Any advice is welcome.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rupjit Chakraborty wrote:I am coding a small application - Warehouse Management System, using Java Swings. During the course of coding this application I have come to realize that there must be more writing good software like how to divide the application into modules of reasonable size and functionality, how to ensure application security(secure coding I guess?), 3-tier architecture and more such things.
So my question is show should I write good software? Please tell me the books(or websites) to follow. Any advice is welcome.

Well, I'm not too up on the latest books, but if you're writing this in Java, there are two that always seem to be top of the list: this one and this one.

Both are what I call "why to" books, and neither is for absolute beginners; but if you already have some Java under your belt, they will help to explain how to get the basics right. And IMO, the first one of those is the best book I've ever read about any language.

Unfortunately, neither (AFAIK) deals with Java 8, and if you're just starting this project now, I would advise you to install a copy before you write your first line of code.
One book I've seen on the subject, and that seems to have good reviews on Amazon, is this one.

You can also find many others (with reviews) in our Bunkhouse.

About the only other advice I can give:
1. Swing is rapidly becoming obsolete. If this is purely a desktop application, I would use Java FX.
2. A browser-based application is likely to be more useful in the real world than a desktop one.
3. Keep the "display" portion of your application (ie, your "screens") completely separate from your data objects.
I cannot stress this enough: if you start mixing the two, you will end up with a spaghetti bolognese that you'll find very hard to untangle.

HIH

Winston
 
Tim Moores
Saloon Keeper
Posts: 4036
94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I find it useful to incorporate FindBugs (or similar tools like PMD and CheckStyle) into the build; those provide insight into the code quality on a much lower level, and help to avoid lingering bugs. That's less important than having a good design, though.
 
Campbell Ritchie
Marshal
Posts: 56595
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is probably the best website. Search the Oracle site because there are all sorts of useful things there, many of them about how to write good software. But the most important part is experience.

Please check the name of the platform carefully.
 
Rupjit Chakraborty
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

Thank you very much for replying. I am a student and I have no experience of coding under someone professional or in a company. So the vocabulary you are using are kind of making it difficult for me to understand.
1) Swing is getting obsolete. Where did you get this information? On similar lines, how do I keep myself updated on the latest happenings in Java(Oracle website).
2) Display portion separate from data. Do I use some kind of design pattern?

I am using Eclipse to develop the application(Is that ok?).
I don't know how to use the debugger or any other thing that comes with the IDE. All I know is how to write code.
I will be referring to the suggested books and hoping that I can write better software.

Also, can you please point me towards some well written software built using Swings.
 
Junilu Lacar
Sheriff
Posts: 11494
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rupjit Chakraborty wrote:
2) Display portion separate from data. Do I use some kind of design pattern?

IMO, that's the wrong place to start if you're a Novice programmer. Lately, I have been looking into how to help novices become better. Software Development is a HUGE topic and covers many details. Novices will often confuse themselves by focusing on things that require a lot of experience and context to fully comprehend, two things that novices lack. I think it's best to start somewhere else in your learning journey.

One book I have been reading this week is Andy Hunt's Pragmatic Thinking and Learning: Refactor your Wetware. It's a very interesting read but it's about something that you might not think is very technical, which is probably what you'd be more inclined to read at this point in your learning journey. However, I would still encourage you to read through the first four chapters as it provides many insights into the learning process and what you can do to help yourself along that journey. I find that many people are stuck where they are because they simply have no clear strategy for improving.

As a novice, I think you should concentrate on simplicity. Learn about basic coding and design principles first.

First strive to write clear, clean code
Learn how to refactor and use automated tests to drive your design thinking

When you have an idea of how to do the above, start looking into the following because they will help you write clean, clear code and make refactoring and testing more meaningful
4 Rules of Simple Design
SOLID, DRY, SLAP, GRASP
Law of Demeter, Principle of Least Surprise/Astonishment

(edited to give a better implied ordering of topics to cover/learn as a novice)

Knowing these things first, IMO, is much much more important than learning design patterns. When you have a decent understanding and ability to adhere to these basics, you will find that design patterns are just a logical extension to all of the above.
 
Junilu Lacar
Sheriff
Posts: 11494
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Above all, practice deliberately - have an improvement goal when you practice something. You want to know more about the new Java 8 Date/Time API? Read a little bit. Then try to actually WRITE some programs. This is what Andy Hunt calls synthesis. In layman's terms, you learn by doing. But synthesis is only half the story. You also have to analyze what you've done and look for ways to improve. You read more about the topic and understand more of the theory. Then you put your understanding to the test by again trying to DO something with it.

Andy Hunt's Tip #9: Learn by synthesis as well as analysis
 
Junilu Lacar
Sheriff
Posts: 11494
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rupjit Chakraborty wrote:
I don't know how to use the debugger or any other thing that comes with the IDE. All I know is how to write code.

I use a debugger only as a last resort, when I can not, for some reason, use testing and refactoring to figure out and fix whatever is wrong with my code.


Rupjit Chakraborty wrote:
I will be referring to the suggested books and hoping that I can write better software.

My list of book recommendations:

Clean Code by Robert Martin
Agile Software Development: Principles, Patterns, and Practices by Robert Martin

The Pragmatic Programmer by Dave Thomas and Andy Hunt
Pragmatic Learning & Thinking: Refactor Your Wetware by Andy Hunt

Refactoring: Improving the Design of Existing Code by Martin Fowler
Working Effectively with Legacy Code by Michael Feathers
Growing Object-Oriented Software, Guided by Tests by Steve Freeman and Nat Pryce
Refactoring to Patterns by Joshua Kerievsky

Find books about Test-Driven Development & Unit testing with JUnit or some other testing framework that have good ratings on this site and on Amazon.com
Authors I like: Kent Beck, Jeff Langr, Lasse Koskela (retired JavaRanch sheriff), Ilja Pruess (also retired sheriff)

I almost forgot, the best book I know about test-driven development:
4 Rules of Simple Design by Corey Haines - lots of ideas for you to do deliberate practice
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!