The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,119 other followers

Archive for October 7th, 2020

UTC is Enough for Everyone, Right?

Posted by jpluimers on 2020/10/07

A very long read, worth every minute: [WayBackUTC is Enough for Everyone, Right? on Programming with dates, times, and timezones is hard. But here’s some help.

It covers a truckload of topics, like the history of time, the use of time zones, storing and transmitting time, user experience (like displaying and entering time), events, duration and much more.

Via: [WayBack] UTC is enough for everyone… right? If you have some time on your hands, you might find this rather long article quite interesting and, possibly, entertaining… – Kevin Powick – Google+

–jeroen

 

Posted in Development, Software Development | Leave a Comment »

Reverse engineering Delphi and Turbo Pascal unit interfaces (and maybe DCP files too)

Posted by jpluimers on 2020/10/07

Boy, I wish there was both an Embarcadero sanctioned grammar (see Delphi code completion fail with anonymous methods – Stack Overflow) and a DCU parser.

This might work for DCP files as well, since the PKX0 signature at the start of DCP files is in [WayBack] DCU32INT/DCP.pas at master · rfrezino/DCU32INT · GitHub.

Being able to dump DCP files makes it way easier to create documenting a matrix of all DCP files and units, to their interdependencies and containments become clear (including any unit scopes).

Right now that is only documented from the unit to the package on the page of the unit (see for instance [WayBack] System.SysUtils – RAD Studio API Documentation), not the other way around. This is a pain to select which packages you need in your project when building with packages.

The list at [WayBack] Unit List – RAD Studio API Documentation (which actually is an “Alphabetical list of unit scopes, along with miscellaneous units that have no unit scope.” is only partially helpful, especially as for instance the System unit page at [WayBack] System – RAD Studio API Documentation is 90% about the System unit scope, has the System unit itself about a 3rd down and does not mention it lives in the rtl.dcp package.

The list at [WayBack] Deciding Which Runtime Packages to Use – RAD Studio is even worse than the unit list, as it misses many useful packages (like dsnap)

For my link archive:

Johan wanted to create a compiler symbol table from the binary DCU files (unlike DelphiAST which does it from the Pascal source files).

From the pre-Delphi era, I found back some info from my own archive:

In the Turbo Pascal days, you had TW1UNA and TPUUNA by William L. Peavy, which I think led to INTRFC from Duncan Murdoch (or maybe vice versa) which got updated to Turbo/Borland Pascal 7 format by Milan Dadok (see http://sources.ru/pascal/hacker/intrfc70.htm). Since the basic format of DCU files is very similar to that, my guess is that DCU32INT built on that.

Later I found The Programmer’s Corner » TPU60C.ZIP » Pascal Source Code also by William L. Peavy and [WayBack] Duncan Murdoch’s Programs.

–jeroen

Posted in Borland Pascal, Delphi, Development, History, Pascal, Software Development, Turbo Pascal | Leave a Comment »

Naming: avoid abbreviations and acronyms in identifiers

Posted by jpluimers on 2020/10/07

I see lots of code using abbreviations. Please avoid those, just like many development stacks urge you to do so.

Two important reasons:

  1. avoid confusion
  2. make it easier to read code (you read code far more often than you write code)

This is not limited to the software development field; for similar reasons, the medical field also limits the use of abbreviations and acronyms:

Naming is already hard as it is, so do not make it any harder.

Have you ever named a pet or child? Naming in software development is even harder.

Maybe the tough job if naming is why so many people use a name like Util or Utils (which is already an abbreviation of Utility / Utilities) or Tool / Tools, but should be named like JunkDrawer.

Read more on that in [WayBackbetsythemuffin on Twitter: “Underrated programming techniques: name something (a step definitions file, a class, a directory, whatever….) “junk drawer.” Not “util” or something else that kind-of means “junk drawer” but pretends to dignity. Be bold. Admit what you’re doing. Do it with joy.”

 

References:

Many of these via:

–jeroen

Posted in Conference Topics, Conferences, Development, Event, Software Development | Leave a Comment »

 
%d bloggers like this: