Thoughts on some code breakage with 2.074

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Tue May 9 10:34:48 PDT 2017


On Tue, May 09, 2017 at 02:13:34PM +0200, Adam Wilson via Digitalmars-d wrote:
> On 5/8/17 20:33, Brian Schott wrote:
> > Recently the EMSI data department upgraded the compiler we use to
> > build our data processing code to 2.074. This caused several of the
> > thousands of processes to die with signal 8 (floating point
> > exceptions). This was caused by the fix to issue 17243.
> > 
> > This is a good thing. We need more breaking changes like this.
[...]
> WUT.
> 
> All I hear on these forums is the abject terror of breaking changes
> making companies run screaming from D. You mean to say that companies
> don't actually mind breaking changes if it solves long-standing
> issues.
> 
> I'm shocked. SHOCKED I SAY!
> 
> ;-)
> 
> Can we PLEASE get more of this? I'm not saying up-end the language,
> but let's solve some problems. I doubt our corporate users will be
> very angry. I suspect that most reactions will fall between "minor
> irritation" and this one.
> 
> /me looks sideways at shared
[...]

I don't represent any company, but I have to also say that I
*appreciate* breaking changes that reveal latent bugs in my code. In
fact, I even appreciate breakages that eventually force me to write more
readable code!  A not-so-recent example:

	/* Used to work, oh, I forget which version now, but it used to
	 * work: */
	MyType* ptr = ...;
	if (someCondition && ptr) { ... }

After upgrading the compiler, I get a warning that using a pointer as a
condition is deprecated.  At first I was mildly annoyed... but then to
make the warning go away, I wrote this instead:

	/* Look, ma! Self-documenting, readable code! */
	MyType* ptr = ...;
	if (someCondition && ptr !is null) { ... }

Much more readable, and makes intent so much clearer.  Eventually I was
very happy this supposedly "big bad" breaking change was made.

I wish Walter & Andrei & gang would introduce this sort of breakages
more often. They will both improve the language and impress users whose
code we are so afraid of breaking (I'm still not sure why).


T

-- 
Stop staring at me like that! It's offens... no, you'll hurt your eyes!


More information about the Digitalmars-d mailing list