Talk:Arithmetic/Rational: Difference between revisions

m
→‎Too long: added comments about REXX code and subroutines, commented about brevity and whitespace. -- ~~~~
(→‎Too long: some languages (e.g. fortran) can grow even longer)
m (→‎Too long: added comments about REXX code and subroutines, commented about brevity and whitespace. -- ~~~~)
 
(5 intermediate revisions by 3 users not shown)
Line 19:
:Maybe still too long?... I've finished a Objective-C implementation... and it is 276 line long (and lacks pow); maybe not too much... I post it after few testing. --[[User:ShinTakezou|ShinTakezou]] 21:13, 14 February 2009 (UTC)
:And it's going worse with Fortran; I've implemented only = and + (and not all possible interfaces), and it takes already 120 lines of code... --[[User:ShinTakezou|ShinTakezou]] 23:27, 14 February 2009 (UTC)
 
:I had the same problem with my REXX example, I had to resort to making some subroutines into ''one-liners'' (subroutines that detracted from the task's requirements), and remove quite a bit of whitespace to keep the program brief (as possible). -- [[User:Gerard Schildberger|Gerard Schildberger]] 08:10, 8 January 2013 (UTC)
 
=== languages that already implement rational numbers? ===
Line 40 ⟶ 42:
 
: I see what you are saying, but, Python isn't Ipython - we should explicitly explain when functionality is added by libraries that are not part of the standard distribution. --[[User:Paddy3118|Paddy3118]] 16:26, 14 February 2009 (UTC)
 
==Too long language examples==
After just considering adding an incomplete tag to the C entry and then finding on the talk page a reference about the Algol example being long too I am thinking about what should be done in these cases of bits being missed out for brevity's sake ''on this particular task''.
 
For comparison reasons it might be best to encourage people, maybe other people, to complete short examples and link to their entries when their completed entries are moved to a sub-page. In that case marking them as incomplete would help those searching for examples to finish-off. --[[User:Paddy3118|Paddy3118]] 00:58, 30 July 2011 (UTC)
 
: You can either write an elaborate, robust example, or a short, clear example, but rarely both. And it doesn't help that this task is asking for too much. Why integer division operator? Why abs aperator? What's the "etc" in "cast int to frac, etc"? For a fraction implemetation to be reasonably useful, arbitrary length integer like GMP is almost a must, but GMP already implements rationals, making an implemetation pointless. I think the task could be changed so that if an example implementation made the basic idea of a fraction class clear enough, and good enough to do the given test, it should be considered done. After all, code here intend to demonstrate, not to serve production needs. --[[User:Ledrug|Ledrug]] 02:10, 30 July 2011 (UTC)
:: +1 on that. --[[User:Paddy3118|Paddy3118]] 03:03, 30 July 2011 (UTC)