pjurczynski / inmate_kata

Greegko and Piotr are both prisoners, locked in a solitude. There's nothing else left for them other than improving their coding quality together.. 15 minutes at a time.
GNU General Public License v3.0
1 stars 0 forks source link

Problem: Reverse Polish Notation #5

Open pjurczynski opened 4 years ago

pjurczynski commented 4 years ago

Base article: https://en.wikipedia.org/wiki/Reverse_Polish_notation

pjurczynski commented 4 years ago

I read the article once again and I think I know what we did wrong the first time (apart from not reading the instruction first and going bare foot into the fire ;)).

First, split the problem in two areas

  1. Binary operations
  2. Unary operations

Next, tackle only one type of operations (we did that, but I think I got distracted by the fact we're not covering the other case and I got a thinking block). This might close ourselves from some optimal answers, but this feels easier when you don't have an idea how to solve a problem.

Let's do the same. Let's focus on binary calculations.

Another problem I had is I thought that TDD could magically find an answer to a problem by going step by step. But now I think you still need to have a plan in your head, and try to follow it step by step (I think you already said that but with different words).

Currently I have two ideas - binary tree, or a similar approach we had before, but this time working ;). I'll think more later.

Greegko commented 4 years ago

Well actually, you should be able to find the answer during developing it, because you are facing the implementation and see how it is really working, but that's true if you have a strong vision how would you implement it, that won't throw you back.

Greegko commented 4 years ago

But that's the point, if you do not read that, we could have discussed what we made wrong and how could have done better what could have discuss during testing, now you spoiled the fun!!

Anyway let's focus on Binary operations I agree with it, also I open for anything (I am still open this question from my side even during TTD, that we can see how we want to implement it when we are actually see it works or not)

pjurczynski commented 4 years ago

But that's the point, if you do not read that, we could have discussed what we made wrong and how could have done better what could have discuss during testing, now you spoiled the fun!!

I have only read the definition, not the implementation nor the pseudo-code ;) - so we're safe, we can still discuss :). You cannot do TDD if you don't know the problem.