Jump to content

TheOnlyOne

Members
  • Content Count

    33
  • Joined

  • Last visited

Everything posted by TheOnlyOne

  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. My current company does not follow any Delphi programming guideline. You know the document that recommends to use short function, long variable names, use of try/finally, etc. I never needed one, because in the previous companies everybody was doing good code "by default". But in this company..... every programmer does whatever it wants (function that have 2000 lines of code, as strings are named s, k or i, etc). I expected to find such a guideline on Emba's website. But cannot find it. Anyone can point to such document or if you wrote one, upload it somewhere? My colleagues refuse to read Delphi books (they don't know how to make classes), and our boss is not a technical guy. He only looks in the scrum if for the GUI DoD (definition of done) if the task is ready or not.
  7. 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. 🙂
  8. 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 🙂
  9. 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 🙂
  10. 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.
  11. 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?
  12. 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?
  13. 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.
  14. 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.
  15. 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).
  16. TheOnlyOne

    Need a "Delphi programming guideline"

    ok. you just made my day.
  17. TheOnlyOne

    Need a "Delphi programming guideline"

    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. 🙂 I haven't seen them yet appearing in the code 🙂
  18. TheOnlyOne

    A book about Object Pascal Style Guide

    I am much better than the other two programmers (since their code), so this job is for me quite trivial.
  19. TheOnlyOne

    Need a "Delphi programming guideline"

    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).
  20. TheOnlyOne

    A book about Object Pascal Style Guide

    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:
  21. TheOnlyOne

    Need a "Delphi programming guideline"

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

    Need a "Delphi programming guideline"

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

    A book about Object Pascal Style Guide

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

    A book about Object Pascal Style Guide

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