Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 10/01/21 in all areas

  1. Fr0sT.Brutal

    How to manage feature changes during release cycle?

    From me: Don't make videos for coding stuff!!!
  2. Remy Lebeau

    Interfaces defined in base classes

    No, it is not a valid cast, in this case. Obj is declared as IInterface, so it is pointing at the IInterface portion of the TMyClass object. But the object also has other portions in it, for TMyBaseClass, TInterfacedObject, IMyInterface, etc (not drawn exactly as the compiler lays it out, but you should get the idea): ------------------- | TMyClass | | ---------------- | <- Obj points here | | IInterface | | | ---------------- | | ---------------- | | | IMyInterface | | | ---------------- | | ... | ------------------- You are type-casting Obj AS-IS from IInterface to IMyInterface, which tells the compiler to MIS-interpret Obj as pointing to the IMyInterface portion of the object EVEN-THOUGH it is actually pointing at the IInterface portion of the object. Whereas the 'as' operator and Support() function, which use QueryInterface() internally, will return a pointer that properly points to the IMyInterface portion of the object, eg: ------------------- | TMyClass | | ---------------- | <- IMyInterface(Obj) points here | | IInterface | | | ---------------- | | ---------------- | <- (Obj as IMyInterface) points here! | | IMyInterface | | | ---------------- | | ... | ------------------- So, when you call IMyInterface(Obj).DoesNothing(), you are calling DoesNothing() on an invalid IMyInterface, so it does not access the correct area of the TMyClass object. In order for the compiler to access the members of a TMyClass object through an IInterface pointer, an IMyInterface pointer, a TMyBaseClass pointer, etc, the pointer has to be ADJUSTED according to the offset of the pointer's dereferenced type in relation to the implementation class. The compiler knows the offset of the IInterface portion of TMyClass, so given an IInterface pointer it knows how to adjust that pointer to reach TMyClass. Same with IMyInterface, etc. Thus, it adjusts a pointer according to the pointer's DECLARED type. So, if you start out with an invalid pointer to begin with, those adjustments are not performed correctly, and you end up with bad behaviors, such as crashes, corrupted data, etc. That works only if SomeVariable is pointing at the memory address where a valid IWhatever exists. Because you altered the layout of the object in memory, but didn't update your pointer usage accordingly.
  3. Uwe Raabe

    Format uses clause

    Good suggestion! I will note a feature request for it.
  4. Uwe Raabe

    Interfaces defined in base classes

    It is not! A cast tells the compiler to treat the given memory address as if it were of the casted type. To get a supported interface out of a class instance one has to call QueryInterface, which in the end is what the AS operator does.
  5. David Heffernan

    How to manage feature changes during release cycle?

    It's not so much how many branches. It's how long they live and how regularly changes from the develop branch get pulled into them. The other issue that can bite is when you have multiple branches working on the same area of code, for obvious reasons. But I don't think you should be afraid of having many feature branches so long as they are managed properly.
  6. Mike Torrettinni

    How to manage feature changes during release cycle?

    Well, this guy definitely pushed me read up more on this stuff, I just couldn't listen and follow his graphics at the same time. The good thing is that being single developer on a project that you can not only decide which branching model you use, if any, but you can combine and switch as needed. But using Git flow model, It would be really nice if Delphi IDE could give a little more info about the current working branch, as it has so many branches. Pretty cool when you can refer to your product as legendary and write it on your blog about Git branching models: https://www.gitkraken.com/learn/git/best-practices/git-branch-strategy
  7. David Heffernan

    Interfaces defined in base classes

    That's right. Which is essentially what the example in my comment was meant to demonstrate.
  8. Fr0sT.Brutal

    splitting interface + implementation

    This was likely advised by an ill C-er to spread the C-style madness over another languages. AFAIK no language uses this mechanism besides C which kinda alludes. Yes and it makes source examining a real nighmare. Alas, there's no better option to avoid code duplication.
  9. Angus Robertson

    Let's Encrypt old root expiry and OpenSSL

    This is all down how you install new certificates into the Windows Store, which has always been a black art. You can double click on a PFX/P12 file, or do it from IIS Server Certificates which is better. Both should install intermediates into the correct store, but may not, and won't remove old intermediates with the same name, that may still be sent with requests. Which is one reason why ICS now has a new TMsCertTools class that allow installation of certificates to the Windows store. Angus
  10. dummzeuch

    splitting interface + implementation

    The only way of doing that, that I am aware of, is include files.
  11. Darian Miller

    How to manage feature changes during release cycle?

    From Dave Farley:
  12. dummzeuch

    Prefix unit local variable names

    The great thing about standards is: Everybody can have his own...
×