Talk:Element-wise operations: Difference between revisions

Content added Content deleted
No edit summary
No edit summary
Line 4: Line 4:
:It may be fine for educational purposes as long as we add a disclaimer saying that this is probably not the best way to do things in most languages (although we already have a disclaimer [[Rosetta_Code:General_disclaimer|here]] that says code here shouldn't be used for so called "serious work"). This task is probably pretty much perfect for array programming languages like [[APL]] and [[J]]. --[[User:Mwn3d|Mwn3d]] 20:54, 9 June 2011 (UTC)
:It may be fine for educational purposes as long as we add a disclaimer saying that this is probably not the best way to do things in most languages (although we already have a disclaimer [[Rosetta_Code:General_disclaimer|here]] that says code here shouldn't be used for so called "serious work"). This task is probably pretty much perfect for array programming languages like [[APL]] and [[J]]. --[[User:Mwn3d|Mwn3d]] 20:54, 9 June 2011 (UTC)
::I'm not worried about someone mistakenly using any code for mission critical job, but rather that choosing matrix as the subject here is suboptimal. The task basically wants to demonstrate operator overloading, and using a 1-D vector is good enough to show it--in fact better, because there would be less cruft involved. It's also questionable if it illustrates anything for a real matrix-oriented environment: in Matlab, you do element-wise multiplication between matrices by "a = b .* c", which is rather boring. And how is this task really unique from all the other existing matrix-related tasks on this site? --[[User:Ledrug|Ledrug]] 21:52, 9 June 2011 (UTC)
::I'm not worried about someone mistakenly using any code for mission critical job, but rather that choosing matrix as the subject here is suboptimal. The task basically wants to demonstrate operator overloading, and using a 1-D vector is good enough to show it--in fact better, because there would be less cruft involved. It's also questionable if it illustrates anything for a real matrix-oriented environment: in Matlab, you do element-wise multiplication between matrices by "a = b .* c", which is rather boring. And how is this task really unique from all the other existing matrix-related tasks on this site? --[[User:Ledrug|Ledrug]] 21:52, 9 June 2011 (UTC)
:::We do "suboptimal" tasks all the time (e.g. [[Sorting algorithms/Bogosort]], and [[Arithmetic/Complex]] and [[Stack]] probably fit your third-party library argument). The point here isn't necessarily to have useful/the best code examples (though it does happen sometimes). The point is to compare languages. Just because something is boring in one language doesn't preclude it from being interesting to show in all other languages or using user-generated code (see [[Factorial#J]]). Operator overloading is not the only route to go here. Basically any mathematical task we have here that takes arguments could be done as an operator (as long as you choose a symbol). This task wants to see the language idioms related to particular matrix operations should a user decide to implement them himself. Sometimes there is hidden value in these academic exercises (which is probably why they choose to use some of them in academia). --[[User:Mwn3d|Mwn3d]] 22:20, 9 June 2011 (UTC)