@arnelson i am saying these strategies are good and we should do them. reject arbitrary notions of programming morality
Top-level
@arnelson i am saying these strategies are good and we should do them. reject arbitrary notions of programming morality 12 comments
@marjolica @zens @arnelson bubble sort is great if you only have like 20 items, or the list is nearly sorted already 😃 @marjolica @zens @arnelson also if it's not fast enough it'll show up on the profiler and you'll fix it @JoshJers @zens @arnelson back in 1974 I inherited a large Fortran program (about 2000 punch cards) that ran on IBM370 mainframes. The purpose was to calculate the UK power stations fuel use. It used to take 2 minutes of CPU time to run the entire program. It included a bubble sort to put the list of the power stations into 'merit order'. There were about 3000 items in the list. When I replaced bubble sort by quick sort I reduced the total run time to 2 seconds with big savings to our budget. @marjolica @zens @arnelson Yeah, 3000 is definitely the wrong number of elements for bubble sort to be a good choice, *especially* in 1974 😁 @marjolica @JoshJers @arnelson well, the rule of thumb is “probably” not “definitely”. sometimes we work ourselves up about scaling problems that just never happen @zens @marjolica @arnelson exactly! The ultimate point is "write it the most straightforward way you can to start, then fix performance problems when they become apparent" @JoshJers @marjolica @arnelson and also, once again, these are strategies for when you get stuck, not general rules of thumb |
@arnelson we might have a different notion of what makes a “good” program- but these notions are irrelevant to the process of creating a program in the first place. it is easier to correct a wrong program than to create a program perfectly from blank canvas