DEV Community

Zach
Zach

Posted on • Updated on

Some Wins Today

Today (W4D1) was a good day.

We're continuing our movement into back-end development, which I appreciate majorly. And although I didn't make much progress on today's sprint (not counting yet another great partner), I did notch a few wins throughout the day.

Sum'n small:

Using VSCode intelligently

This one's a two-parter.

  • Multi-Page Search (Search All) is powerful. While it might be a job better suited for debugger, I used the multi-page search to investigate where and how a specific function was used throughout the codebase. Rather than jump from function call to function call and hope to hit whatever lines of code I'm aiming for, multi-search brings my attention immediately to those lines. Once there, I can make sense of the links between, and usage of, those functions.
    [I still have to get a handle on the debugger]

  • Mining the testing files for insight into the solution. Not to help find the solution, like as a short-cut for the problem-solving process. Instead for clues on things like formatting - when you're not sure what type of values the test expects to see. Or to get another read/interpretation of the prompt; there have been times that I thought I was solving for one thing, but the test was looking for something else. It's times like those that inspecting the tests can get you out of a jam.

  • [I'm adding more tips here as they come] Hovering over pieces of code can save you from searching the code base for function definitions or console.logging values.

Using 'this' organically

Not in some test code or with some toy functions or classes, but out in the wild - inside of a React class component. One of my functions was passing through a click handler and I was getting an error indicating that the prop (it might have been something else) that it was attached to was undefined. Enter .bind, which created the association between object and method that I needed.

I wrote the other day about hoping to be able to identify the appropriate use of .bind. Well, problem solved and mini-mission accomplished.

One-shotting a toy problem.

So, not the toughest toy problem today. But it gave me a few reasons to be proud of myself.

  • First, I was able to manage two solutions - one iterative and one recursive.

  • Second, while the recursive solution was nearly identical to the RockPaperScissor problem from a week or two ago, I was able to work the problem with much greater confidence this time. It gives me confidence that I am improving and that when the time comes to lay down these skills in an interview, I'll be able to.

  • Finally, I one-shotted both implementations. That is, minus a typo here or there, my code ran correctly on my first attempt. The reasoning, structure, and even accessory pieces (helper arrays etc) were all right on my first pass. I chalk it up somewhat to familiarity with the problem, but more importantly to an improved problem-solving process, to increased thoughtfulness and deliberativeness in every stage
    -- asking myself 'am I sure that this will happen at this point?' -- and to slowing things down and white-boarding effectively.

It felt great.

Top comments (0)