Jump to content

TheOnlyOne

Members
  • Content Count

    33
  • Joined

  • Last visited

Posts posted by TheOnlyOne


  1. On 2/19/2023 at 6:22 PM, TimCruise said:

    There are also other choices:

    Qt - is also able to create nice dashboards.  License fee is US$10,000 per seat per year.

    WTF?? At that price, I wouldn't call it a "choice". Jesus. You really gave me nightmares. Are you sure it is per year? Maybe it is for a permanent license.
    You should really consider Delphi FMX or Lazarus (free) in this case.

    ______

     

    Please define "dashboard" (maybe some screenshots or links to dome online "dashboards"). Delphi Firemonkey is also good with dashboards. But let's see what you mean by dashboard, first.
    Also check Delphi TeeChart - costs money, but it is a [bit] under, 10000 per year.

     


  2. On 2/18/2023 at 12:35 PM, Primož Gabrijelčič said:

    They sell books for $5 (action!) without asking.

    Well, this happens when they have the copyright. Right?
    This is why I don't really want to give the copyright of my book away.

    By the way, I have the book already written (~442 pages). I contacted Packt some weeks ago. They haven't bothered to answer until now.


  3. On 2/27/2019 at 9:30 PM, Primož Gabrijelčič said:

    Hurrah, hurray, my third book is here! 

    Got your High Performance. Good stuff. Now I read the Patterns. Got stuck in the second chapter, never got time to advance.

     

    I have a question about your experience with PacktPub - how was it?

    I guess it was good since you published not one book but two with them. If one wants to write also a book, should it be published with them or with Amazon?

    I see some positive reviews about them, but I also see some Kafka-style horror stories.

     

    Would you recommend some other publishing house?

     

    Thanks!


  4. 5 hours ago, Fr0sT.Brutal said:

    Interesting, is it common practice to use Delphi-specific object streaming to store data?

    You have to store your data somewhere right?

    Could be registry, text file, DB. etc. I choose binary files because you save your data "as it is".  No need to convert back and forth from (for ex) TDateTime to string and then back. You just save the TDateTime as it is (double, I think). That's it!

     

    Quote

    What if object structure changes?

    You use "padding".
    At the end of your file, you keep something like 64 bytes empty. You can put later whatever you want there. Make the padding large if you know your Object is still under design and it will change.
    If your object changes dramatically, you use file versioning: each binary file has a header. You detect which file version the user presents to you and you load the appropriate decoder for that version.

    I used this for the last 20 years. 1 gazillion times faster than a DB. Easy to write. No more conversions between data types.

    I have some libraries for that https://github.com/GodModeUser

     

    This is for ex a list of orders (TOrders). It will save/load all orders in the list. The TOrder is quite complex but the streaming is handle just by one line of code (load/save).
     

    {-------------------------------------------------------------------------------------------------------------
       I/O STREAM
    -------------------------------------------------------------------------------------------------------------}
    procedure TOrders.Load(IOStream: TCubicBuffStream; Drivers: TObject; Products: TProducts);
    VAR
       i, iCount: Integer;
    begin
      Assert(Drivers  <> NIL);
      Assert(Products <> NIL);
    
      if IOStream.ReadHeader(StreamSignature) <> 1
      then RAISE Exception.Create('Invalid TOrders header!');
      iCount:= IOStream.ReadInteger;           { Total items in this list }
      IOStream.ReadPadding(1024);
    
      { Write each orders }
      for i:= 0 to iCount-1 DO
       begin
        VAR Order:= CreateNewOrder;
        Order.Load(IOStream);
    
       end;
    end;
    
    
    procedure TOrders.Save(IOStream: TCubicBuffStream);
    VAR
       i: Integer;
    begin
      IOStream.WriteHeader(StreamSignature, 1);  { Local header }
      IOStream.WriteInteger(Count);              { Total items in this playlist }
      IOStream.WritePadding(1024);
    
      { WRITE EACH ITEM }
      for i:= 0 to Count-1
        DO Self[i].Save(IOStream);
    end;

     

    See how I reserve space for the future with  WritePadding/ReadPadding.
    Also observe the Header of the file (StreamSignature) followed by version umber (1).

     

    Easy-peasy, instant objects to file 🙂

     

    • Thanks 1

  5. 13 hours ago, Skrim said:

    60/8000 how can that be possible 🙂

    Absolutely possible. No exaggeration. Actually, if I count the lines, it will be much much lower than 60. I just didn't want to exaggerate. I will go count the lines today 🙂

     

    The guy that wrote that financial exporter (to CSV) was keeping his quite complex data in some kind of text file (that contains all binary data converted to strings). He invented his own format, some kind of CSV/XML (with files inside the file), using special characters as end of record/end of line/end of file markers. Writing the data to disk in such format takes a lot of code. Then opening the files from an external tool takes again A LOT of parsing up and down to extract specific data fields, from specific addresses, a lot of code. So, no wonder he ended up with 8000 lines of code.

     

    What I do in my new program, I keep my data (NATURALLY) in objects and stream down the objects to disk, to binary files. All this code comes naturally with all my objects.

    When the time came to export the financial data from those objects, I simply enumerate all objects and pick the fields/properties that I need and save them as CSV, for the end user.

    No more poking around to find specific data in an over-complex TXT file.

    Nothing fancy, just something like:

       for var Object in MyObjects do

          Result:= Result+ Object.FieldsXYZ+ ',' + CRLF;

     

    So, my advice for you: if you think that objects will drag you down, think twice!
    Do watch a tutorial, or look at some Delphi code on GitHub, or look at the Delphi source code.

    It will change your life! It will change your code!
    Today, I cannot imagine myself writing code without OOP!

     

    This old procedural program that I rewrote as OOP, it was reduced to 10% (as SLOC). Long live the objects 🙂  :classic_cheerleader::classic_cheerleader::classic_cheerleader::classic_cheerleader::classic_cheerleader::classic_cheerleader::classic_cheerleader::classic_cheerleader::classic_cheerleader::classic_cheerleader::classic_cheerleader:

     

     


     

     

     


  6. On 2/8/2023 at 9:32 AM, Stano said:

    Yes, it's a (very) lot. The basic rule is that the CV should not be longer than 1 page. Unfortunately, people work like this: I open a resume. I longer than 1 page. I WILL NOT READ THAT.
    That's why I recommend writing it on 1 page and adding an attachment to it. If you address the reader, he will read the attachment.

    Thanks!

    It is hard to cut it down. I worked on so make project and in so many industries (robotics, PC hardware, electronics, bioinformatics, medical, ecommerce, etc).

    But I will try to cut it down.

     


  7. On 2/8/2023 at 6:12 AM, Skrim said:

     

    Quote

    As the boss/owner he can do whatever he wants with his own code and company.

    Yes, you are right. It is his company. And I work there. A boss is nothing without employees. And employees tend not to follow the boss when the boss does whatever HE wants with the company..... And as I said, a boss is nothing without employees 🙂

     

    Quote

    15' or 150' lines, who cares as long as it works?

    If you would only knew the difference (in efficiency and stability) between procedural and OOP....
    I spent 2 weeks in some super convoluted procedural program they have (an exporter, 8000 lines), to fix 17 bugs. Another 3-4 to fix.
    In the new version, OOP, I rewrote that that exporter in under 60 lines of code.

     

    Quote

    I also hardly know how to make a class, however my code still works very well.

    Every line of code we write, increases the chances to introduce a bug. Procedural code tent to be way way way more "verbose", and separate poorly the program logic....

    You see where I am going with this... right?

     


  8. 4 hours ago, Brandon Staggs said:

    younger coders aren't interested in learning enough to understand real coding anyway!

    As I said before: because their Delphi code was really, really old, I proposed my boss to scratch it and start from zero.

    He was reluctant, so I built it from scratch in a few days (my very private time) - needing another full month to polish the program, to make it ready to be sold - the original program is 150000 lines of code but it is procedural (all data stored in strings) and the old code was never ever deleted from the project.

    On objects, that code would be rewritten in max 15000 lines!

    One of the exporters they had was 8000 lines. I implemented it in mine in 60 lines (objects streamed down to binary files).

     

    Now I know why my was reluctant to use my code:  because he was already convinced by other guys to rewrite it using "brand-new-shiny" web tech.

    But instead of one programmer (me) and 1 month, their road map is now 10 programmers and one year. Congratulations web guys!

    _

    But I would have been glad if our boss had had the balls to tell us upfront (months ago) that he already decided for web-stuff and not Delphi.

     

    Anyway, my CV is again ready to be submitted to companies willing to accept home-office.

    Is it 4 pages (small font) too long? I don't want to cut down my libraries, scientific publications or the (industrial) robots I worked on :classic_biggrin:.

    Hope to find something exciting again -> therefore, DB is pretty much excluded - Unfortunately, Delphi comes with this baggage - all still-sending companies are either running on obsolete Delphi code OR their core business involves some "god please kill now be because I am bored" DB-centric architecture.

    ____________________________________________________________________________________________________

    But for Emba: WHY THE FUCK are you sleeping there?:classic_huh: Wake up. Hire people. Send them to Facebook, Instagram, Twitter, schools and universities. Don't forget the kindergartens! Today, they don't start teaching programming when you are 23. They start at kindergarten. My 10 years old son already knows 3 languages! Wrote game in Delphi 🙂
    Start to show that Delphi is alive and kicking. Get rid of the "old guy" smell.

    They hired gray beards like Marco Cantu. I thought he was one of "our" guys. Isn't he aware of what is out there? Is he so old that he doesn't know how to use the Internet?

    • Like 1

  9. 21 hours ago, TheOnlyOne said:

    using books pages with a quiz as a captcha on Windows login screen should be a good feature

    I mean, this colleague as a person if not a bad guy. He fell behind with his Delphi skills it is true, but on the other hand our boss allocated in the last hour only 2 hours for discussions and refactoring. What's the point is knowing Delphi if you are not allowed to use it. Any decent project owner would know that any code needs refactoring and payment for technical debt. If the owner does not know, he should at least hire a project leader. We don't have this role. They call it that we "have a flat management organigram".

     

    Anyway, even if the work was easy in this company, I decided to move away from it.

    • Like 1

  10. On 1/30/2023 at 12:33 PM, Lars Fosdal said:

    But... so much shit to clean up, and no time allocated to doing it... I'd go nuts.

    Yes. That's part of my dilemma now.

    What would take for those non-tech people in the management to understand that it is not enough to write a function once and forget about that code for 25 years?

    What would it take to understand that pausing the production for 2 months to pay 25 years old technical debt will make the production faster (once you unpause).


  11. On 1/29/2023 at 10:06 AM, Patrick PREMARTIN said:

    Put them on the Windows desktop of your colleagues, they must read books about coding and good practices !

    The problem is not from where to get the books, the problem is how to make them read. They were very clear that they are not interested in reading Delphi books at this age.

    I managed to frighten one of them when I posted on company's chat some "cool news" about an AI that can write code, code object-based.
    One of the two programmers magically stated the next day that he started to learn to use generics. 🙂 :classic_cheerleader:

    I haven't seen them yet appearing in the code 🙂


  12. Also, we keep all data in strings, but sometimes we keep it in visual controls (listboxes) placed on the form outside the visible area. The form is 1024 pixels, so we have in the main form like 100 invisible (link) controls, starting at pixel 6000, mostly timers.

     

    I am trying to convince my boss to throw away all the code and start from zero.
    But we will need new programmers with that new code 🙂

    The code is now about 200,000 lines of code but can be reduced to 20,000 if objects are used (instead of strings).


  13. 2 hours ago, Lars Fosdal said:

    I am at a loss for words... How old is this codebase?

    Define "old".

    This is the current code. The previous programmers worked on it each day.
    But our boss will not allow us to allocate time to refactoring.
    As I said, if he wants a new feature implemented (let's say a new pretty Search box) he will personally verify at the end of the sprint if the conditions are meet (DoD) checking only the GUI.
    The code that's under that pretty GUI... is the hag that nobody checks.

     

    You want more juicy stories?
    We keep all data in strings, but sometimes we keep it in visual controls (listboxes) placed on the form outside the visible area. The form is 1024 pixels, so we have in the main form about 100 invisible controls, starting at pixel 6000.

    The whole story is here:

     

     

    • Haha 1

  14. 13 hours ago, programmerdelphi2k said:

    take care about your comments here... who knows who can see it? ... a robot, a BOSS... your ex  👨‍🏭👨‍🏭👨‍🏭👩‍🎨

    1. Well... in the end I tell the truth and only the truth.

    2. Also, I was careful not to mention the name of the company...

    3. My current boss will never visit a technical forum like this.

    But thanks for the warning.


  15. 10 minutes ago, Rollo62 said:

    I'm not afraid of new technology, robots, KI, self-driving cars,  ...  but I'm very unsure if I would risk to meet your robot anytime soon :classic_unsure:

    Nope, nope, nope.
    The robot was a really cool thing we did in the previous company (high-tech labs, clean rooms, fast microcontrollers, CAD, big security all over the place, great salary, high-standards Delphi code).
    Not in this current company. In this (current) company, we wouldn't even be able to write the software that puts oil in robot's spare wheel 🙂

     

    • Like 1
    • Haha 2

  16. On 2/23/2022 at 11:25 AM, Mike Torrettinni said:

    There's quite a lot of inconsistency in Delphi sources, in some cases very obvious when a different developer implemented a change and introduced new variables. Completely different style, or usage of L prefix.

    I hate that!!!!!!!!!!!!!!!!!
    My colleagues use L a lot. And G (guess for what). We have thousands of those global variables. And they say it is fine as longs as you marked them with G.

    ______________________

     

    About all these code formatting guides: every time I see one, I wonder myself why is this written like this and not otherwise.
    Is there any philology involved? Is in any way the human factor taken into consideration?

     

    For example, if you have:


     

    if (SomeKindOfCondition > 0) and (SomeOtherCOndition < 1) and (x=42) |  <- here comes the end of the screen and you don't see the rest of the code
    

    wound't be (for the brain) better written as:
     

    if (SomeKindOfCondition > 0) and
    
       (SomeOtherCOndition < 1) and
    
       (x=42) and (Y = that) then 

     

    and even better:

     

    if (SomeKindOfCondition > 0)
    
       AND (SomeOtherCOndition < 1)
    
       AND (x=42) 
    
       AND (Y = that) then

     

     

    I think the brain would want to know what happens BEFORE it happens (the "and" condition). The eyes should be able to parse the code as easily as possible.

    I am just saying. I don't know what would be the results of an MRI scan of a person reading code like the above, where the logic is written in "post" style (2nd block of code) and "pre" (3rd block) style.

     

    It was fed to us that we have to write the code in this style. Is this the standard solution. Yes. Is it also the best solution? god knows!


  17. On 2/20/2022 at 9:20 AM, dummzeuch said:

    When posting something's like this, one has to expect feedback. And usually negative feedback more than positive. It's difficult to deal with that if you have no experience.

     

     

    There is nothing wrong with negative feedback as long as it comes with an explanation, an explanation that will help one fix the problem.


  18. 22 minutes ago, Stano said:

    The boss needs to be changed:classic_biggrin:

    The book mentioned above is required reading in good companies.

    Cannot be done. He owns the business/the program 🙂
    He is not a bad guy. He just don't have any technical knowledge. I told him that the technical debt reached a maxim (cannot exist higher than that)
    but I had to explain him what is technical debt. I don't think he believed me. Last month we implemented no new feature. We only fixed bugs. 
    I keep posting links to simple tech documentation for my Delphi colleagues. For my boss I linked to videos from https://www.youtube.com/@ContinuousDelivery channel (a great channel). I don't think anybody is clicking the links. 🙂

×