Showing revision #ca4d07e1 of page raddit-app/tech-resources


Technical resources useful for learning how Raddle is built

The following is a list of resources that are useful in learning the technologies Raddle is built with.

First, here is our gitlab page:

https://gitlab.com/edgyemma/PostMill

On a personal note, I learnt programming entirely in my spare time using resources I found on the internet, before I went to uni. If you have determination, you can learn to build your own cool software without any formal education. Many of the resources I learnt from are listed here.

Also, note that you cannot simply read articles on the internet and become an expert programmer. You need to get your hands dirty. It was trial and error that taught me how to build large(ish) applications, not reading blogs or watching videos.

-- /u/emma

(emphasis indicates a reference of high importance.)

PHP

The entire backend is written in PHP, so obviously learning the language and some related tools & conventions is a good place to begin.

  • Official PHP manual

  • PSR-4

    Autoloading standard, defines a standardised directory structure for autodiscovery of classes, interfaces and traits.

  • Autoloading explained
    PSR-0 has been superseded by PSR-4, but this is still a good explanation of how autoloading in PHP works and why it's needed.

  • PHP: The Right Way

  • phpDocumentor

    We're interested in the annotation format, not the software. IDEs will use the annotations for better code analysis.

Tools

Symfony

Example Symfony applications

These aren't always good examples, as Raddle tends to adhere to different coding conventions.

Databases, abstraction layers, object-relational mappers

Design patterns

Design patterns that are Bad and Wrong

Okay, these patterns aren't always bad and wrong, but they tend to be used for solving problems that are better solved in other ways.

  • Model–view–controller pattern

    MVC is useful for demonstrating Separation of Concerns. Its usefulness stops there.

    The pattern is an oversimplification of how applications are actually structured, and blindly abiding by the pattern means fitting square pegs into round holes. A web application consists of front controllers, controller methods, routing, templates, entities, DTOs, and many more things. Trying to place all these concepts into three rigidly defined categories is a typical mistake beginners will make when developing their own frameworks, ironically enough, actually leading to breaking SoC.

  • Global Variables Are Bad

    • Raddle doesn't declare or look up a single global variable, except when setting up the application.

    • The God object, a similar evil.

  • What is so bad about singletons?

Software

  • PhpStorm

    Proprietary IDE for writing PHP programs. costs money, but if you're a student you get it for free. Alternatively, if you have IDEA Ultimate or WebStorm, you could add the PHP plugins to either of those and basically get PHPStorm's functionality.


Source code

The following is a list of resources that are useful in learning the technologies Raddle is built with.

First, here is our gitlab page:

https://gitlab.com/edgyemma/PostMill

On a personal note, I learnt programming entirely in my spare time using resources I found on the internet, before I went to uni. If you have determination, you can learn to build your own cool software without any formal education. Many of the resources I learnt from are listed here.

Also, note that you cannot simply read articles on the internet and become an expert programmer. **You need to get your hands dirty.** It was trial and error that taught me how to build large(ish) applications, not reading blogs or watching videos.

-- /u/emma

 (**emphasis** indicates a reference of high importance.)

## PHP

The entire backend is written in PHP, so obviously learning the language and some related tools & conventions is a good place to begin.

