Comments by "Christian Baune" (@programaths) on "ArjanCodes"
channel.
-
1
-
@DoCLov I have only 13 years in the idustry, but also routinely joined gifted programs. That's why I indeed know about code that is isomorphic. That's something you only learn in advanced classes and no experience can really get you there, unless you are a purist. That's why I wrote that blindly adding tests and educating people on this makes much more harm than good.
I saw quite a few projects tanking under big tests with project managers happy to say that they write 99% of test and 1% of code. Not even seeing the issue. Also, they actually never really refactor, because the cost was too great and new features requires a lot of reviews etc.
I have also seen companies you would probably laugh at with your 20 years of experience, but who are very agile and have really good tests. A few, very high level ones who don't care about inner working, just about in and out.
When I was a junior, I blindly wrote unit and functional tests. Vastly ignoring UC tests 🤣
Few years in, seeing those companies, I realized I was an idiot. When refactoring, I also had to refactor tests. When working in those companies, I seldom had to fix the tests themselves and it clicked.
As for isomorphic code, I learned the fiundation during CS then I researched on my own to give a talk at the university I studied a few years later. That's the kind of process you need to use for software going to the moon and in some industries. Also, my formal training is in industrial computing, so the code we can deploy can kill hundred of people. Now I work in "management systems", but the same apply for code that is less crucial. I.e. If I can rewrite code that is proven for a press, I cam write code that is proven to list some rows from the database ^^
I am trying to leave the field, because things have changed too much and overall, quality did lessen and I have hard time cutting corners and testing was never enough to me.
Just to give you an example, most developers totally ignore that they can document preconditions, postcoditions and fixed points in their code and have them checked at runtime while testing. (when releasing, that code is not even executed).
On top of 12 years, the only time I read such assertions was...in my own code! Worse, I even had colleagues "cleanup the junk".
So, yes, programming has changed a lot. It will kick in for you in 10 or so years 😁 Also, it depends on your formal training. If you did CS in System Management, then a lot of the "purity" is removed as in the worse case, code you produce will crash a site or application and not cut the hands of someone.
I wouldn't be able to back to IC as I probably lost quite some skills as it's very close to the metal too, and I switched to SM...but that "quickly" pissed me off ^^
Now, I am still guilty of writing unit tests. I do that when the code I am going to write will be complex and never touched again. ("never" is highly relative here)
I also write functional tests when the feature can be kept standalone for much faster iteration. At that point, the functional test is almost a UC test.
But for sure, if you write a unit test, you've to have a better reason than "to detect a change of behaviour". Good reasons are complexity, not being intuitive or overly used. And even, that last reason is dubious as good UC tests should spot it. Otherwise, that means you've code independant of its input...
Another good use of UT, is when you've juniors or third party. Coupled with CI it give them a good feedback.
It really boils down to cost of maintenance and wethever it's worth. But UT are usually too closely mirroring implementation to be useful.
1
-
1