Angular 2 is terrible

“We used Angular 2 for our frontend. I was not involved in this decision, and I came to work on the frontend relatively late in the project. This post is not meant to be a comprehensive review of the framework, but rather a collection of observations after using it for a little more than two weeks. I don’t claim that using it for two weeks makes me an expert, and welcome any corrections, but for what it’s worth, I consider using Angular 2 one of the biggest mistakes for our project …

Read more at:

https://meebleforp.com/blog/36/angular-2-is-terrible

 

RomVer – Romantic Versioning

Given a version number HUMAN . MAJOR . MINOR,  increment the:

  1. HUMAN version when you make any conceptual change, major rewrite, major documentation changes or any other change which requires additional HUMAN involvement.
  2. MAJOR  version when you make incompatible API changes,
  3. MINOR version when you add functionality in a backwards-compatible manner, or fix with backwards-compatible bug fixes.

Additional labels for pre-release and build metadata are available as extensions to the HUMAN . MAJOR . MINOR format.

Continue reading

Laravel Blade directive for conditional HTML classes

Sometimes you need to add classes to HTML elements conditionally, and when you try to do that you almost always end up with messy syntax. Here’s the example in Blade:

<article class="post post-{{ $post->slug }} @if ($post->featured) post-featured @endif @if ($post->sticky) post-sticky @endif">
    ...
</article>

Or with pure PHP:

<article class="post post-<?php echo $post->slug ?> <?php if ($post->featured): ?>post-featured<?php endif ?> <?php if ($post->sticky): ?>post-sticky<?php endif ?>">
    ...
</article>

And if you split it into multi-line you get even worse, and when you add even more conditional classes you get if mess.

Continue reading

Symfony2 – Translation in the right way

Many times when project is almost done, customer brings you a “a great new idea”  and say:

My website will be international so I want to be translated on many languages!

And they give you few days to done that task, so you must turn on your super powers and do all magic that you know.  Fortunately there is one great thing, that you can do with Symfony 2 framework.  So let’ the magic begin!

Continue reading