Click here to Skip to main content
15,910,471 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
Ralf Quint21-May-24 6:18
Ralf Quint21-May-24 6:18 
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
trønderen21-May-24 6:51
trønderen21-May-24 6:51 
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
Peter Turtle19-May-24 21:47
professionalPeter Turtle19-May-24 21:47 
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
0x01AA20-May-24 0:25
mve0x01AA20-May-24 0:25 
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
Peter Turtle20-May-24 2:25
professionalPeter Turtle20-May-24 2:25 
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
Al Gonzalez20-May-24 6:46
Al Gonzalez20-May-24 6:46 
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
0x01AA20-May-24 7:06
mve0x01AA20-May-24 7:06 
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
Ralf Quint20-May-24 8:41
Ralf Quint20-May-24 8:41 
Well, no. I must admit that I do not use C#, only know the very basics of it.

"new" in C# is creating an instance of an previously defined object (MyFluentAPI) and executes those 3 methods.

As for "Pascal", you did not mentioned which kind of Pascal you are using.
In "standard" Pascal (including but not limited to ISO7185), the "with" statement is used to set the scope for the statements within the begin...end block, and is used in connection with "records" ("struct" in C) to save on some typing, as you would not have to precede each record element with its associated record name. But in this case, those elements within that record are purely data!

It is purely what sometimes these days is referred to as "syntactic sugar".

But the major difference is that the record (and in extension, this applies mostly to objects/classes in Object Pascal (Delphi/FreePascal) as well) needs to be existing (already instantiated) when you are referring to it using the "with" statement (block).

If you are using the "with" statement in either standard/procedural Pascal or Object Pascal, you need to do this carefully, as, while it saves some typing and the source code lines shorter, it can lead to some nasty side effects/bugs (or features Poke tongue | ;-P ) if you have elements, like data or methods/procedure/functions with the same names in different records/methods/etc...
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
Ravi Bhavnani20-May-24 14:53
professionalRavi Bhavnani20-May-24 14:53 
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
0x01AA21-May-24 8:26
mve0x01AA21-May-24 8:26 
GeneralRe: Fluent Api in Pascal, nothing earth-shattering ... Pin
jschell21-May-24 12:44
jschell21-May-24 12:44 
GeneralWordle 1,065 Pin
StarNamer@work18-May-24 13:32
professionalStarNamer@work18-May-24 13:32 
GeneralRe: Wordle 1,065 Pin
Sandeep Mewara18-May-24 17:09
mveSandeep Mewara18-May-24 17:09 
GeneralRe: Wordle 1,065 Pin
OriginalGriff18-May-24 20:01
mveOriginalGriff18-May-24 20:01 
GeneralRe: Wordle 1,065 Pin
Amarnath S18-May-24 20:10
professionalAmarnath S18-May-24 20:10 
GeneralRe: Wordle 1,065 - 5 4 me shoulda been 3 Pin
pkfox18-May-24 21:09
professionalpkfox18-May-24 21:09 
GeneralRe: Wordle 1,065 Pin
Cp-Coder19-May-24 2:21
Cp-Coder19-May-24 2:21 
GeneralRe: Wordle 1,065 (3/6) Pin
Jeremy Falcon19-May-24 5:38
professionalJeremy Falcon19-May-24 5:38 
GeneralNever yell into a colander Pin
honey the codewitch18-May-24 12:43
mvahoney the codewitch18-May-24 12:43 
GeneralRe: Never yell into a colander Pin
jmaida18-May-24 16:46
jmaida18-May-24 16:46 
GeneralRe: Never yell into a colander Pin
PIEBALDconsult19-May-24 2:45
mvePIEBALDconsult19-May-24 2:45 
GeneralAnyone else fed up of the Fury Osyk hype Pin
pkfox18-May-24 11:00
professionalpkfox18-May-24 11:00 
GeneralRe: Anyone else fed up of the Fury Osyk hype Pin
Mycroft Holmes18-May-24 12:47
professionalMycroft Holmes18-May-24 12:47 
GeneralRe: Anyone else fed up of the Fury Osyk hype Pin
Nelek19-May-24 3:27
protectorNelek19-May-24 3:27 
GeneralRe: Anyone else fed up of the Fury Osyk hype Pin
raddevus19-May-24 5:20
mvaraddevus19-May-24 5:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.