Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 06/11/21 in all areas

  1. Stefan Glienke

    Out parameter is read before set

    Out parameters are just bad var parameters - just saying.
  2. Exactly - this one of the biggest gripes I have with Delphi/Pascal - the two separate concerns of allocating memory and initialization are mixed together. This is also what prevents having stack objects. C++ for example does it differently using new to allocate memory which also calls the ctor but they are not mixed - you can also just use an object on the stack or a vector/array of objects without memory indirection.
  3. Tommi Prami

    Out parameter is read before set

    Very glad to everyone that brought this in my attention. Did not know all this. Now just have to remember this. -Tee-
  4. That's why I still think the old object model did it right with explicit memory allocation separate from the constructor: MyInstPtr := new(TSomeObjectType, Init(Parameters, go, here)); vs. MyInst.Init(...); (I hope I remembered the syntax correctly. It has been over a decade that I used this.)
×