Greetings, Indranil Das Gupta found this painful to see typo in getFrameworkLanguages: 'native_descrition'=>$language_set->{language_native_description}. I told him, tweaking C4/Languages requires writing a test (good rule of thumb). So, I wake up, and discover no tests were yet written, and I was itching for a sign off. So, I attempt and discover the hole is deeper than initially thought. In fact, Indranil Das Gupta pointed out to me that it doesn't seem to be used anywhere. mtompset@debian:~/kohaclone$ git grep getFrameworkLanguages C4/Languages.pm: memoize_memcached('getFrameworkLanguages' , memcached => C4::Context->memcached); Part of an export -- C4/Languages.pm: &getFrameworkLanguages More exporting -- C4/Languages.pm: @EXPORT_OK = qw(getFrameworkLanguages getTranslatedLanguages getAllLanguages getLanguages get_bidi regex_lang_subtags language_get_description accept_language getlanguage); POD stuff -- C4/Languages.pm:=head2 getFrameworkLanguages POD stuff example -- C4/Languages.pm: my $languages = getFrameworkLanguages(); Actual function head -- C4/Languages.pm:sub getFrameworkLanguages { As you can tell I didn't comment on one piece: that memoize_memcached line. Is there another thing to trace to figure out if it is used in the memoize logic somewhere, or is it safe to remove this function? Feedback appreciated. What bug 14284 becomes is dependent on feedback. http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14284 GPML, Mark Tompsett
We have dead code in lots of places. A cleanup is not a bad idea, but we should be careful with API changes because someone could be using it. I didn't spend time on looking at the code. We can add it to the agentda for the meeting. 2015-05-28 11:31 GMT-03:00 Mark Tompsett <mtompset@hotmail.com>:
Greetings,
Indranil Das Gupta found this painful to see typo in getFrameworkLanguages: 'native_descrition'=>$language_set->{language_native_description}. I told him, tweaking C4/Languages requires writing a test (good rule of thumb). So, I wake up, and discover no tests were yet written, and I was itching for a sign off. So, I attempt and discover the hole is deeper than initially thought. In fact, Indranil Das Gupta pointed out to me that it doesn't seem to be used anywhere.
mtompset@debian:~/kohaclone$ git grep getFrameworkLanguages C4/Languages.pm: memoize_memcached('getFrameworkLanguages' , memcached => C4::Context->memcached);
Part of an export -- C4/Languages.pm: &getFrameworkLanguages
More exporting -- C4/Languages.pm: @EXPORT_OK = qw(getFrameworkLanguages getTranslatedLanguages getAllLanguages getLanguages get_bidi regex_lang_subtags language_get_description accept_language getlanguage);
POD stuff -- C4/Languages.pm:=head2 getFrameworkLanguages
POD stuff example -- C4/Languages.pm: my $languages = getFrameworkLanguages();
Actual function head -- C4/Languages.pm:sub getFrameworkLanguages {
As you can tell I didn't comment on one piece: that memoize_memcached line. Is there another thing to trace to figure out if it is used in the memoize logic somewhere, or is it safe to remove this function? Feedback appreciated.
What bug 14284 becomes is dependent on feedback. http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14284
GPML, Mark Tompsett _______________________________________________ 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/
-- Tomás Cohen Arazi Prosecretaría de Informática Universidad Nacional de Córdoba ✆ +54 351 5353750 ext 13168 GPG: B76C 6E7C 2D80 551A C765 E225 0A27 2EA1 B2F3 C15F
Greetings, Shortly after I posted my note, I noticed bug 12017. It removes it. I think we may have a duplicate. Sorry, Indranil Das Gupta. GPML, Mark Tompsett From: Tomas Cohen Arazi Sent: Thursday, May 28, 2015 10:35 AM To: Mark Tompsett Cc: koha-devel Subject: Re: [Koha-devel] getFrameworkLanguages We have dead code in lots of places. A cleanup is not a bad idea, but we should be careful with API changes because someone could be using it. I didn't spend time on looking at the code. We can add it to the agentda for the meeting. 2015-05-28 11:31 GMT-03:00 Mark Tompsett <mtompset@hotmail.com>: Greetings, Indranil Das Gupta found this painful to see typo in getFrameworkLanguages: 'native_descrition'=>$language_set->{language_native_description}. I told him, tweaking C4/Languages requires writing a test (good rule of thumb). So, I wake up, and discover no tests were yet written, and I was itching for a sign off. So, I attempt and discover the hole is deeper than initially thought. In fact, Indranil Das Gupta pointed out to me that it doesn't seem to be used anywhere. mtompset@debian:~/kohaclone$ git grep getFrameworkLanguages C4/Languages.pm: memoize_memcached('getFrameworkLanguages' , memcached => C4::Context->memcached); Part of an export -- C4/Languages.pm: &getFrameworkLanguages More exporting -- C4/Languages.pm: @EXPORT_OK = qw(getFrameworkLanguages getTranslatedLanguages getAllLanguages getLanguages get_bidi regex_lang_subtags language_get_description accept_language getlanguage); POD stuff -- C4/Languages.pm:=head2 getFrameworkLanguages POD stuff example -- C4/Languages.pm: my $languages = getFrameworkLanguages(); Actual function head -- C4/Languages.pm:sub getFrameworkLanguages { As you can tell I didn't comment on one piece: that memoize_memcached line. Is there another thing to trace to figure out if it is used in the memoize logic somewhere, or is it safe to remove this function? Feedback appreciated. What bug 14284 becomes is dependent on feedback. http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14284 GPML, Mark Tompsett _______________________________________________ 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/ -- Tomás Cohen Arazi Prosecretaría de Informática Universidad Nacional de Córdoba ✆ +54 351 5353750 ext 13168 GPG: B76C 6E7C 2D80 551A C765 E225 0A27 2EA1 B2F3 C15F
I mentioned this in #koha a few weeks ago, but this seems like a perfect place to bring it up again: http://devblog.nestoria.com/post/115930183873/tombstones-for-dead-code Essentially, this is a method for adding executable markers near code that you want to remove. If you look for the results of the markers, and never find them, you know that the code has never been called, and is safe to remove (watch the video for discussion of a few subtle points) --Barton On Thu, May 28, 2015 at 10:35 AM, Tomas Cohen Arazi <tomascohen@gmail.com> wrote:
We have dead code in lots of places. A cleanup is not a bad idea, but we should be careful with API changes because someone could be using it. I didn't spend time on looking at the code. We can add it to the agentda for the meeting.
2015-05-28 11:31 GMT-03:00 Mark Tompsett <mtompset@hotmail.com>:
Greetings,
Indranil Das Gupta found this painful to see typo in getFrameworkLanguages: 'native_descrition'=>$language_set->{language_native_description}. I told him, tweaking C4/Languages requires writing a test (good rule of thumb). So, I wake up, and discover no tests were yet written, and I was itching for a sign off. So, I attempt and discover the hole is deeper than initially thought. In fact, Indranil Das Gupta pointed out to me that it doesn't seem to be used anywhere.
mtompset@debian:~/kohaclone$ git grep getFrameworkLanguages C4/Languages.pm: memoize_memcached('getFrameworkLanguages' , memcached => C4::Context->memcached);
Part of an export -- C4/Languages.pm: &getFrameworkLanguages
More exporting -- C4/Languages.pm: @EXPORT_OK = qw(getFrameworkLanguages getTranslatedLanguages getAllLanguages getLanguages get_bidi regex_lang_subtags language_get_description accept_language getlanguage);
POD stuff -- C4/Languages.pm:=head2 getFrameworkLanguages
POD stuff example -- C4/Languages.pm: my $languages = getFrameworkLanguages();
Actual function head -- C4/Languages.pm:sub getFrameworkLanguages {
As you can tell I didn't comment on one piece: that memoize_memcached line. Is there another thing to trace to figure out if it is used in the memoize logic somewhere, or is it safe to remove this function? Feedback appreciated.
What bug 14284 becomes is dependent on feedback. http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14284
GPML, Mark Tompsett _______________________________________________ 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/
-- Tomás Cohen Arazi Prosecretaría de Informática Universidad Nacional de Córdoba ✆ +54 351 5353750 ext 13168 GPG: B76C 6E7C 2D80 551A C765 E225 0A27 2EA1 B2F3 C15F
_______________________________________________ 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/
That is really a great idea! --Marc Am 28.05.2015 um 17:08 schrieb Barton Chittenden:
I mentioned this in #koha a few weeks ago, but this seems like a perfect place to bring it up again:
http://devblog.nestoria.com/post/115930183873/tombstones-for-dead-code
Essentially, this is a method for adding executable markers near code that you want to remove. If you look for the results of the markers, and never find them, you know that the code has never been called, and is safe to remove (watch the video for discussion of a few subtle points)
--Barton
On Thu, May 28, 2015 at 10:35 AM, Tomas Cohen Arazi <tomascohen@gmail.com <mailto:tomascohen@gmail.com>> wrote:
We have dead code in lots of places. A cleanup is not a bad idea, but we should be careful with API changes because someone could be using it. I didn't spend time on looking at the code. We can add it to the agentda for the meeting.
(...)
Hi, Bernardo Gonzales Kriegel made a lot of work with bug 12017 around this, and clean up getFrameworkLanguages and other useless things. It also move the language_description table out of database, and put it in templates. This is really interesting concerning traduction and performances ! Regards, Julian FIOL On 28/05/2015 16:31, Mark Tompsett wrote:
Greetings,
Indranil Das Gupta found this painful to see typo in getFrameworkLanguages: 'native_descrition'=>$language_set->{language_native_description}. I told him, tweaking C4/Languages requires writing a test (good rule of thumb). So, I wake up, and discover no tests were yet written, and I was itching for a sign off. So, I attempt and discover the hole is deeper than initially thought. In fact, Indranil Das Gupta pointed out to me that it doesn't seem to be used anywhere.
mtompset@debian:~/kohaclone$ git grep getFrameworkLanguages C4/Languages.pm: memoize_memcached('getFrameworkLanguages' , memcached => C4::Context->memcached);
Part of an export -- C4/Languages.pm: &getFrameworkLanguages
More exporting -- C4/Languages.pm: @EXPORT_OK = qw(getFrameworkLanguages getTranslatedLanguages getAllLanguages getLanguages get_bidi regex_lang_subtags language_get_description accept_language getlanguage);
POD stuff -- C4/Languages.pm:=head2 getFrameworkLanguages
POD stuff example -- C4/Languages.pm: my $languages = getFrameworkLanguages();
Actual function head -- C4/Languages.pm:sub getFrameworkLanguages {
As you can tell I didn't comment on one piece: that memoize_memcached line. Is there another thing to trace to figure out if it is used in the memoize logic somewhere, or is it safe to remove this function? Feedback appreciated.
What bug 14284 becomes is dependent on feedback. http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14284
GPML, Mark Tompsett _______________________________________________ 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/
participants (5)
-
Barton Chittenden -
Julian FIOL -
Marc Véron -
Mark Tompsett -
Tomas Cohen Arazi