Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 10/27/22 in all areas

  1. David Heffernan

    generics

    Stop trolling, that's my job!
  2. Stefan Glienke

    generics

    Doesn't that make it a container? 😜
  3. That message can also mean that some other module could not be found that the named one relies on.
  4. dummzeuch

    Delphifeeds.com??

    Same story over and over again: There is a good tool / website / whatever Embarcadero buys it (or the person who made it becomes an employee) It goes down the drain
  5. Vincent Parrett

    generics

    I use generics a lot in non container/collection scenarios - for example Delphi Mocks fluent api uses the generic type to allow a type safe definition of the mock. Without generics we would be using strings - which is not typesafe and would not survive refactoring. Another example - I have lexer/parser library (used in FinalBuilder) //NOTE : T MUST be an Enumerated Type (need better constraints!) TTokenRec<T> = record private ..... end; ILexer<T> = interface function Next : TTokenRec<T>; ... TBaseLexer<T> = class(TInterfacedObject,ILexer<T>) //concrete usages TDSLLexer = class(TBaseLexer<TDSLTokenKind>,IDSLLexer) TVariableSenseLexer = class(TBaseLexer<TTokenKind>) //parsers built on top of the lexers IParser<TAstNodeType,TParseErrorType> = interface TBaseParser<TTokenType,TAstNodeType,TParseErrorType> = class(TInterfacedObject,IParser<TAstNodeType,TParseErrorType>) TDSLParser = class(TBaseParser<TDSLTokenKind,TDSLASTNodeType,TDSLParserErrorType>) TVariableSenseParser = class (TBaseParser<TTokenKind, TVariableSenseASTNodeType, TVariableSenseParserErrorType>) Generics allows you to avoid copying and pasting tons of boilerplate code, changing types etc, or doing having to do tons of nasty type casting. If Delphi's generics were better there would be many more uses for them, but when you attempt anything complex you run into limitations. If you really want to know what else can be done with generics, you would have to look at other languages that have better generics implementations (like c#).
  6. David Heffernan

    generics

    Apart from the myriad of other applications that aren't about containers
  7. Stefan Glienke

    generics

    As a reaction to one of his answers during Q&A I wrote a blog post. Having said that and personally loving generics for various use cases (as shown in the blog post) there are also things that are solved sub optimal - which I also wrote about. Also if you have used generics in C# then you will likely miss co- and contravariance - oh, look, I also wrote about that. If you are going really fancy with generics and code that uses RTTI you have to be aware about some percularities - guess what: wrote about it. Now because in generics you basically have the lowest common denominator and we are lacking quite some ways to specify some traits of the supported types via constraints there are several things that you cannot do or have to fall back to indirections: most common example is using comparer interfaces for generic sorting algorithm or hashtables. That is mostly where a naively implemented generic algorithm might be slower than some handcrafted code for the specific type unless you heavily optimize for various cases (as I have done in Spring).
  8. PenelopeSkye

    Search unit with db objects

    I have inherited a data unit with hundreds of objects and I can't find what I am looking for. Is there any way to search for the object I am looking for? Thanks! Please let me know the correct way to refer to this file and I will update the title. There has got to be a better way than 'data unit' or 'unit with db objects'! Thanks!
  9. There is a KB5020387 for Windows 11 22H2
  10. Sherlock

    The Delphi 11.2 release thread

    Well I am just glad, that my applications seem to be barely more complex than "Hello World" because I really have none of these issues. But then again I use no inline variables, bpl, dll, 3rd party frameworks or language enhancements or any other new agey stuff I'm not able to wrap my head around anyway. Just plain old Delphi plus generics. And that works really good.
  11. Mohammed Nasman

    Delphifeeds.com??

    begin end - Object Pascal and Delphi News Since the lunch of BeginEnd, I never looked back for Delphi Feeds, it's simple and has clean UI.
  12. Remy Lebeau

    Delphifeeds.com??

    Embarcadero took over DelphiFeeds 2 years ago to revive it: https://blogs.embarcadero.com/the-all-new-delphifeeds-com/ I guess they are not doing a very good job of that. Or, maybe they are just having system troubles? This wouldn't be the first time an Embarcadero system used by the community went down for weeks at a time.
  13. Stefan Glienke

    The Delphi 11.2 release thread

    11.2 is a nightmare - prior to LSP the worst was that ctrl+click did not work. Now, most of the time nothing at all works because LSP dies all the time.
×