Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
neeno31724yFor some reason I almost never do that. Seems I'm "weaker" if I do that. I know it's stupid, but idk why I think this way.
-
C0D4681454y@netikras well yes and no.
Tdd contains the expected result for a unit of work, not how to get to it.
For planning I find a big ass whiteboard and work through it before I touch a line of code when it's going to be a complex matter.
Know what you're trying to achieve before you set out to achieve it, otherwise it'll bit your ass halfway through when you miss something. -
@C0D4 Depends on how you do TDD.
1. create an empty test method
2. write pseudocode with method names:
createThreadPool();
createTask();
sendTaskToPool();
assertTaskProcessed();
3. go and implement each method in the same manner: pseudocode method names -> implementation -> pseudocode -> implementation -> etc.
it's like pseudocode-driven-tdd :) It makes building new features very easy as you
1. define your end goal (test method)
2. define steps required to achieve that goal
3. define steps to achieve those steps
4. ↑↑ -- repeat until you have no pseudocode to write and end up with actual code.
I still find whiteboard useful for planning at larger scale -
C0D4681454y@netikras ah, yea I usually just plan it out, write up the unit tests with expected results (hard coded to begin with) then as the the code progresses adjust the tests to work with actual data.
But yea, it really comes down to how you do things. -
hjk10157314yI have learned that is the most complicated logic situations you need to ask questions first. This is not a time saver (well in the long run perhaps and definitely for the end user, but not for you).
Does this logic truly represent the real world? (Convoluted reasons with a lot of "might" and "will" in it)
Why is it this so complex?
Is there a better way to solve the problem? (Look at how these things are solved normally)
Basically getting to the simpler solution is the right way to do it. It's bloody hard though and often requires process changes. -
Root825564yReally complicated Boolean logic goes into wolfram alpha. Makes me look like a genius. 🤫☺️
Related Rants
-
nikmanG16CS Professor: “What M word is the black hole to all productivity?” Student: “Management” CS Professo...
-
jsombrio28They just bought 2 fucking 23" extra monitors for every developer in my org. FEELS GOOD MAN
-
cjaro5We just spent 30 minutes standing around watching Elon Musk launch his car into orbit. I love working in IT.
Programming lesson #5
When logic becomes too complex to solve mentally while coding, writing the requirements and inputs on paper and coming up with pseudocode is a good approach.
random
problem solving
productivity