delphi icon indicating copy to clipboard operation
delphi copied to clipboard

Consider consistency for the exercises

Open kytrinyx opened this issue 9 years ago • 22 comments

  • Is there a style guide for Delphi?
  • Are these styles encouraged or enforced?
  • Are there any conventions that we should adopt on this track for the sake of consistency?
  • Can we enforce these?
  • Is there a linter? Are there many? Should we use one?
  • Is there a common convention for filenames? If not, what should our convention be?

Note that this is about the exercises (the test suites and code examples), not people's solutions.

kytrinyx avatar Oct 03 '16 14:10 kytrinyx

Embarcadero has this style guide. This is a guide consisting of suggestions, they are not enforced by the Delphi IDE.

rpottsoh avatar Feb 06 '17 18:02 rpottsoh

Is there a linter for it, based on that guide? (Is this closed prematurely? It does not seem like the points are really answered yet.)

kotp avatar Feb 06 '17 20:02 kotp

I am not aware of any linter. The style guide is only a suggestion on how one should style their code. It is not enforced.

rpottsoh avatar Feb 06 '17 20:02 rpottsoh

It is not enforced. Can it be set to be enforced? I don't think we should aside from the 'very strongly adopted' styles, if even that. It is something that can limit communication, at times. If so, it should be easy to communicate that the style was deviated from and disable the check for that(those) statement(s).

Should there be a link to that style guide in the documentation, for the development notes?

kotp avatar Feb 07 '17 21:02 kotp

I know of no way to enforce a particular style. I know the IDE has the ability to format your code, I've never used it and it is voluntary.

A link to the guide is not a bad idea. Where in the documentation should it be mentioned?

rpottsoh avatar Feb 07 '17 22:02 rpottsoh

Could be delivered in the first exercise, or in the documentation for the track. Perhaps mentioned in first exercise, but stored in the documentation for the track more fully.

kotp avatar Feb 07 '17 22:02 kotp

I see no problem providing it in the first exercise (I presume this is hello-world). Where would it be stored in the documentation? How would it be provided in the first exercise? I know there is a readme file supplied with each exercise fetched, but I recall off the top of my head how to affect what goes in that file, and specifically on an exercise by exercise basis.

rpottsoh avatar Feb 07 '17 22:02 rpottsoh

In the Ruby track, we use a GETTING_STARTED.md file in the exercise folder. This has instructions for the student to help get started.

kotp avatar Feb 08 '17 03:02 kotp

I'll check it tomorrow. Thanks

rpottsoh avatar Feb 08 '17 04:02 rpottsoh

See you then!

kotp avatar Feb 08 '17 08:02 kotp

Here's the documentation about exercise READMEs: https://github.com/exercism/exercism.io/blob/master/docs/fixing-exercise-readmes.md

kytrinyx avatar Feb 12 '17 07:02 kytrinyx

Yes, that one, thank you very much @kytrinyx ...

kotp avatar Feb 12 '17 17:02 kotp

I'm kind of stuck here until the revamped hello-world changes fall out. I think this discussion no longer applies to hello-world, but I am not yet sure which exercise is taking over the roll the H-W once filled. Are we getting a new exercise, perhaps a greeter or should bob pick up the reigns?

rpottsoh avatar Feb 20 '17 16:02 rpottsoh

I've suggested a replacement for the old hello-world here: https://github.com/exercism/problem-specifications/issues/548 I hope we can land on a spec for it in the next few days.

kytrinyx avatar Feb 20 '17 17:02 kytrinyx

Putting the Object Pascal Style Guide here so I can find it easier later. This document is pretty old. Will have to test all the links and remove the ones that are broken.

rpottsoh avatar May 26 '17 19:05 rpottsoh

@kytrinyx said:

Here's the documentation about exercise READMEs: https://github.com/exercism/exercism.io/blob/master/docs/fixing-exercise-readmes.md

@kytrinyx the above link is broken. I am trying to figure out where the file has gone to (assuming /docs repo) and what the file's name is. Thanks.

rpottsoh avatar Jul 10 '17 15:07 rpottsoh

Ah, sorry! https://github.com/exercism/docs/blob/master/language-tracks/exercises/anatomy/readmes.md

kytrinyx avatar Jul 10 '17 18:07 kytrinyx

No worries. Thanks @kytrinyx

rpottsoh avatar Jul 10 '17 18:07 rpottsoh

In active development for formatting. Taking advantage of github support for org files.

kotp avatar Jul 24 '17 19:07 kotp

Is there a style guide for Delphi?

http://edn.embarcadero.com/article/10280

Are these styles encouraged or enforced?

Encouraged by the style guide, yes. Enforced by the IDE, no.

Are there any conventions that we should adopt on this track for the sake of consistency?

A recent development that I have decided to adopt is to not use inline variable declarations or type inference in test suites. This capability has only become possible in the latest version of Delphi released at the end of 2018. Any code written using these new language features will not compile in older versions of Delphi. I am not enforcing this rule on solutions or examples.

Can we enforce these?

Manually, yes.

Is there a linter? Are there many? Should we use one?

I am not aware of any linter.

Is there a common convention for filenames? If not, what should our convention be?

No common naming convention other than files containing code have .pas extension. Files that contain UI information have .dfm extension.

This quickly covers the points raised in the first comment.

rpottsoh avatar Jan 19 '19 03:01 rpottsoh

It sounds like the most useful next step here, then, would be to document in the README or contributing file the conventions that are in place, and then not worry about automation.

kytrinyx avatar Feb 18 '19 23:02 kytrinyx

It sounds like the most useful next step here, then, would be to document in the README or contributing file the conventions that are in place,

I agree. I have ignored the README for this repo.

rpottsoh avatar Feb 19 '19 02:02 rpottsoh