3 ms·
Funny how a lot of "work" on large scale code bases boils down to de-coupling code from the datatypes they never needed to be dependent on (eg, function takes o
by darioush 6y ago
Funny how a lot of "work" on large scale code bases boils down to de-coupling code from the datatypes they never needed to be dependent on (eg, function takes obj but only needs obj.foo)
- SatvikBeri 6y agoIt's a problem without an easy solution. There are some cases where you genuinely want to couple fields together basically all the time (e.g. a database driver, address, etc. into a "DB" object) but there are many more cases where you want to couple fields together 80% of the time. Those are the hard ones to deal with - separate your fields, and you need to do a lot of redundant work, but if you combine them that can be a pain to unravel and slow down your loops. Julia's multiple dispatch is really helpful here, because you can e.g. write one connect_to_db that takes a DB object, and another that takes a string. I've found this flexibility to be surprisingly helpful, it completely takes away the tradeoff in many (not all) cases.