Guillaume Piolat via Digitalmars-d-announce <> napsal St, led 4, 2017 v 11∶48 :
On Friday, 30 December 2016 at 04:19:47 UTC, apz28 wrote:
This is my first package to learn D. Suggestion for improvement is welcome.

Welcome here!

- you don't have to commit .sln files, dub can generate them as needed
- that is for a package that will be reused you can use dub :)
- no need to use @property, there was a recent discussion about it. I think you can ignore it altogether.

        Yes he can but I still prefer it for documentation purposes :)

- you can use "final" before a class declaration to have all methods be final

  final class C { /* all methods are final /= }

Most common and IMHO better pattern is put final as first thing in class like this:
        class C {
                final: // all methods after this are final

It has some advantages (class C is not final so you can still use inheritance), marking class final does not need to mean all methods are final (it makes sense to mark them and in curent implementation it is) you can still add easy one method which is virtual. To be fair I mostly use struct instead of final clases

- no need for "public import std.exception : Exception;" to use Exception

imho the XML parser to beat in our ecosystem is kxml, which is small and serviceable

Reply via email to