from Hacker News

Ask HN: What is the most readable back end framework?

by jacobjr23 on 2/13/20, 5:57 AM with 5 comments

Which backend framework has the most understandable code behind it?
  • by LiamPa on 2/13/20, 6:06 AM

    Hard not to love Django and djangorestframework both have very readable code and great docs.

    https://github.com/django/django

    https://github.com/encode/django-rest-framework

  • by jolmg on 2/13/20, 9:19 PM

    Yesod[1]. In part, that's because Haskell in general is really easy to read. The type-system provides a lot of information about what's going on or what can go on at any given point in the code.

    I've read both parts of Rails and Yesod. The problem with Rails is that a lot of the code is dynamically generated. The lack of static type information means I have to investigate in run-time with binding.pry to see what kind of data is flowing through a function at any given moment. Rails also employs a lot of magic that results in weird, inconsistent corner cases.

    My methodology for Rails is to find a method involved in what I'm investigating and insert binding.pry statements where-ever I'd be curious about what kind of data is flowing or effects are happening. Then do the action that I'm investigating, check the context where I put the binding.pry statement, and insert more such statements. Rinse and repeat.

    My methodology for Yesod is to go to the documentation pages like this one[2], and click around the hyperlinks to functions and types. That's normally enough to know how the data is flowing and being affected. If I need to look further, I'd hit the source link and read it. The type information always provides enough info that I don't need to try to investigate in run-time.

    [1] https://www.yesodweb.com/

    [2] https://www.stackage.org/haddock/lts-14.25/yesod-core-1.6.17...

  • by allendoerfer on 2/13/20, 10:34 PM

    Probably a PHP microframework like Slim or Lumen. It highly depends on your background and how you define the scope of what you want to be easily understandable. I would recommend different systems depending on whether you are a computer scientist, frontend developer, webdesigner, data scientist etc.

    For most people though it probably is PHP. There is a reason for PHP's popularity and it is its low barrier to entry for beginners. Hosting is plentiful and comes with a standard way to store data (MySQL), deployment is simple and everything being bound to a request (and dieing afterwards) lets you get away with mistakes.

  • by diehunde on 2/13/20, 7:05 PM

    Rails