* [**Official PHP manual**](http://php.net/manual/en/)

* [**PSR-4**](http://www.php-fig.org/psr/psr-4/)

    Autoloading standard, defines a standardised directory structure for autodiscovery of classes, interfaces and traits.

* [Autoloading explained](https://www.sitepoint.com/autoloading-and-the-psr-0-standard/) \
    PSR-0 has been superseded by PSR-4, but this is still a good explanation of how autoloading in PHP works and why it's needed.

* [PHP: The Right Way](http://www.phptherightway.com/)

* [phpDocumentor](https://phpdoc.org/)

    We're interested in the annotation format, not the software. IDEs will use the annotations for better code analysis.

## Tools

* [**Composer**](https://getcomposer.org/)

    PHP dependency manager and autoloader.

    * [Packagist](https://packagist.org/), Composer's software repository.

* [**PHPUnit**](https://phpunit.de/), framework for automated testing.

* [PHP Coding Standards Fixer](http://cs.sensiolabs.org/)

## Symfony

* [**Symfony documentation**](https://symfony.com/doc/current/index.html)

    * [Symfony components](https://symfony.com/doc/current/components/index.html) -- the Symfony framework is comprised of these.

* [Avoiding entities in forms](https://stovepipe.systems/post/avoiding-entities-in-forms)

## Example Symfony applications

These aren't always good examples, as Raddle tends to adhere to different coding conventions.

* [Symfony Demo application](https://github.com/symfony/symfony-demo/)

* [Packagist](https://github.com/composer/packagist)

* [KnpBundles](https://github.com/KnpLabs/KnpBundles)

* [En Marche !](https://github.com/EnMarche/en-marche.fr) -- the web application of the world's most uninspired political party.

## Databases, abstraction layers, object-relational mappers

* The [**PostgreSQL documentation**](https://www.postgresql.org/docs/current/static/index.html)

* [PDO](http://php.net/manual/en/book.pdo.php)

    PHP's native database abstraction layer. We never use this directly, but DBAL uses an API that is very similar. While PDO provides the same interface for interacting with a wide range of databases, it does not provide any means for generating cross-compatible or vendor-specific SQL.

* [Doctrine DBAL](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/) -- abstraction on top of PDO which includes SQL generation

* [**Getting Started with Doctrine ORM**](http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/tutorials/getting-started.html)

* [Doctrine ORM Good Practices and Tricks](https://vimeo.com/134178140) (video)

* [Doctrine Migrations library](http://www.doctrine-project.org/projects/migrations.html)

## Design patterns

* The [SOLID](https://en.wikipedia.org/wiki/SOLID_(object-oriented_design)) principles

* [When to declare classes final](http://ocramius.github.io/blog/when-to-declare-classes-final/)

* [Pragmatism over Theory: Protected vs Private](http://fabien.potencier.org/pragmatism-over-theory-protected-vs-private.html)

* [**Understanding Dependency Injection**](http://php-di.org/doc/understanding-di.html)

    * [Pimple](https://pimple.symfony.com/), a simple dependency injection container that's easy to set up and learn the dependency injection pattern with.

* [Composition over inheritance](https://en.wikipedia.org/wiki/Composition_over_inheritance)

## Design patterns that are Bad and Wrong

Okay, these patterns aren't always bad and wrong, but they tend to be used for solving problems that are better solved in other ways.

* [**Model–view–controller pattern**](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller)

    MVC is useful for demonstrating [Separation of Concerns](https://en.wikipedia.org/wiki/Separation_of_concerns). Its usefulness stops there.

    The pattern is an oversimplification of how applications are actually structured, and blindly abiding by the pattern means fitting square pegs into round holes. A web application consists of front controllers, controller methods, routing, templates, entities, DTOs, and many more things. Trying to place all these concepts into three rigidly defined categories is a typical mistake beginners will make when developing their own frameworks, ironically enough, actually leading to breaking SoC.

* [Global Variables Are Bad](http://wiki.c2.com/?GlobalVariablesAreBad)

    * Raddle doesn't declare or look up a single global variable, except when setting up the application.

    * The [God object](https://en.wikipedia.org/wiki/God_object), a similar evil.

* [What is so bad about singletons?](https://stackoverflow.com/questions/137975/what-is-so-bad-about-singletons)

## Software

* [**PhpStorm**](https://www.jetbrains.com/phpstorm/)

    Proprietary IDE for writing PHP programs. costs money, but if you're a student you get it for free. Alternatively, if you have IDEA Ultimate or WebStorm, you could add the PHP plugins to either of those and basically get PHPStorm's functionality.