Hacker News new | past | comments | ask | show | jobs | submit login

I have used PHP for years. I like it too. Its tight integration with http is nice.

The PHP language can be used as a templating language itself:

  <?php

  $user = 'root';

  ?>

  <p>
     Hello <?= $user ?>
  </p>



I think* with ASP.NET Razor Pages. You can do the same thing as:

  @page
  @{
    var user = "root";
  }

  <p>
     Hello @user
  </p>


Razor is awesome... It has this productivity of PHP while being consistent and have the benefit of being conceived later.

Only thing which hurts there: not everywhere deployed like PHP is :)

And technically you need a 2 files boilerplate. But that will vanish within the next year when I understand the .NET team right.


Does PHP still look like that in 'real life'? I was reintroduced to PHP last year via a Laravel based project and it looked nothing like that. It was all Objects and Models and Controllers spread out across a half dozen folders and scaffolding code generated via CLI commands. All actual HTML was generated with Blade templates.


Please, do not do that. Use an actual templating language which automatically escapes output.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: