Today I Learned


There is a list of The All-Time Top 150 i-Technology Heroes.

According to Steve McConnell, rapid development consists of balancing between four pillars:

  • Classic mistake avoidance
  • Development fundamentals
  • Risk management
  • Schedule-oriented practices


Magento’s way of handling logical expressions through search criteria and its internal filter/filter group builders is poor.

Conditions like (A and B) or (C and D) are not directly supported, and you have to do distributed laws magic to handle them.


Magento supports batch resolvers that can help you to fetch additional data for entities without querying each item separately.

class RelatedProducts implements BatchResolverInterface

    public function resolve(ContextInterface $context, Field $field, array $requests): BatchResponse
        //Get the list of products we need to load related products for
        $rootProductIds = array_map(function ($request) { return $request->getValue()['model']->getId(); }, $requests);

        //Load the links
        $productLinks = $this->service->getRelatedProductLinks($rootProductIds);

        //Sort the links
+        $response = new BatchResponse();
+        foreach ($requests as $request) {
+            $response->addResponse($request, $productLinks[$request->getValue()['model']->getId()]);
+        }

        return $response;


A perfect solution to a problem does not exist. There are always tradeoffs along the way and snappy specification or API changes might shred even the brightest ideas.


There are only a few possible ways approach to testing can go:

  • Test First (TDD)
  • Test During
  • Test Never (often derives from “Test Later”)


As a developer, you’ve been trying things and seeing which worked and which didn’t. You’ve been accumulating experience and wisdom. When you feel a nagging doubt, or experience some reluctance when faced with a task, it might be that experience trying to speak to you. Heed it. You may not be able to put your finger on exactly what’s wrong, but give it time and your doubts will probably crystallize into something more solid, something you can address. Let your instincts contribute to your performance.

D. Thomas, A. Hunt – The Pragmatic Programmer


There is an Agile Manifesto that boils down to:

Individuals and interactions over processes and tools
Working software over comprehensive documentation
Customer collaboration over contract negotiation
Responding to change over following a plan


You might sometimes end with superficial requirements that need further clarification. Don’t assume anything. Just ask the right people to get a better understanding.


You can change the default vendor directory path that is used for autoloading classes through app/etc/vendor_path.php

You can pass the custom object manager factory as the third argument of Bootstrap::create that is called in pub/index.php


Magento is wrapping it’s caching around Zend_Cache.

All cache type instances must implement Magento\Framework\Cache\FrontendInterface either directly or through inheritance of one of the decorators:

  • Magento\Framework\Cache\Frontend\Decorator\Bare – a decorator that attaches no additional responsibility to a decorated instance
  • Magento\Framework\Cache\Frontend\Decorator\Logger – a decorator that logs cache invalidation actions
  • Magento\Framework\Cache\Frontend\Decorator\Profiler – a decorator that performs profiling of cache operations
  • and… preferably Magento\Framework\Cache\Frontend\Decorator\TagScope – a decorator that limits the cleaning scope within a tag


Andy Sloane wrote the donut animation in c, and the source code is also a donut.

Source code

             k;double sin()
         ,cos();main(){float A=
       0,B=0,i,j,z[1760];char b[
 >i;i+=0.02){float c=sin(i),d=cos(j),e=
 h*e+f*g+5),l=cos      (i),m=cos(B),n=s\
in(B),t=c*h*g-f*        e;int x=40+30*D*
(l*h*m-t*n),y=            12+15*D*(l*h*n
+t*m),o=x+80*y,          N=8*((f*e-c*d*g
 )*m-c*d*e-f*g-l        *d*n);if(22>y&&


image source: Quora


You can use Magento\Framework\GraphQl\Query\Resolver\ArgumentsProcessorInterface to process GraphQL arguments.

You can use Magento\Framework\GraphQl\Query\Resolver\Argument\ValidatorInterface to validate GraphQL arguments.

You can set up an SSH tunnel connection in DBeaver to connect to remote databases that are not exposed.


mview.xml is only adding MySQL triggers when the indexer is updated On Schedule


You can adjust Elastic Search queries and filters through search_request.xml but if you want to add them dynamically, there is no easy way besides plugging into the core codebase.