When comparing Slim vs Pug (previously Jade), the Slant community recommends Pug (previously Jade) for most people. In the question“What are the best HTML preprocessors?” Pug (previously Jade) is ranked 1st while Slim is ranked 3rd. The most important reason people chose Pug (previously Jade) is:
Ranked in these QuestionsQuestion Ranking
Pro Well organized and thorough documentation
Slim's documentation is well organized and detailed, every concept is thoroughly explained and it is very helpful for both advanced users and beginners.
Pro Open source
The Slim Framework is open source and is released under the MIT public license
Pro A good starting point
Slim is minimal and that is a good thing if you want to start from there. It can be easily extended and even supports popular packages that are used in Laravel (like Illuminate\Database (eloquent)) for example.
Pro Hooks for executing code at different points in its life-cycle
Slim supports code hooks for executing functions at different points in time during the application's lifecycle.
Slim doesn't demand that you stick to a fixed folder structure. As long as you load Slim the right way you can do anything from there the way you like it.
Pro REST based
REST fans will love the REST based architecture.
Pro Supports tie-ins for Rack-like middleware
Rack is an interface used in Ruby frameworks used to group and order modules, which most of the time are Ruby classes, and specify between them.
Slim uses a simple concept for it's middleware. By wrapping HTTP requests and responses it unifies the middleware into a single method call.
Pro Useful classes
Contains classes for managing requests, responses, cookies, logging, views, HTTP caching, and more.
Pro Supports Php 5.3 and PHP 7
Pro Extremely lightweight
Paired with swoole it's a micro service powerhouse
Pro Clean syntax
Pro Reuse code in other langauges
Con Very little consistency among different versions
There have been quite some changes that break the compatibility between Slim 2 and Slim 3. Even if you learned how to work with the Slim 2, you will find that Slim 3 requires re-training.
Con Dependency injection is too weak
It is not really dependency injection, but just a configurable container.
Con Too minimal
While it's true that Slim is a microframework, it's still too minimal. When used for throwaway projects or simple prototypes, it's perfect. But in the long run, it becomes less and less useful and you end up in implementing a full custom framework in trying to tackle all the missing features.
Con Unforgiving in case of indentation errors
The structure is entirely determined by the indentation. That means that indentation errors will ruin the end result, often without an easy way to find the error. Indentation errors are easily introduced by copy-pasting, by rearranging code and by working in a team where not everyone uses the same indentation style. (E.g tabs vs. spaces.)