Jump to content

TheOnlyOne

Members
  • Content Count

    33
  • Joined

  • Last visited

Community Reputation

10 Good

Recent Profile Visitors

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

  1. TheOnlyOne

    Software licensing system recommendations

    You need like a general tool (DLL to integrate in your app) or you need specifically Delphi source code (vcl component)?
  2. 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.
  3. TheOnlyOne

    Hands-On Design Patterns with Delphi

    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.
  4. TheOnlyOne

    Hands-On Design Patterns with Delphi

    Thank you guys SOOOO much for your answers. I was also disturbed to find out that Packt is mostly Mumbai-based. Your feedback, together with some other reviews (much darker), made me reconsider. Thanks again!
  5. TheOnlyOne

    Hands-On Design Patterns with Delphi

    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!
  6. TheOnlyOne

    Need a "Delphi programming guideline"

    I don't intend to share my delphi objects with other languages. in this case, a binary file is the most efficient, and safe and easy solution. 🙂
  7. TheOnlyOne

    Need a "Delphi programming guideline"

    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! 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 🙂
  8. TheOnlyOne

    Need a "Delphi programming guideline"

    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 🙂
  9. TheOnlyOne

    Need a "Delphi programming guideline"

    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.
  10. TheOnlyOne

    Need a "Delphi programming guideline"

    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 🙂 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. 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?
  11. TheOnlyOne

    Need a "Delphi programming guideline"

    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 . 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? 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?
  12. TheOnlyOne

    Need a "Delphi programming guideline"

    News. My company will close the Delphi branch and rebuild the program from scratch in React Native. Looks like the Delphi world is getting smaller and smaller. Emba needs to work fast to shake off this "Delphi is an old grandpa" feeling.
  13. TheOnlyOne

    Need a "Delphi programming guideline"

    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.
  14. TheOnlyOne

    A book about Object Pascal Style Guide

    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).
×