H David,

the coding guidelines are in effect as documented on the wiki:

https://wiki.koha-community.org/wiki/Coding_Guidelines

Changes and additions are discussed regularly at the development meetings and documented in the meeting minutes. You can also 'watch' the wiki page to get informed whenever the page is changed. At the moment I think we don't use Moose in Koha.

Hope this helps,

Katrin


On 13.09.2016 01:38, David Cook wrote:

I didn’t even know Koha::Exceptions was a thing! How does it work? Wasn’t Kyle going to work on some sort of developer handbook so there would be a central repository of guidelines/patterns?

I read the Koha Coding Guidelines many moons ago, but it would be nice to know when there are updates. Since I’m not as active in the community these days, I don’t know if I have much of a say over things anymore, but it would be good to be informed of updates to the guidelines, so that a person can contribute more efficiently when one does contribute.

TryCatch requires Moose while Try::Tiny is lightweight, but I guess we’re going down the Moose rabbit hole anyways these days? Doesn’t TryCatch just do try/catch/catch instead of if/elsif/elsif?

David Cook

Systems Librarian

Prosentient Systems

72/330 Wattle St

Ultimo, NSW 2007

Australia

Office: 02 9212 0899

Direct: 02 8005 0595

*From:*koha-devel-boun...@lists.koha-community.org [mailto:koha-devel-boun...@lists.koha-community.org] *On Behalf Of *Tomas Cohen Arazi
*Sent:* Tuesday, 13 September 2016 4:32 AM
*To:* koha-devel <koha-devel@lists.koha-community.org>
*Subject:* [Koha-devel] Coding patterns discussion

I've been looking at our coding patterns, and noticed we haven't discussed/agreed on some stuff. Which is a good oportunity to just do it, now the Koha:: namespace is being filled with cool old-code rewrites with lots of test coverage.

- Transactions on heavy business functions that should definitely be wrapped inside a transaction.

Running

  $ cd Koha ; git grep txn

is just sad.

- Little use of Exceptions in Koha. We introduced them, but still don't extend its use. Maybe related to the next item.

I think we should keep general exceptions (like Koha::Exceptions::ObjectNotFound) in the general Koha::Exceptions namespace. But move the package-specific ones into its own file. To aid maintenance. A good candidate are Koha::Exceptions::Virtualshelves

- We don't use a Try/Catch library. It would make it easier to use Koha::Exceptions with a nice syntax.

There are a couple interesting libraries: Try::Tiny and TryCatch. [1] I prefer the latter because the type check seems nicer to write and eval (instead of an if/ifelse cascade checking ref($exception) eq 'Something'.

I have my opinions on this items, and it would be great to discuss it openly. There's code in bugzilla waiting for QA, and it'd be great to have some consensus on how to organize the code for the future.

Regards

[1] http://search.cpan.org/~ether/Try-Tiny-0.27/lib/Try/Tiny.pm <http://search.cpan.org/%7Eether/Try-Tiny-0.27/lib/Try/Tiny.pm> and http://search.cpan.org/~ash/TryCatch-1.003002/lib/TryCatch.pm <http://search.cpan.org/%7Eash/TryCatch-1.003002/lib/TryCatch.pm>

--

Tomás Cohen Arazi

Theke Solutions (https://theke.io <http://theke.io/>)
✆+54 9351 3513384
GPG: B2F3C15F



_______________________________________________
Koha-devel mailing list
Koha-devel@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

_______________________________________________
Koha-devel mailing list
Koha-devel@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to