In one organization, I have even had two seniors go back and forth telling me to remove what the other senior told me to put in.
The entire process of defining "clean code" seems painfully arbitrary.
11–20 of 395 posts
In one organization, I have even had two seniors go back and forth telling me to remove what the other senior told me to put in.
The entire process of defining "clean code" seems painfully arbitrary.
Theres definitely clean code, theres just no rule book for how to define it or course you can teach for how to write it. Some people are just better at the art of writing simple software. You definitely know it when you see it.
Well sure, but that's like saying "there's no such thing as beauty" or "there's no such thing as a well-written book". Clearly bullshit. They might be somewhat subjective and have no mathematical definition but they clearly exist.
Earlier quoted context omitted.
20 short functions definitely sound as though they should be explicit. Named, documented, testable. 1 or 2 you could get away with being implicit. 20 requires a lot of understanding as to what's going on!
Wait until you work on a 100k line code base where someone enforced this kind of thing
Earlier quoted context omitted.
20 short functions definitely sound as though they should be explicit. Named, documented, testable. 1 or 2 you could get away with being implicit. 20 requires a lot of understanding as to what's going on!
Task: write code that does genetic programming by applying combination of 20 specific 5-line functions in random combinations and comparing results. My solution: array of lambdas Your solution: array of references to functions named f1 .. f20. Which is cleaner?
* if anyone not get it, ts/js can declare a key-value lambda like:
let myFunc = {f1: () => , f2: () => } and so on. It can be called by string key like myFunc["f1"](), and all it's props can be get by Object.keys(myFunc) so it can be randomized easily.
I personally like "clean" as a term for code quality. We've all seen how focusing on easily measurable metrics (like code coverage) can help, but in the hands of the saboteur or the clueless it just becomes a meaningless number. "Clean", instead, focuses on the ultimately human judgement of how to make code which is fit for purpose.
Coding is a highly subjective and creative endeavor. "Clean code" is akin to "well written" for writers. Sure, you can analyze and even be able to define some good practices, but because we are always creating something new that has never done before, and the field is infinitely complex, no rules can be set in stone and applied across everything. In my opinion there's nothing wrong with calling code clean, we don't h…
I'm not giving up on clean code, but at the last 5 years I pursuit separation of pure function and unpure function more than clean code. It makes easier to debug / unit tests.
Coding is a highly subjective and creative endeavor. "Clean code" is akin to "well written" for writers. Sure, you can analyze and even be able to define some good practices, but because we are always creating something new that has never done before, and the field is infinitely complex, no rules can be set in stone and applied across everything. In my opinion there's nothing wrong with calling code clean, we don't h…
I'm not giving up on clean code, but at the last 5 years I pursuit separation of pure function and unpure function more than clean code. It makes easier to debug / unit tests.
Earlier quoted context omitted.
20 short functions definitely sound as though they should be explicit. Named, documented, testable. 1 or 2 you could get away with being implicit. 20 requires a lot of understanding as to what's going on!
Task: write code that does genetic programming by applying combination of 20 specific 5-line functions in random combinations and comparing results. My solution: array of lambdas Your solution: array of references to functions named f1 .. f20. Which is cleaner?
Earlier quoted context omitted.
20 short functions definitely sound as though they should be explicit. Named, documented, testable. 1 or 2 you could get away with being implicit. 20 requires a lot of understanding as to what's going on!
Task: write code that does genetic programming by applying combination of 20 specific 5-line functions in random combinations and comparing results. My solution: array of lambdas Your solution: array of references to functions named f1 .. f20. Which is cleaner?