Conference Legal Disclaimers

After deep consideration with our lawyers, we would like to follow suit with Oracle and provide you with the following legal disclaimer about our jOOQ-related conference talks, as presented at the awesome GeekOut conference in Tallinn. Please do read them and take them seriously.

THE FOLLOWING IS COMMUNICATED TO YOU SOLELY FOR ENTERTAINMENT PURPOSES. NO ONE SANE WOULD BELIEVE A GUY WHO CLAIMS HE IS A SQL AFICIONADO OR WORSE WHO CLAIMS THAT SQL IS ANYTHING NEAR BEAUTIFUL. IF YOU STILL FIND THE FOLLOWING INTERESTING AND IF YOU BASE YOUR PURCHASING DECISIONS UPON THAT, YOU DEFINITELY NEED PROFESSIONAL HELP. WE ACTUALLY PROVIDE SUCH HELP.

Spring API Bingo

For the occasion of today’s date, I’ve just invented a fun game. The Spring API Bingo! How does it work?

Let us write the following little piece of code:

public class SpringAPIBingo {
    public static void main(String[] args) {
        // Any similarities with actual API
        // (e.g. that of Spring) are completely 
        // accidental
        List<String> terms = Arrays.asList(
            "Abstract",
            "Adapter",
            "Adaptor",
            "Advisor",
            "Aware",
            "Bean",
            "Class",
            "Container",
            "Data",
            "Definition",
            "Delegate",
            "Delegating",
            "Destination",
            "Detecting",
            "Disposable",
            "Entity",
            "Exception",
            "Factory",
            "Handler",
            "Info",
            "Initializer",
            "Initializing",
            "Local",
            "Loader",
            "Manager",
            "Mapping",
            "Persistence",
            "Post",
            "Pre",
            "Resolver",
            "Source",
            "Target",
            "Translation",
            "Translator"
        );

        // [...]

So far so good. We could use more terms if we wanted to but for now, these will suffice.

Now, let’s shuffle the above list and create names of length 2-5 terms. Easy as pie. We’re using Java 8 for this. So our programme above continues like so:

        // [...]

        System.out.println("<table>");
        System.out.println("<tr>");

        for (int i = 0; i < 25; i++) {
            if (i > 0 && i % 5 == 0)
                System.out.println("</tr><tr>");

            System.out.print("<td>");

            Collections.shuffle(terms);
            System.out.print(
                terms.stream()
                     .limit((long) (2 + 
                          Math.random() * 4))
                     .collect(Collectors.joining())
            );

            System.out.println("</td>");
        }

        System.out.println("</tr>");
        System.out.println("</table>");
    }
}

As you can see, the above generates a 5×5 HTML table of random names. As this blog is not wide enough for a 5×5 table, let’s break down the table for readability purposes:

Column 1
ClassContainerPost
FactoryAdvisorAdapterHandlerLoader
AdvisorMapping
ResolverAdaptorTranslatorEntity
LocalEntity
Column 2
AdaptorExceptionDefinitionPreMapping
TranslatorLoader
ContainerPreTranslatorInfoDisposable
TranslatorPostFactory
PreClassResolver
Column 3
DetectingDelegatingAdaptor
ContainerLocalTranslation
DetectingClass
DefinitionManagerDisposableAbstract
MappingDelegatingPersistenceAbstractHandler
Column 4
PreMappingDetectingClassAdapter
ManagerResolverExceptionBeanAware
BeanFactoryDestinationResolver
TranslationBean
LocalPersistenceManagerFactoryBean
Column 5
ExceptionLocal
InfoPreSourceBeanFactory
AbstractBeanDefinition
PersistencePre
DisposableBean

Now, let’s go visit the Spring Javadoc. We’ll take version 4.0’s allclasses page for optimal winning chances. Go back to your 5×5 table and mark all matches.

Now let’s check if we have 5 matches in a row, bingo!

Column 1
ClassContainerPost
FactoryAdvisorAdapterHandlerLoader
AdvisorMapping
ResolverAdaptorTranslatorEntity
LocalEntity
Column 2
AdaptorExceptionDefinitionPreMapping
TranslatorLoader
ContainerPreTranslatorInfoDisposable
TranslatorPostFactory
PreClassResolver
Column 3
DetectingDelegatingAdaptor
ContainerLocalTranslation
DetectingClass
DefinitionManagerDisposableAbstract
MappingDelegatingPersistenceAbstractHandler
Column 4
PreMappingDetectingClassAdapter
ManagerResolverExceptionBeanAware
BeanFactoryDestinationResolver
TranslationBean
LocalPersistenceManagerFactoryBean
Column 5
ExceptionLocal
InfoPreSourceBeanFactory
AbstractBeanDefinition
PersistencePre
DisposableBean

Only four hits. Better luck next time.

Next week: Facebook Bingo

We’ll write down 25 tech companies in a 5×5 grid. Then wait until Facebook buys new companies. If you got 5 in a row – Bingo!

The 10 Commandments of Programming

Patterns 34:29

As Turing descended from Mount Compute – with the two iPads of the testimony in his hands as he descended the mountain – he did not realize that the skin of his blog shone as a result of his Compiling the Code.

Patterns 35:1

Turing assembled the entire Geek community and said to them, “These are the things that the Compiler has commanded you to do:”

  1. Thou shalt not GOTO
  2. Thou shalt not TODO
  3. Thou shalt not catch all
  4. Thou shalt not <br>
  5. Thou shalt not label thy code to break or continue
  6. Thou shalt not bear false witness or side effects in getters
  7. Thou shalt not neglect your curly braces
  8. Thou shalt not desire the Unsafe
  9. Thou shalt not covet your neighbor’s private fields or methods
  10. Thou shalt not deceive with cleverness in names

But the Geek community did not obey, and the Compiler was not amused:

Disclaimer

Neither Turing nor the Compiler may not have actually said these things