top | item 42987144

(no title)

turdprincess | 1 year ago

As an opposite view point I work on a 10 year old legacy iOS app which has almost no abstractions and it’s a huge mess. Most classes are many thousands of lines long and mix every concern together.

We are fixing it up by refactoring - many through adding abstractions.

I’m sure code with bad abstractions can scale poorly, but I’m not clear how code without abstractions can scale at all.

discuss

order

epolanski|1 year ago

> Most classes are many thousands of lines long and mix every concern together.

That's quite unrelated to abstractions. It's just poorly written code, for whatever reasons may have led there.

turdprincess|1 year ago

Abstraction is a an abstract word, but as an example, I would consider the process of refactoring a big piece of code which mixed together api requests and view presentation into a 2 classes (a presenter, and an api client) as adding abstraction, especially if those new components are defined by interfaces.

And I’d rather work in a codebase where the owners are constantly doing such refactors than not.

danparsonson|1 year ago

But how do you define "poorly written"?

edit: if you feel the need to downvote, feel free to share why you think my question is problematic - I think that "poorly written" to describe excessive code file sizes is such a wooly phrase as to be basically useless in a discussion like this, and when examined more closely usually comes down to "poorly abstracted". But I stand to be corrected.