Jump to content

David Schwartz

Members
  • Content Count

    289
  • Joined

  • Last visited

  • Days Won

    4

David Schwartz last won the day on February 15

David Schwartz had the most liked content!

Community Reputation

82 Excellent

Technical Information

  • Delphi-Version
    Delphi 10.3 Rio

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. David Schwartz

    javascript errors from IDE ?

    I don't know where it's coming from ... either the Start Page or the Documentation page.
  2. David Schwartz

    javascript errors from IDE ?

    I've got a newly installed version of Delphi 10.2.3 that throws up a couple dozen javascript errors every 30 minutes (top and bottom of the hour). Anybody know about this or how to fix it? (I haven't seen this on other installations.)
  3. David Schwartz

    custom attributes question

    actually, come to think of it, I guess it's also possible to set attributes on the read and write things, and they can be either fields or methods. I was wondering about the transitivity of the lookup with fields, but with methods it's going to be different. So that pretty much answers it.
  4. David Schwartz

    ZOOM MODE for Design Editor?

    Yes, a zoom bar at the bottom (like in Word) would be nice for several reasons. I find a 55" 4k monitor solves the lack of said control quite adequately. I only wish I could have one wherever I'm working besides just at home.
  5. David Schwartz

    Problem reinstalling CodeSite 5

    I've run into this same problem after installing other libs recently. It's quite a head-scratcher...
  6. I don't agree with that. A good coder can express something in 5 lines what a poor coder takes 25 lines to say. And the poor coder might not be able to make heads or tails of the 5-line version. And six months after writing the 5-line version, the author might not even recognize it! Code you write "now" is ALWAYS "self-explanatory". That's not why one writes comments -- you don't need them in 5 minutes ... you damn well might need them in 5 months, however! I'm going through a bunch of code right now for the first time, and even though the names of things are quite long and the code is well-organized, there are no comments anywhere, and it's really challenging trying to figure out what's going on. Actually, I take that back ... there are some /// comments above some classes and methods in the interface section intended to be used to create some rough documentation. What's missing is any sort of "big picture" explanation other than one method near the bottom that calls 15 different things declared above it, and none of them pass any parameters, yet they seem to be working on several "global" vars (in the class) that are then revised and refined and used among the methods. Well ... some are, some aren't. Being an "expert" sometimes means knowing that "if it ain't broke, don't fix it" applies. Refactoring increases the risk of breaking things that have invisible side-effects. If there are no unit tests, then it's a crap-shoot. I like to put "big picture" comments at the top of units, but I'm frequently criticized for it. They're as much for my benefit as others. I worked at a place once where a colleague would put needless comments like "getter" and "setter" next to the read and write parts of property statements (on 3 lines) and delete comments where I was explaining parameters on procedure and functions. Makes you scratch your head sometimes.
  7. say you have a class like this: TMyClass = class [attr1( 'abc' )] FField1 : string; . . . [attr2( 'abc' )] property Field1 : string read FField1 write FField1; . . . end; Are attr1 and attr2 basically the same? (And yes, I get that they're different attribute classes. That's not what I'm referring to.) What I mean is, does it make a difference whether you put the attribute on the data field (ie, attr1) or on the property (ie, attr2)? Or are they equivalent? So ... is the property Field1 able to see attr1, or attr2, or both?
  8. David Schwartz

    swagger help needed

    So I've been messing with this stuff all week, and Swagger / OpenAPI seems to be a way of documenting an API, like a DDL for databases. You can build a UI from a Swagger definition fairly easily, but if you need any kind of authentication, it seems problematic. It's ok for basic testing, tho, especially if no auth is needed. Given the derth of "Swagger to ________" code generators, I'm guessing that's not somethign done very frequently. The main one at swagger.io supports a couple dozen languages, but Delphi and Pascal aren't among them. SwagDoc is the only one I've found so far, and there's only one demo for generating client-side code. It's got a few bugs, and there's a lot more it could do. The basic Swagger test UI that can be generated is fairly nice for an auto-generated script. You can read and display data very easily. It would be nice if the Delphi code that's generated had sufficient code generated to produce a similar result, but I guess that's left as an exercise for the reader. Has anybody here ever approached things from this direction -- using Swagger / OpenAPI to help generate Delphi client-side code that makes REST calls? I'm curious what you may have found and problems you encountered. I know Delphi has tools to call JSON-REST APIs fairly easily. But when there are nearly 100 APIs and many of the objects the APIs return have nested objects, lists, and/or arrays embedded in them, that complicates things quite a bit. Or maybe the guys who defined this API have gone a bit overboard? It's a long way from most relatively small API calls and what this particular API I'm working with includes.
  9. David Schwartz

    class designation question

    hmmmm ... so we have four "variations" of this (maybe more): 1) TMyClass = TAnotherClass; 2) TMyClass = class of TAnotherClass; 3) TMyClass = type TAnotherClass; 4) TMyClass = class( TAnotherClass ); I'm familiar with (1) and (4), but (2) and (3) I've rarely seen used. In what conditions would (2) or (3) be used?
  10. What's the difference between these? TMyClass = class of TAnotherClass; TMyClass = TAnotherClass;
  11. David Schwartz

    Sort the Component Palette??

    as for me, yes, but that's only handy when I know what I'm looking for. The type filter wouldn't work any differently with or without a deeper hierarchical organization.
  12. David Schwartz

    How to make app with tabbed set of VNC windows

    Thanks, but I'm just looking for a tabbed interface that collects them into one window instead of a dozen separate windows.
  13. Here are a few random comments about other "code smells".... You seem to be treating classes as records. What's this for? Anything defined as a 'class' is already passed by reference. You don't need pointers for anything related to classes. This ^^^^^^^^ is a very unconventional coding style. First, you're not inheriting this from any base class that has the ability to deal with the attributes ([JsonName(...)], etc), and this one doesn't either. So what are they doing there? As it is, they're little more than comments that are generating needless stuff in your executable. The fields RowName and Modifications should be defined as properties and made 'private'. And there's never any reason I can think of to make constructors or destructors 'published'. Usually they're 'public', and they can be 'protected' if they're in a base class. This is more consistent with typical Delphi usage: TCEItemStatModification = class private FRowName : string; FModifications : TStringList; public constructor Create; destructor Destroy; override; property RowName : string read FRowName write FRowName; property Modifications : TStringList read FModifications; // this is initialized by ctor, never set by the user end; Personally speaking, I'd be inclined to put the RowName as a parameter on the ctor, as well as the list of things that get added to Modifications. They're simply initializers. Why not let the ctor do that? (This would make the RowName property read-only as well, so no 'write' clause is needed.)
  14. David Schwartz

    Sort the Component Palette??

    Is there any way to add a second level of hierarchy to the tool palette? Like an entry for "Jedi tools" then the various Jedi lists shown there. Or "DevEx" with the various DevEx lists there.
  15. David Schwartz

    Error when installing JCL from GetIt

    The installer is not the library. FWIW, I installed all 3 Jedi libs recently and have had no problems.
×