View Single Post
Old 12-14-2014, 01:20 AM   #232
twowheels
Wizard
twowheels ought to be getting tired of karma fortunes by now.twowheels ought to be getting tired of karma fortunes by now.twowheels ought to be getting tired of karma fortunes by now.twowheels ought to be getting tired of karma fortunes by now.twowheels ought to be getting tired of karma fortunes by now.twowheels ought to be getting tired of karma fortunes by now.twowheels ought to be getting tired of karma fortunes by now.twowheels ought to be getting tired of karma fortunes by now.twowheels ought to be getting tired of karma fortunes by now.twowheels ought to be getting tired of karma fortunes by now.twowheels ought to be getting tired of karma fortunes by now.
 
twowheels's Avatar
 
Posts: 1,854
Karma: 13432974
Join Date: Nov 2010
Device: Kobo Clara HD, iPad Pro 10", iPhone 15 Pro, Boox Note Max
Quote:
Originally Posted by Rizla View Post
The code is already in place to 1) increase / decrease font size, and 2) the same for margins. Adding an extra in-between font size and margin setting to an existing series of cases barely complicates code because the framework is already there. Adding extra font sizes is trivial. To mess this up would take a very poor programmer indeed...
That's not what I was addressing with my comments, but that said, the previous programmers could have hard-coded assumptions about the sizes all over the place, making changes very difficult indeed. It is possible, and I've seen such bad code before.

Edit:

For example... if they passed around the values as ordinals indicating which one, rather than the actual size, such as "font_size = 3, margin = 1", then adding a new value would be very hard as the code everywhere (and it could be logic that is poorly duplicated in many places) expects the value to be one of 0...9 for font and 0..2 for margin (assuming 10 font sizes and 3 margin sizes -- I don't remember exactly how many there are, I don't look at the dialog very often). Adding intermediate sizes could be very difficult.

Given how the dialog is laid out, and how the original requirements were probably specified to match the current dialog I would not be the least bit surprised if the first developer coded it exactly like that as I've seen many people do that. As a system architect and lead developer, getting developers (even some with many many years of experience) to think of the problem in generic terms that makes for easily extensible programs in the future is something that drives me to near insanity.

Last edited by twowheels; 12-14-2014 at 01:31 AM.
twowheels is offline   Reply With Quote