Get 404 for url specified in module.routing.yml I am new to Drupal and I got stuck with the problem that I don't know how to debug even: 
I have made a simple module 'final', its structure:

Applications/MAMP/htdocs/drupal_dir_1/modules/final &gt; ls
final.info.yml    final.routing.yml src

/Applications/MAMP/htdocs/drupal_dir_1/modules/final &gt; ls src/Controller/
ExampleController.php


Files contents:

&gt; cat final.info.yml
name: Final
type: module
description: This is an final module
core: 8.x⏎

&gt; cat final.routing.yml
final.content:
  path: '/final'
  defaults:
    _controller: '\Drupal\final\Controller\ExampleController::content'
    _title: 'Hello world bitch!'
  requirements:
    _permission: 'access content'

&gt; cat src/Controller/ExampleController.php
&lt;?php
namespace Drupal\final\Controller;
use Drupal\Core\Controller\ControllerBase;
class ExampleController extends ControllerBase {
  public function content() {
    $build = [
      '#markup' =&gt; $this-&gt;t('Hello World, bitch!'),
    ];
return $build;
  }
}
I believe you did not install the module 

if you tried to install you would get 

drush en final



  ParseError: syntax error, unexpected 'final' (T_FINAL), expecting identifier (T_STRING) in /home/giorgos/share/gwebsites/dru8.dev/web/modules/custom/final/src/Controller/ExampleController.php on line 2 #0 /home/giorgos/share/gwebsites/dru8.dev/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/home/giorgos/s...')
   #1 [internal function]: Composer\Autoload\ClassLoader->loadClass('Drupal\final\Co...')
  ...


final is reserved keyword thus it confuses the php parser when it sees

namespace Drupal\final\Controller;


Can also be caught with my vscode setup and linter 

 

You have to change final to something else but then you have to rename it elsewhere in your module (folder name, file names, reference to the class etc)

Otherwise the module is working fine.