Jump to content
Sign in to follow this  
Darian Miller

Squint and read: CreateFormFromStings

Recommended Posts

10.3.3 (I haven't checked when this was introduced)

 

System.Net.HttpClient

procedure THTTPClient.CreateFormFromStings(const ASource: TStrings; const AEncoding: TEncoding;
  const AHeaders: TNetHeaders; var ASourceStream: TStream; var ASourceHeaders: TNetHeaders);

 

Its used ten times in two units.  (twice in System.Net.HttpClientComponet)

 

As it's a public method, they would break backwards compatibility to fix it, but I suggest they fix it...

https://quality.embarcadero.com/browse/RSP-27358

 

Did I miss a conversation on this?  I didn't see any references.

Share this post


Link to post
1 hour ago, Darian Miller said:

I haven't checked when this was introduced

It was introduced in 10.3

 

1 hour ago, Darian Miller said:

I suggest they fix it

You're right that it's not a good look. If it were me, I'd change it and take the small amount of pain (if any) from developers, who would probably understand anyway

Share this post


Link to post
Just now, Dave Nottage said:

It was introduced in 10.3

 

It's been out there for a little over a year and there hasn't been a long chain of comments yet?  : )   (At least none that I found.)   

 

Maybe that just means very few are using THTTPClient...

 

Share this post


Link to post
2 minutes ago, Darian Miller said:

Maybe that just means very few are using THTTPClient.

..or very few using that method, or very few that are vocal about the misspelling 😉

 

Share this post


Link to post
Just now, Dave Nottage said:

..or very few using that method, or very few that are vocal about the misspelling 😉

 

 

Delphi programmers are typically not very shy at saying how horrible something like that looks!   Or opining about how bad the Quality Control is lately, or how the newer code is being created by low wage contractors instead of highly skilled craftsmen, etc...  The has all the makings of those sorts of comments.  And we've gone a year without it?  I had to look at it 3 times from Sunday to make sure my cross eyes weren't playing a trick on me.  I've done this sort of stupid thing multiple times and whenever I come across it, I typically immediately stop and fix all references.  (Or if someone else did it, I tell them to immediately stop and fix it!)  Call it a pet peeve I guess...

 

I imagine if I use it, I'll put in a class helper to fix the spelling!

Share this post


Link to post

For some reason, many of the programmers I know have various degrees of dyslexia - which leads me to mentally auto-correct the misspellings I find, and in many cases, leave them as is.  Usually, changing the spelling leads to something unpleasant happening, such as a mismatch between stream content and object property, DB field names, etc.

Share this post


Link to post
4 hours ago, Lars Fosdal said:

Usually, changing the spelling leads to something unpleasant happening, such as a mismatch between stream content and object property, DB field names, etc.

I get that, really I do, but my brain hurts...

Share this post


Link to post
2 minutes ago, Sherlock said:

I get that, really I do, but my brain hurts...

Mine too, especially when I've written the semantically correct word, but the compiler barfs because the actual word in the code is misspelled.

Share this post


Link to post

Not that it would affect many users (if any), but in FMX.Edit.Style:

 

  protected
    FNeedChange: Boolean;
    procedure Change; virtual;
    { Messages From Model}
    procedure MMSelLenghtChanged(var AMessage: TDispatchMessageWithValue<Integer>); message MM_EDIT_SELLENGTH_CHANGED;
    procedure MMSelStartChanged(var AMessage: TDispatchMessageWithValue<Integer>); message MM_EDIT_SELSTART_CHANGED;
    procedure MMCheckSpellingChanged(var AMessage: TDispatchMessageWithValue<Boolean>); message MM_EDIT_CHECKSPELLING_CHANGED;

Spot the typo. The last method name pictured is ironic.

 

Someone should whip up a "spell checker" (of sorts) to see how many of these there are 😉

 

  • Like 1

Share this post


Link to post
On 1/8/2020 at 9:19 PM, Dave Nottage said:

Not that it would affect many users (if any), but in FMX.Edit.Style:

 


  protected
    FNeedChange: Boolean;
    procedure Change; virtual;
    { Messages From Model}
    procedure MMSelLenghtChanged(var AMessage: TDispatchMessageWithValue<Integer>); message MM_EDIT_SELLENGTH_CHANGED;
    procedure MMSelStartChanged(var AMessage: TDispatchMessageWithValue<Integer>); message MM_EDIT_SELSTART_CHANGED;
    procedure MMCheckSpellingChanged(var AMessage: TDispatchMessageWithValue<Boolean>); message MM_EDIT_CHECKSPELLING_CHANGED;

 

 

Reported:

https://quality.embarcadero.com/browse/RSP-27412

 

Funny thing is, they found/replaced the same spelling issue in FMX.Edit.Win.pas (reported August 2015 by John Kaster on https://quality.embarcadero.com/browse/RSP-11800)

 

But the same spelling error appears in

FMX.Edit.Android.pas
and FMX.Edit.iOS.pas
and FMX.Edit.Style.pas

 

Share this post


Link to post

They could create method with correct name and for some time keep the bad one in place too, just marked as deprecated... Just if there were a will to fix things.

  • Like 2

Share this post


Link to post
35 minutes ago, Darian Miller said:

You should be able to fix spelling mistakes of public methods from a recently published version

More a case of: a major release is the best time to do it, since it can be interface breaking.

 

If, after the change, a users code does not compile, I doubt they're going to say: "I want it back with the incorrect spelling". They're more likely to say: "I'm upset that you spelled it wrong in the first place, but fixing it is way better".

  • Like 1

Share this post


Link to post

It is really discouraging to see the excuse that we can't fix it because it might break someone else's code...again and again.  I would encourage the bug reporter to contest the "resolution" on such tickets and put comments I see here on those tickets.  Without push back, there will be no change and I don't think the decision was made at a very high level.  I bet @Marco wouldn't support that decision publicly.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×