Related Posts
Let’s get their together!
Additional Posts in Data & Analytics Consultants
Quantile regression should get more love.
Is data science over hyped and over saturated?
New to Fishbowl?
Download the Fishbowl app to
unlock all discussions on Fishbowl.
unlock all discussions on Fishbowl.
Ha, I came across a couple thousand lines written without any functions once. They built a separate demo front end with example data that made the codebase look amazing but the actual code only worked about 10% of the time. If you want to build things that work, don’t stay in consulting
Mentor
I don’t understand how anyone writes code without functions. It seems painful
Mentor
Is it really that tough? Function takes an input and has an output. At minimum shouldn’t we test a few cases and make sure it does what we think it does?
I can’t tell you how often I’ve written a function and think this is fine. Then design a few tests for it and find out it fails all over the place.
This is the big issue with consulting.. especially in a technical field
The m.o. at most places is that "as long as the client is happy.. we're happy". However, most client engagemenrs are akin to putting out fires - and in that context, unit tests aren't really a priority in the heat of the moment
Id definitely say write them if you can, but moreso, try industry after consulting for a bit so you can actually implement sustainable infrastructure & use good development practices
Mentor
I found this at a client fwiw.
Agree that consultants work terrible poorly tested code. The problem is that if it isn’t core to the business clients probably don’t want to pay for high quality code (or even medium quality) code.
I do have a hypothesis that writing tests leads to fewer fires.
Mentor
As an aside my sister informs me that the worst she’s seen is 69K in lines of code with no tests. Which is just baffling.
^ that's not a hypothesis.. its a fact 🙂
It’s tough... especially if there’s no structure or process set in place with the client or codebase
Do you write unit tests for code that isn't productionized? I will write tests if it's part of an automated pipeline, but I generally won't do it if it's for an ad-hoc analysis.
Mentor
If it is some little 200 line script I might not write tests.
If it is anything that I will use repeatedly (e.g. a package) or goes into production it gets tests. If the script is sufficiently complex it probably gets tests.
I am alway reminded of a quote to the effect of, “is it really data science if we don’t know that or code does what we think it does?”
The real version is punchier but I’m blanking on who said it.
Damn @ me next time