Skip to content

Latest commit

 

History

History
44 lines (35 loc) · 2.48 KB

README.md

File metadata and controls

44 lines (35 loc) · 2.48 KB

Mini-Design Patterns

##Why? I often mentor/coach more junior members of the software team so wanted to use this project as a basis for presenting to juniors some cute designs I have learnt or used.

##Why Gradle? It's as pure and simple as me not using it before 😄 I have used Maven and Ant and thought I would try the new kid on the block (at least new to me 😉)

##What can be contributed? Anything you think might help. There are a lot on Design Patterns online but I to show here some of the mini-design patterns that you pick up after many hours of coding and working with different people. These are the mini patterns you do not necessarily pick up in a book.

##My Coding Mantra There are some coders that believe the more complex the code the better they are. This can be especially prevalent in more junior developers. This is the complete opposite of my thought process. If you are over complicating a problem then you are making it hard for others to read, making it hard for others to maintain and actually showing your fellow workmates that you do not have very clear thought processes. After all logic is logic and should and can be broken down into discrete simple chunks. Code should be simple and easily read. Other people should read your code and without hard thinking or head scratching see what is happening and as a bonus even learn some mini-design patterns

Please please please along with this project read more on Design Patterns

Code can and should be elegant

Just my philosophy so you can get to know who I am and if you want to help contribute to this project

  • Do not commit code after midday on a Friday. Review again on Monday and see what mistakes you made at the end of the week
  • Keep things simple. If they are getting too complicated then divide and conquer. Logic at its most basic level is quite simple.
  • Unit test everything!
  • Always ask for help if needed. Even just talking about a problem can make it clearer

##Contents These will be added to as I transfer my notes online to this project

  1. How to throw more informative exceptions
  2. How to easily count the number of days in the year so far
  3. A correct case statement design
  4. How to count in steps of n
  5. Populating Maps/Lists
  6. How to write unit tests that read files without having external dependencies on files
  7. InstanceIds
  8. String formatting in Exceptions
  9. Pair and Triplet
  10. Check exceptions are gracefully handled
  11. Checking if A equals B or A equals C or A equals D
  12. Translation Numbers