What is the clean, elegant, well-designed, well-written, beautifully crafted Delphi code that junior level Delphi developers should learn?

There are several Delphi junior developers in my organization, and as part of the Delphi training process, I would like them to look at the "clean", well-written, well-designed Delphi code.

Some criteria that I would like to find include:

  • Great class structure
  • Good use of interfaces
  • Not too complicated or complicated, but complex and complex enough to be instructive.
  • Small methods
  • Code with unit tests.

All in all, I'm looking for code that would make Uncle Bob Martin proud.

I am familiar with many of the popular Delphi open source projects, but I would like to have suggestions and recommendations from the community.

I will make this question a wiki community issue.

+6
source share
2 answers

I would recommend that you take a very simple program and provide developers with junior developers in Delphi after all the good criteria that you specified. You want something that really doesn't require any design on its own (absurdly simple!). The goal of the program is to follow all these best practices. This is especially great if you have a small team that can combine a program with it and discuss how best to do it. Make sure they regularly review the code with your senior developers.

I know that this is not what you are asking for, but I am firmly convinced that people learn more by doing what they do by reading.

For inspiration, check out the Enterprise edition Fizzbuzz . He took an incredibly simple algorithm and reworked it with all the best practices. (It is written in C #, so you could have your junior developers rewrite it in Delphi).

Then, when they run out, you can make it open source so that everyone can admire.

+5
source

Not all codes in the repository are equally well designed, but as a source of ideas and well-written Pascal code in Synopse, it opens up a fossil project. Some bits of the repository contain projects that are only built-in to Delphi 7 and are not ready for use in unicode format, but the main part that I would like to draw attention to is the Delphi ORM + SQLite3 structure.

This is not typical Delphi VCL application code, although it has a very oriented REST architecture, and the demo uses manually encoded forms in a Pascal object, instead of using the traditional Delphi DFM-based form interface.

I don’t know anything that I would recommend, that’s all you said above, plus a great unit test coverage, plus is suitable for beginners to read, which also sticks to Idiomatic Delphi enough not to be teaching against what I most of all I want to teach beginners to Delphi; Stick to idiomatic decisions until you have enough expert to know when not to use Delphi's common idioms.

+4
source

Source: https://habr.com/ru/post/893905/


All Articles