Comment by G3rn0ti

3 years ago

> I find bash to be much more readable

Lol, you find bash readable? With all its weird ad-hoc constructs? I don’t pretend Perl looks pretty but at least its constructs seem to be consciously designed and do not look bolted on.

At my work place we still maintain a huge web application written in Perl 5. Most of the time if we are in trouble it‘s due to bad architectural designs that are not specific to Perl as a language or ecosystem. Only rarely I stumble over issues like implicit returns, or context sensitive sub routines. Also I hate Perl 5 allowing circular includes. The worst offenders among in-house modules are Perl modules written in a Java-esque style which mostly would have benefitted well from using native Perl features instead of trying to mimick Java programs.

>> I find bash to be much more readable

> Lol, you find bash readable?

Note, they didn't say it was readable, just more readable.

What does Perl do in the web app?

  • Everything basically: Generating HTML, serving AJAX requests, communicating with other services, processing files, running DB queries etc etc. It even has a (questionable) feature embedding LuaScript using Lua::Inline and, hence, allows our clients to write little Lua scripts against our Perl API. Our application continuously runs over 20 years already and its user base kept growing ever since.

    When I arrived I tried to move as much of the front end logic to JS but the backend remained in Perl as most business logic still lives there (and not in the DB). These days we try to implement new features in separate JS or TypeScript services and SPAs that, however, communicate with our REST API that is implemented in Perl/Mojolicious. This way we can hire cheaper JS devs (that never learned Perl) and people can still enjoy React and modern frameworks if they so wish. The most talented ones I try to sucker into little refactoring projects in Perl. Most JS developers that tried got fluent in Perl 5 only after a couple of weeks.

    In the future we will try to move more business logic of the "Kernel" into the DB system since Postgres grew much more powerful compared to the time back when the application was invented. I believe this will be our only hope to actually shrink our Perl 5 code base eventually.

    • I thought it was just running some scripts. But that's interesting. Are there any performance differences between TS services and Perl ones?

      What about develop time? how long does it take to deploy a feature?

      5 replies →