Jump to content
David Schwartz

upcoming language enhancements?

Recommended Posts

On 8/10/2021 at 10:45 AM, Darian Miller said:

My wish would be that it wouldn't ship until it's actually ready...even if that means next year and we keep patching 10.4.2 until then.

Please, please, please, with sugar and cherries on top!!

 

I remember way back in the day when Borland actually did release things "when they are ready".  I miss those days.

  • Like 4

Share this post


Link to post
On 8/10/2021 at 2:29 AM, Fr0sT.Brutal said:

Ternary operator is just a sugar for me. I find myself using it pretty rarely because it often grows so much that it starts looking monstrous. Much more useful is || construction from C-like langs that frequently replaces ternary:

res = smth ? smth : default

Some years ago, I unhappily encountered a monstrous ternary construct in C. It annoyed me most because since I first read K&R a couple of years after it was published, I recognized that the ternary operator was a shorthand which should always be found in very compact constructions. But the real problem with this one was that not only was it huge -- each element requiring horizontal scrolling -- but it was incorrect in handling its parentheses. It was form some code in Visual C++, which compiled without complaint, but when I tried it in BCB++, it choked, pointing out the mismatched parentheses.

 

The great mystery was, what was the actual behavior in the executable from VS?

Share this post


Link to post
9 hours ago, Stefan Glienke said:

We know they never do that but rather hope they be ready when they ship which also as we know it not the case either.

 

Agreed.  They are in the hard situation where they need to quickly release the bug fixes from prior releases that customers are demanding, but also trying to extend or replace old functionality which introduces a slew of new bugs.  I spent years digging out of a very deep hole like that... it's not fun.

Share this post


Link to post
34 minutes ago, Remy Lebeau said:

I remember way back in the day when Borland actually did release things "when they are ready".  I miss those days.

 

To their credit, the complexity of today's Delphi greatly eclipses a Borland version.  I also wonder what the team size of internal experts is today is versus then.

 

Share this post


Link to post
59 minutes ago, Darian Miller said:

 

To their credit, the complexity of today's Delphi greatly eclipses a Borland version.  I also wonder what the team size of internal experts is today is versus then.

 

If they released when it was ready, and spent time fixing the broken windows immediately, then they would be able to develop more efficiently. By letting the defects endure, they just store up problems for the future. Technical debt.

 

I don't find a comparison of modern vs historical delphi very instructive. Should be modern delphi vs its peers. 

  • Like 2

Share this post


Link to post
48 minutes ago, David Heffernan said:

I don't find a comparison of modern vs historical delphi very instructive. Should be modern delphi vs its peers. 

 

True, but modern vs historical is appropriate in the particular sense that they likely have not adequately evolved their internal systems over time while the complexity of the product has skyrocketed.  They seem to be trying to develop/test/release the 28th version of Delphi similar to how the 12th version was built.  They appear to be slowly improving the internal tooling but it needs a major upgrade.  Iterative releases, feature toggles, community empowerment and transparency, etc. - simply a long way to go.  They are (mostly) out of the 90's (EDN still online?) now need to speed through the 2000's and 2010's and get current.  Retooling their online presence seems to be happening.  Hard to see the progress on internal operations though.  They seem to be attempting to improve releases through sheer grit rather than appropriate increases in resources.  That approach only goes so far before the people burn out and that really sucks as the equity decision makers typically don't care about people - but success in development projects is usually based on keeping the right people.  (Fatal flaw with private equity types and development projects...innovation is typically not found in the board room unless your name is Elon.)

Share this post


Link to post

I was surprised to discover that it's still impossible to assign record vars inline

var pi: TProcessInformation := (cb: 0);

at least in 10.3. So if this impossible with 10.4 as well then it looks like good feature to implement

Share this post


Link to post
56 minutes ago, Fr0sT.Brutal said:

it's still impossible to assign record vars inline

You cannot do that even for a regular variable. It works if you declare a constant first and use that one for the assignment. That even works for the inline var.

Share this post


Link to post

It works for global vars, though.

 

unit MiscTestMore;

interface
uses
  System.SysUtils;

type
  TOutput = reference to procedure(const aText: string);
  TRec = record
    a: string;
    b: integer;
  end;

const
  c_TRec: TRec = (a:'A'; b:1); // Works
  c_TRec2: TRec = (a:'A2');

var
  v_TRec: TRec = (a:'A3'; b:2); // Works
  v_TRec2: TRec = (a:'A4');

procedure RecordConstTest(const Output:TOutput);

implementation

function Fmt(const aTitle: string; const aRec: TRec):String;
begin
  Result := Format('%s  a:"%s"  b:%d', [aTitle, aRec.a, aRec.b]);
end;

procedure RecordConstTest(const Output:TOutput);
begin
  Output(Fmt('c_TRec ', c_TRec));
  Output(Fmt('c_TRec2', c_TRec2));
  Output(Fmt('v_TRec ', v_TRec));
  Output(Fmt('v_TRec2', v_TRec2));

//  var l_TRec1: TRec := (a:'A5'; b:3); // Fails
//  var l_TRec2: TRec := (a:'A6');

  var l_TRec: TRec := v_TRec; // Works
  Output(Fmt('l_TRec ', l_TRec));
end;

end.

Output:

c_TRec   a:"A"  b:1
c_TRec2  a:"A2"  b:0
v_TRec   a:"A3"  b:2
v_TRec2  a:"A4"  b:0
l_TRec   a:"A3"  b:2

 

  • Like 1

Share this post


Link to post
1 hour ago, Lars Fosdal said:

It works for global vars, though.

Yes, and it works even in ancient Delphis including partial init which is what I learned many years later since I started coding in Delphi 🙂

1 hour ago, Uwe Raabe said:

You cannot do that even for a regular variable.

Yes, and for local vars too. Pretty weird why it's not allowed actually, because this kind of declaring is very handy. Let's hope Emba will implement this feature sometimes - as they did for arrays

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

×