New date/time formatting

Moderators: Gully, peteru

IanSav
Uber Wizard
Posts: 16846
Joined: Tue May 29, 2007 15:00
Location: Melbourne, Australia

Re: New date/time formatting

Post by IanSav » Mon Feb 27, 2017 21:16

Hi PeterU,
peteru wrote:Oh, bugger! It's the .value that really chucks a spanner in there.

Still, updating Setup.py to include the negation ability that matches Menu.py would be less code than the enabled/disabled kludge and provide a lot more benefit.
The code works. Nothing is broken and nothing is compromised. I will clean up the duplication when the environment supports the change. (I don't see the point of making any change to Setup.py now when there is far more important changes just around the corner.)

Does your post mean you will be welcoming of my Setup.py refactor?

Regards,
Ian.

User avatar
peteru
Uber Wizard
Posts: 9741
Joined: Tue Jun 12, 2007 23:06
Location: Sydney, Australia
Contact:

Re: New date/time formatting

Post by peteru » Mon Feb 27, 2017 21:26

IanSav wrote:Does your post mean you will be welcoming of my Setup.py refactor?
That totally depends on the quality of implementation.

Most of enigma2 could be improved, so from that point of view, if the changes are an improvement they should be welcome by everyone.

"Beauty lies in the hands of the beer holder."
Blog.

IanSav
Uber Wizard
Posts: 16846
Joined: Tue May 29, 2007 15:00
Location: Melbourne, Australia

Re: New date/time formatting

Post by IanSav » Mon Feb 27, 2017 21:40

Hi PeterU,
peteru wrote:
IanSav wrote:Does your post mean you will be welcoming of my Setup.py refactor?
That totally depends on the quality of implementation.
Are you trying to tell me something? I don't think that I am yet to submit a code change that has broken or crashed any system.

Regards,
Ian.

User avatar
peteru
Uber Wizard
Posts: 9741
Joined: Tue Jun 12, 2007 23:06
Location: Sydney, Australia
Contact:

Re: New date/time formatting

Post by peteru » Mon Feb 27, 2017 23:31

There's more to quality of implementation that a crash/not crash scenario.

Many metrics can be used, ranging from code legibility through execution speed, memory efficiency, lines of code, even API simplicity, predictability and ease of use and there's also documentation. Managers like to keep a track of time taken to deliver.

Quality implementations would score as high as possible on all those metrics and more. It's not always possible to reconcile all of these.

Code reviews tend to work well to improve code, but it is imperative that the process is devoid of emotion and is purely focused on technical details. Good code is often a result of revising and discarding many alternatives - it's not uncommon to spend most of the effort on code that will never make it.

As an example of what code review might bring to the table, here is a recent commit from OpenViX:

Code: Select all

 
+	def first(self):
+		if self.instance is not None:
+			self.instance.moveSelection(self.instance.moveTop)
+
+	def last(self):
+		if self.instance is not None:
+			self.instance.moveSelection(self.instance.moveEnd)
+
 	def pageUp(self):
 		if self.instance is not None:
 			self.instance.moveSelection(self.instance.pageUp)
 
 	def pageDown(self):
 		if self.instance is not None:
 			self.instance.moveSelection(self.instance.pageDown)
If I was involved in the code review for that, I would be asking why the proxy API uses first/last nomenclature for the functions that operate on the underlying eListbox. I would be suggesting that first/last should follow the underlying eListbox naming scheme and the functions should be called moveTop/moveEnd or similar. The reason being a predictable and uniform API - you don't want to work too hard on having to remember the correct synonym for the same actions depending on the context. I would expect either a good technical argument for keeping the code or a code change that implements the suggestion.

So, going back to your question... Whether I welcome your code changes will entirely depend on the code itself. OpenViX have a tendency to merge first and ask questions (or revert) later, so I suspect that what I think won't matter anyway. It'll just come down the pipeline. If you want input on the code, you can use Github or Bitbucket to push code on a topic branch and then invite people to take a look and comment. No guarantees that I will have time to be thorough, but I'll try to take a peek.

Please do keep in mind that criticism of the code is all about improving the code. It is in no way aimed at you and should not be taken as criticism of you as a person.

"Beauty lies in the hands of the beer holder."
Blog.

IanSav
Uber Wizard
Posts: 16846
Joined: Tue May 29, 2007 15:00
Location: Melbourne, Australia

Re: New date/time formatting

Post by IanSav » Tue Feb 28, 2017 01:18

Hi PeterU,

Regarding the comments about metrics and managerial expectations. I am an unpaid volunteer. There is no manager accounting for my time or effort, both are being offered in considerable excess. Execution speed and code size is very much a consideration in my coding. I may not get it right every time but I do try to create optimal code. Where improvements can be made I have revised code to improve size or speed. Some of the changes in the latest date / time updates, yet to be added to the Beyonwiz code, specifically address such issues. Credit must be given to the people who peer review my code and offer constructive input to make things smaller, faster and/or better. Most of the reviewers are polite and considerate with their words, reviews and suggestions and it makes working with them a fun and learning experience. Emotion generally only comes to the fore if the criticisms are perceived to be attacking and/or personal. The learning aspect is one of the best rewards of seeking peer reviews.

Referring to your example...

Not all the current Python functions use the same names as the C layer calls. The current Python names are logical and paired, the same can not be said for the C names. Comparing the C and Python names we have pageUp and pageDown that are logically paired, match exactly and are appropriate opposites, moveUp and moveDown match appropriately with up and down and are also logical opposite pairs. On the other hand the choice of "moveTop" and "moveEnd" are not comparable opposite pairs. The pairs should have been moveTop and moveBottom or moveStart and moveEnd. Rather than confuse the issue further and use one or other part of the unmatched pair I chose names that were more mnemonic and less confusing than the original C layer calls. With the other calls being up, down, pageUp and pageDown I felt that first and last would be appropriately memorable. I would have preferred top and bottom but that could have potentially created confusion. The best way to avoid that confusion was to use a navigational pair of word opposites that didn't cut across the C layer names. Realistically speaking the variable names I chose are not really all that significant or important as long as their meaning is clear. There are many more significant examples of bad variable names in the code. All this said I ask that you please note that I gave the function names some serious consideration before coding.

I note that the Beyonwiz version of this pull request is still outstanding. Is this because of the variable names? I won't use moveTop or top together with moveEnd or end for the reasons given above. If you want a change then would you accept my preference of top and bottom or the less preferred start and end even though both pairs will conflict with the C level names?

I feel that you often underestimate the care and consideration I put into my coding. In an appliance like a PVR I think usability, stability and reliability should be the top priority. Code efficiency is important but secondary. Is it really better that you crash the box faster with less memory usage? ;)

