4 ms·
> I'm half way through my time on this task already and I haven't even touched the unit tests. Well, generally, if you're wanting to do TDD/BDD, start with the
by MalcolmDiggs 11y ago
> I'm half way through my time on this task already and I haven't even touched the unit tests.
Well, generally, if you're wanting to do TDD/BDD, start with the tests first. Then write your code until the tests pass. That being said, TDD/BDD isn't exactly a timesaver in most cases, so I'd understand why you'd do it in the opposite order.
But anyway, to answer your question: I write a crappy/sloppy solution first, as fast I can. No thinking... just pretend you're coding for fun on a low-stakes project that nobody will ever see. Then I go back and try to plan a better way to do it. If I can refactor/recode it before the timer goes off, then that's great. If I can't, no biggie.
- loumf 11y agoThis is even more true in the live interview. You need to start doing something early -- just say: "I'm going to code something up quickly, and then I'll try to improve it" -- then write out something.