laszer25 / Cipher-Texts

0 stars 0 forks source link

Focus on Object orientation and Maintainable Software Development #1

Open tacticiankerala opened 10 years ago

tacticiankerala commented 10 years ago

Please try to understand and appreciate the fact that Functional code is the step 0 for coding. Software development is well beyond writing functional code. It is also about writing maintainable and readable code.

When you become a software engineer, you will be interacting with individuals like yourself. You want them to just look at your code and understand it, without your presence(because that is what happens most of the time).

Show this code to your friend who knows some JAVA and ask him/her to describe the problem that you have tried to solve. If he/she takes more than 10 mins to come up with the problem statement for your solution, you have to realize that a huge problem exists there WRT readability and thus maintainability (Because software is written to be extendable and the requirements are seldom frozen).

So, How do we solve this problem.

Object Orientation
Specs/Specifications (Test Cases)

How to move towards this?

Read the following books:

  1. Head first object-oriented analysis and design
  2. Refactoring by Martin Fowler
  3. TDD by example by Kent Beck
  4. SOLID principles by Uncle Bob
  5. http://rubylove.io/2014/04/26/as-a-new-rubyist-what-can-i-do/

The main reason that you are even getting this from me is because of the below reasons:

You are awesome. You can do better. Push yourself into becoming a remarkable programmer.

laszer25 commented 10 years ago

Thank you for your feed back. It is very much appreciated

I agree with the problems you have pointed out. That the source code must be readable and maintainable.

I will try to make the code readable and more maintainable. But I've never really had formal training on how to write readable and maintainable code. As you can see I have shifted the cryptography to a Solver class hence hopefully making the code more object oriented.

However there is a case in the problem where the solution is not very straight forward. It is impossible for me to identify when to encrypt/decrypt the string if it fills up the matrix and doesn't contain '*' and is not confound to a square matrix. In that case I cannot Identify whether the input is to be encrypted or decrypted. How would you advice me to approach this problem. For the movement if such a case occurs I am just giving both the encrypted and decrypted strings.

I hope to become better at programming. And this has never crossed my mind as all the programming I have done was algorithmic and the output was all that mattered.

Thank you for the recommendations. I will look into them.