I do not create OpenViX pull requests on significant code changes until the code has been peer reviewed, tested and evaluated by the OpenViX developers. The code is work shopped in the private developers area first. When I get agreement the pull request is raised. I accept that this is not the norm on OpenViX but I prefer the peer review process and ask for my code to be tested offline first. The reason for the many date / time changes being filed was to address the stream of concerns raised here on the Beyonwiz forums. This could have been significantly condensed if the Beyonwiz users were able to beta test the code as I had originally intended.

I do not take your post in a negative way. As I have always said, I appreciate polite, considered and constructive input.

Regards,
Ian.

User avatar
peteru
Uber Wizard
Posts: 9741
Joined: Tue Jun 12, 2007 23:06
Location: Sydney, Australia
Contact:

Re: New date/time formatting

Post by peteru » Tue Feb 28, 2017 01:25

IanSav wrote:I note that the Beyonwiz version of this pull request is still outstanding. Is this because of the variable names?
No, not at all.

As I mentioned previously, I need to stop playing catchup with upstream and get a Beyonwiz release out. At this point in time I'll hold off on merges and will only cherry pick things that are needed to get the next release out the door. Once that is done, I'll do a big merge to pull in all the other stuff.

"Beauty lies in the hands of the beer holder."
Blog.

IanSav
Uber Wizard
Posts: 16846
Joined: Tue May 29, 2007 15:00
Location: Melbourne, Australia

Re: New date/time formatting

Post by IanSav » Tue Feb 28, 2017 01:43

Hi PeterU,

The pull request is on the Beyonwiz repository and matches the one accepted into OpenViX.

Regards,
Ian.

User avatar
peteru
Uber Wizard
Posts: 9741
Joined: Tue Jun 12, 2007 23:06
Location: Sydney, Australia
Contact:

Re: New date/time formatting

Post by peteru » Tue Feb 28, 2017 12:20

Sure, but it doesn't look like a change that is critical to getting the next release out the door. It's an addition to the API and there is no other enigma2 code that requires it.

Contrast this with the date/time changes - getting those cherry picked was important to get the complete functionality.

"Beauty lies in the hands of the beer holder."
Blog.

IanSav
Uber Wizard
Posts: 16846
Joined: Tue May 29, 2007 15:00
Location: Melbourne, Australia

Re: New date/time formatting

Post by IanSav » Tue Feb 28, 2017 12:48

Hi PeterU,
peteru wrote:Sure, but it doesn't look like a change that is critical to getting the next release out the door. It's an addition to the API and there is no other enigma2 code that requires it.
Not yet. ;) It is used in some new code upon which I am working.
peteru wrote:Contrast this with the date/time changes - getting those cherry picked was important to get the complete functionality.
Have you taken this latest update https://github.com/OpenViX/enigma2/pull/138 with all of MrQuade's requests?

Regards,
Ian.

User avatar
peteru
Uber Wizard
Posts: 9741
Joined: Tue Jun 12, 2007 23:06
Location: Sydney, Australia
Contact:

Re: New date/time formatting

Post by peteru » Tue Feb 28, 2017 16:40

IanSav wrote:Have you taken this latest update https://github.com/OpenViX/enigma2/pull/138 with all of MrQuade's requests?
I missed that one. Thanks for pointing it out.

I'll get it merged and push out an update as soon as I can.

"Beauty lies in the hands of the beer holder."
Blog.

User avatar
MrQuade
Uber Wizard
Posts: 11844
Joined: Sun Jun 24, 2007 13:40
Location: Perth

Re: New date/time formatting

Post by MrQuade » Tue Feb 28, 2017 19:39

IanSav wrote: Have you taken this latest update https://github.com/OpenViX/enigma2/pull/138 with all of MrQuade's requests?
Update is in. Looking good :)
Logitech Harmony Ultimate+Elite RCs
Beyonwiz T2/3/U4/V2, DP-S1 PVRs
Denon AVR-X3400h, LG OLED65C7T TV
QNAP TS-410 NAS, Centos File Server (Hosted under KVM)
Ubiquiti UniFi Managed LAN/WLAN, Draytek Vigor130/Asus RT-AC86U Internet
Pixel 4,5&6, iPad 3 Mobile Devices

Post Reply

Return to “Developers Community”