Hacker News new | ask | show | jobs
by EdwardDiego 1586 days ago
Well, what's the old saying - nothing can parse Perl, but Perl?

As for JS and IDEs, you should try an IDE again. Far better.

1 comments

Haha I've not heard that one. Perl is very much an unreadable code soup.

I will have to try on next time I'm in plain JS. It doesn't happen often. I have a preference for strongly typed languages. I suspect I have something similar to dyslexia. I mix the spelling of words and sometimes even the words. Strong typing is the tool that makes that problem go away.

I use Intellij and it really does its level best to bring code insight to dynamic languages.

But I fully agree wrt types. Even if I'm not using an IDE, types, or type hints a la Python, help me understand what's going on far better.

I once heavily refactored a hand-rolled build tool written entirely in Python that read and write JSON. Everyone was terrified of touching it.

Introducing Pydantic to replace dicts of dicts of dicts with dicts of App instances that had Environments immediately made the code far easier to understand.

Then introducing type annotations and mypy completed the transition of a business critical tool from one everyone previously approached in what I called a "special forces" manner (get in, achieve your very narrow goal, get out before anyone notices you) to something where code flow was easily understandable.

Immediately, the tool received a lot of attention and refactoring. Something like 20% of it was dead code, amd there was some functionality that, had it been used, would've corrupted the build state or just flat out died.

And it was simply adding types that made this obvious, and made the code accessible to people who wanted to refactor it fearlessly.

(Unit tests were entirely absent, but without the understanding of the code that types brought, how would you even start?)

> Perl is very much an unreadable code soup.

It has been said that perl is the only language which looks the same both before and after RSA encryption.