Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    still-dreaming-1
    @still-dreaming-1
    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...
    Ben Johnson
    @cbj4074
    I've seen ol' Bob speak. He's a fascinating individual, and I respect his opinion. I need some time to digest this!
    still-dreaming-1
    @still-dreaming-1
    Transformation priority premise: https://www.youtube.com/watch?v=B93QezwTQpI&t=2s
    Ben Johnson
    @cbj4074
    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.
    ttfn
    still-dreaming-1
    @still-dreaming-1
    @cbj4074 Here is the link for my PurposefulPhp: https://github.com/still-dreaming-1/PurposefulPhp
    @cbj4074 And there is the link for the chatroom for any type of PurposefulPhp related chat: https://gitter.im/still-dreaming-1/PurposefulPhp
    Ben Johnson
    @cbj4074
    @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
    FlyLo11
    @FlyLo11

    hello,

    {
      "autoload": {
        "psr-0": {
          "App_": "lib/App/"
        }
      }
    }

    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
    but it was still funny that dump-autoload -o just scans those directories and correctly builds the class map
    Owen Melbourne
    @OwenMelbz
    im not sure myself - have you tried using the classmap or files method?
    "autoload": {
        "classmap": ["lib/App/"]
    }
    FlyLo11
    @FlyLo11
    no, '":"lib/" solved it. i was curious if it was a bug or smth
    i would probably expect a classmap would work too
    Joseph Leon
    @JosephLeon
    Im getting an error "Cannot create cache directory /composer/cache/repo/https--packagist.org/, or is not writable....". I've googled the issue and many said it had to do with a ~/.composer file. However I do not have that, I'm on CentOs if that matters.
    Ben Johnson
    @cbj4074
    @JosephLeon Yeah, I can't imagine the user as whom you are running composer has sufficient rights to create a directory at the root of the filesystem.