Jump to content

David Heffernan

Members
  • Content Count

    3710
  • Joined

  • Last visited

  • Days Won

    185

Posts posted by David Heffernan


  1. On 7/31/2019 at 11:39 PM, Lars Fosdal said:

    That is a good idea, but also somewhat fragile as the Json can't be validated at compile time

    Attributes are fragile by design. The compiler cannot verify that you supplied the appropriate attributes to make your program work correctly.

     

    For example, at the outset of this thread you are faced with an attempt to pass a typed constant to an attribute constructor and the compiler objects.  Well, remove the entire attribute declaration and now your program will compile.


  2. 4 minutes ago, Lars Fosdal said:

    but it works, so I won't fix it.

    Except that it doesn't work. Doesn't handle errors at all. 

     

    Also, it's fine that you don't want to disturb your code. But if you are going to offer up code as an example, it should be exemplary. 


  3. 18 minutes ago, Lars Fosdal said:

    Awaiting ridicule for the use of ShellExecute 

    Why do you think ShellExecute throws exceptions? It doesn't. If you want proper error handling use ShellExecuteEx, and check the return value. Even ShellExecuteEx would be wrong here though. Use CreateProcess.

     

    As for services, why use cmd.exe to run net.exe? Why not run it directly? Of course, the API is the right way to start a service. 


  4. 34 minutes ago, dummzeuch said:

    Stored window sizes and positions (in whatever) should not roam, unless one can be sure that the user always has the same hardware.

    That's why I switched to the registry from a centrally stored ini file (the latter could also be questioned, but in this particular case it makes sense to have a common configuration for all users).

    I don't buy that argument. Your program needs to be able to adapt to changes in screen resolution. When restoring the form layout you must deal with the screen resolution having changed, roaming or not. User can change resolution, font scaling, changes attached monitors, etc. 

     

    Having said that, I am sure that an argument could be constructed to justify not having such settings roam.  In fact, using that part of the user profile that resides on the filesystem allows you to choose between roaming and local on a per setting basis.  That's certainly an advantage over HKCU.

    • Like 1

  5. 1 hour ago, David Schwartz said:

    If you want a bunch of half-baked crap, visit Torry's. GetIt has stuff in it that Embt has thankfully agreed to maintain so those of us working on older legacy products that use these component libs can continue to use newer versions of Delphi.

    The issue is not what components you use. The issue is the development process. You need to be able to create development environments in a robust way. These environments need to be identical. And you need to be able to build with different versions of your codebase, including different versions of your components. That isn't something that you get with naive package manager use. 

     

    1 hour ago, David Schwartz said:

    Having an automated installer is nice, but we definitely need a way to manually download and install these libraries, otherwise they're pretty much useless.

    Yes. That's pretty much the point. 

    • Like 2

  6. 26 minutes ago, Tom F said:

    Is the test he's doing not reliable

    It's very hard to reproduce the exact series of steps which are undertaken when sending an email. And why bother? Since you have to handle the case when it fails for real, why not use that? 

     

    The best code is the code that doesn't exist. Can't be a defect in code that doesn't exist. 


  7. 10 hours ago, Remy Lebeau said:

    You and I don't agree on much very often, but we can agree on this point.  For instance, I'm a programmer, who happens to work primarily in C++ and Delphi, but I will reach into Java and C# and even VB and Assembly when a task requires it.  I think in terms of logic and tasks, and then write specific code in the syntax of whatever language I'm working with at the time to accomplish those things.  Programming is programming, differences between various languages are just a matter of syntax and libraries available.

    Thanks. Actually I think we agree on most things, we just have a disagreement on the mechanics of SO. I don't think that's very important in the grand scheme of things, and I am extremely appreciative and admiring of all the good work you do in the Delphi community.

    • Like 6

  8. 1 hour ago, TomDevOps said:

    It is easy to say, my example: three Delphi guys remained, rest of the two teams are using mostly Microsoft tech-stack, and they are not interested in Delphi projects, so you may ask politely, but they can refuse, or if you try to force them, they will quit, after all, it is very easy to find C#, Java, JavaScript jobs while Delphi is non-existence on the market... and now we are building Dart team to get rid of Delphi... .

    Perhaps this comes down to perception, and the type of work involved, and the other attractions of the company, but personally I hire programmers.  If they don't know a specific language when they arrive, we teach them that language.  I don't really buy in to the idea that there are Java programmers and C# programmers and Python programmers and so on.  In my mind there are just programmers.  

    • Like 3
×