Dependency Manager for PHP https://getcomposer.org/
People
Repo info
Activity
still-dreaming-1
@still-dreaming-1
it is called the transformation priority premise
Ben Johnson
@cbj4074
Do tell... what's the basic nature of it?
still-dreaming-1
@still-dreaming-1
Basically he was promoting the "3 laws of TDD" for a while
Write just enough of a test for it to fail
Write just enough production code to make the test pass
Ben Johnson
@cbj4074
(need to step away for a few, but will check back after, keep it rollin'!)
still-dreaming-1
@still-dreaming-1
I forget the 3rd law but, it might be refactor...
Anyway, eventually he asked the question, what is to stop someone from continuing to write really stupid code to make the tests pass?
For example, if a function needs to return 5 for a given input, you could make it look for that exact input and return 5, then the test will pass
of course that is not the correct code and the implementation would never be complete
But he actually promotes writing code like that to get the very first tests to pass.
So the principal that tells you not to keep writing stupid code to make the tests pass is this:
When changing the tests, make them more specific. When changing the code make it more generic.
The transformation priority list has some different ways you can make the code more generic in order of priority.
I think the way the list works is, if you are able to use the transformation type at the very top of the list to make the tests pass, that is ideal because it is the most generic change you can make to your code
Anyway, he really seems to be onto something with this list. He claims that if you follow this process while writing a sorting algorithm, you end up writing quicksort by accident!
still-dreaming-1
@still-dreaming-1
So when you follow this very short circle process of the 3 laws of TDD and the priority list, programming starts to feel, really stupid.
You would expect that maybe you can write algorithms that work, but are they actually good? Are they efficient? Well it turns out they are extremetly efficient. You end up writing better algorithms than if you used a more "intelligent" approach.
Ben Johnson
@cbj4074
@still-dreaming-1 Have you put this all into a Medium article? If not, you should!
(or if one already exists, provide the link! :P)
still-dreaming-1
@still-dreaming-1
But by that point, Uncle Bob is getting so prescriptive with this process for writing code that, you could almost teach it to a computer program...
Thank you! Great material that deserves due consideration. That's a wrap for me, but it's been a pleasure! Looking forward to seeing you in this channel regularly!
still-dreaming-1
@still-dreaming-1
So basically I want to try to find a way to write a function that accepts an executable contract, whatever parameters were passed in to the function being called, and then attempts various algorithms to fulfill the contract and utilize the transformation priority premise to alter its own algorithm. Once the contract has been fulfilled, it returns, and it doesn't matter if the algorithm used is "complete" or not because the contract was fullfilled.
@still-dreaming-1 Awesome! Thank you! I will check that out :thumbsup:
Mike Schinkel
@mikeschinkel
@cbj4074
"Be aware also of installed.json"
Yes! That just bit me yesterday.
Ben Johnson
@cbj4074
@mikeschinkel :thumbsup: :D
Ben Johnson
@cbj4074
Does anyone know precisely which phase of composer update | install checks/recreates the binary symlinks?
I'm curious if there is a means by which to "force" that process to occur without having to do something hacky, like composer --no-scripts update fake-repo-to-force-bin-symlinking
hellboy81
@hellboy81
Hi
Is this chat dead or alive?
Ben Johnson
@cbj4074
@hellboy81 I think we're the only two here
(I say that tongue-in-cheek, so to speak)
hellboy81
@hellboy81
I have big trouble with autloader
How can I test PSR-4 autoloads?
Owen Melbourne
@OwenMelbz
try use the thing your autoloading - if it works, it works, if it doesnt it doesnt :D
this fails to load class App_Test_MyClass located in lib/App/Test/MyClass.php when doing composer dump-autoload it works only with composer dump-autoload -o am I missing something?
it works only when defining it as "":"lib/"
Owen Melbourne
@OwenMelbz
tried psr4 autoloading instead?
dont think psr0 autoloadings been supported for several years now
FlyLo11
@FlyLo11
yeah, i suppose so
Owen Melbourne
@OwenMelbz
might find more docs/articles giving better help with that
FlyLo11
@FlyLo11
from looking at the ClassLoader code, it replaces the underscore with a backslash, so App_ becomes App\, it assumes it's supposed to be a namespace
seems confusing, in docs it provides an example with underscores, i thought that means it expect partial class name, not a namespace