Handling nils in CSV's using Ruby

How to handle nils in CSV data Recently I’ve had to work a lot with CSV’s and I’ve learned the hard way that the data within these aren’t always what you expect. Why would there be no number associated to a name or part? Why no name for a number or part and so on. Below is the strategy I’ve adopted to handle this case. Fetching the data We want the headers to return as symbols because I don’t trust the position of the rows in the future....

May 3, 2020 · 2 min · 226 words · Me

Takeaways from POOD

Notes from Sandi Metz “Introduction to Practical Object-Oriented” Object-Oriented Design Object-oriented design (OOD) is about managing dependencies Objects shouldn’t know too much about each other Design is an art of arranging code Write code for the feature you’re developing today, but also changeable in the future You can’t predict what changes will be needed in your code, merely that change will occur Tools for a OOD ➡️ principles and patterns Design principles [S]ingle responsibility [O]pen-closed [L]iskov substitution [I]nterface segregation [D]ependency inversion We can look to quantify “good code” Design patterns Name common problem and solve the problems in common ways Patterns are like a tool, it’s the user who must master the pattern/tool Act of Design “Programmer’s past experience does not predict the future” This especially hits home for me as I’m learning....

April 18, 2020 · 2 min · 266 words · Me