28

Refactoring a 1000 line God awful js function. Why do people do this?

Comments
  • 0
    How can people go past 100? I usually keep it below 20-25 unless I have a switch statement or something but 1000 hurts my head
  • 0
    it defines inner functions that cannot be easily extracted because global state is everywhere. it can be done it's just a pain.
  • 0
    Sounds like some code bases I've seen
  • 0
    The words "global state is everywhere" made me crash my car in to a tree with horror. And I wasn't in the car when I read it.

    Good luck, +1 for the rant :)
  • 1
    @hitripekac I feel your pain! Evidently someone didn't take "code as if the person maintaining your code is a violent psychopath that knows where you live" seriously
  • 1
    @askerr Average js file at my work is 2-3k lines... The only way of finding things is by doing a search all. :-s
  • 1
Add Comment