Comments on: About the unused-argument syntax in R2009b https://blogs.mathworks.com/steve/2010/01/11/about-the-unused-argument-syntax-in-r2009b/?s_tid=feedtopost Retired from MathWorks in 2024 after 30 years of service. Can now be found at MATLAB Central, https://hornjourney.com, and https://matrixvalues.com. MathWorks career included image processing, toolbox development, MATLAB development and design, development team management, MATLAB design standards, Steve on Image Processing blog (https://blogs.mathworks.com/steve). Co-author of Digital Image Processing Using MATLAB (https://www.imageprocessingplace.com/DIPUM-3E/dipum3e_main_page.htm). French horn enthusiast, member of Concord Orchestra and Melrose Symphony, member of the board of Cormont Music and the Kendall Betts Horn Camp. Tue, 29 Oct 2019 17:20:01 +0000 hourly 1 https://wordpress.org/?v=6.2.2 By: Steve https://blogs.mathworks.com/steve/2010/01/11/about-the-unused-argument-syntax-in-r2009b/#comment-23790 Fri, 17 Dec 2010 16:43:23 +0000 https://blogs.mathworks.com/steve/2010/01/11/about-the-unused-argument-syntax-in-r2009b/#comment-23790 Matt—Getting pushback on this did not surprise me at all. Language syntax always draws contradictory feedback. Also, internal MathWorks discussions on language features tend to be much more “spirited” than anything I’ve seen here.

I don’t share your disparaging view of engineers. They don’t typically regard themselves as programmers, and they typically don’t have substantial programmer training. They want to use MATLAB as a tool to get a task done, and for them the primary deliverable is often NOT the code. Our job at MathWorks is to help them get their task done.

Along the way we are also trying to improve the MATLAB language and environment for use by programmers.

]]>
By: Matt https://blogs.mathworks.com/steve/2010/01/11/about-the-unused-argument-syntax-in-r2009b/#comment-23782 Mon, 13 Dec 2010 18:14:45 +0000 https://blogs.mathworks.com/steve/2010/01/11/about-the-unused-argument-syntax-in-r2009b/#comment-23782 While I agree this is a great feature in Matlab, I must say that the pushback you are getting from your community is not suprising to me. It comes down to the fundamental fact that I have found in my experiances that engineers make really horrible computer scientists/programmers. They don’t care that they have to overwrite a variable, let it sit unused, or wait for the junk collector to take it away for them (in modern languages of course). They do what works the in the most uneligant and kludgy way possible that still computes the needed answer and then they move on. I applaud efforts language architects make to make programs easier to read because we all know that the programmer isn’t going to take the 60 seconds to write a decent header and add a few key comments.

]]>
By: OysterEngineer https://blogs.mathworks.com/steve/2010/01/11/about-the-unused-argument-syntax-in-r2009b/#comment-22625 Mon, 18 Jan 2010 16:19:55 +0000 https://blogs.mathworks.com/steve/2010/01/11/about-the-unused-argument-syntax-in-r2009b/#comment-22625 It was nice that you wrote, “I think it’s important for the programmer to communicate his or her intent very clearly . . .”

Over 40 years ago, Dijkstra went even further by saying in effect that the programmer’s primary task is to write the code in a way that demonstrates that the code is correct, just by reading it.

I like the new ~ syntax since it makes it easier to produce quiet MLint reports.

But, like others have mentioned, I would have used the [] rather than the ~.

]]>
By: Bård Skaflestad https://blogs.mathworks.com/steve/2010/01/11/about-the-unused-argument-syntax-in-r2009b/#comment-22619 Sat, 16 Jan 2010 12:35:17 +0000 https://blogs.mathworks.com/steve/2010/01/11/about-the-unused-argument-syntax-in-r2009b/#comment-22619 Steve,

Thank you for addressing this issue. I voiced an opinion when Loren discussed this last autumn, but I think I was a little too reluctant to the syntax at the time. Having had a few months’ experience with this I find I more frequently reach for tilde when I wish to ignore an output or more. I personally think that using the tilde symbol as a placeholder clearly shows intent. This was the right thing to do in my opinion.

Still, backwards compatibility dictates that I don’t use this feature in any code intended for a purpose other than “has to run on my workstation right now”. I don’t foresee being able to use this in code I distribute to others for at least another couple of years. In portable code I tend to prefer the

   [ind, ind] = sort(X)

method.

Thank you again for delving into some of the history of this feature.

Bård Skaflestad

]]>
By: Steve https://blogs.mathworks.com/steve/2010/01/11/about-the-unused-argument-syntax-in-r2009b/#comment-22617 Fri, 15 Jan 2010 19:12:58 +0000 https://blogs.mathworks.com/steve/2010/01/11/about-the-unused-argument-syntax-in-r2009b/#comment-22617 Matt—I don’t really know. The use cases we’re talking about here come up fairly rarely in my own programming, and usually not in bottleneck code that’s worth optimizing.

]]>
By: Matt Whitaker https://blogs.mathworks.com/steve/2010/01/11/about-the-unused-argument-syntax-in-r2009b/#comment-22615 Fri, 15 Jan 2010 17:00:59 +0000 https://blogs.mathworks.com/steve/2010/01/11/about-the-unused-argument-syntax-in-r2009b/#comment-22615 I like the new format. It makes the programmers intention crystal clear.

But how much of a performance hit are we talking about…

I don’t see much of one on my system.

]]>
By: Steve https://blogs.mathworks.com/steve/2010/01/11/about-the-unused-argument-syntax-in-r2009b/#comment-22606 Tue, 12 Jan 2010 01:26:06 +0000 https://blogs.mathworks.com/steve/2010/01/11/about-the-unused-argument-syntax-in-r2009b/#comment-22606 Oleg—The performance difference is merely an implementation issue, because the two forms are semantically equivalent. I expect the performance difference will go away in a future release.

]]>
By: Steve https://blogs.mathworks.com/steve/2010/01/11/about-the-unused-argument-syntax-in-r2009b/#comment-22605 Tue, 12 Jan 2010 01:23:52 +0000 https://blogs.mathworks.com/steve/2010/01/11/about-the-unused-argument-syntax-in-r2009b/#comment-22605 Lars—I do not understand your comment about consistency with the input argument list. This is not legal syntax:

function y = foobar(a,[],c)

On the other hand, the new tilde syntax is consistently available for both the input and the output argument list.

In my opinion, there is no chance that this particular syntax choice will be revisited.

]]>
By: Oleg Komarov https://blogs.mathworks.com/steve/2010/01/11/about-the-unused-argument-syntax-in-r2009b/#comment-22604 Mon, 11 Jan 2010 22:38:42 +0000 https://blogs.mathworks.com/steve/2010/01/11/about-the-unused-argument-syntax-in-r2009b/#comment-22604 I do not use ~ because the performance is poor compared to other syntaxes ([IDX,IDX] = … or [DUMMY, IDX] = …)

Poor performance was also underlined in the previous contest…tildes were replaced.

I think that the tilde will become an interesting feature if the computation of that precise argument can be completely avoided…which is, always according to my opinion, very improbable.

Oleg

]]>
By: Lars Barring https://blogs.mathworks.com/steve/2010/01/11/about-the-unused-argument-syntax-in-r2009b/#comment-22603 Mon, 11 Jan 2010 21:09:32 +0000 https://blogs.mathworks.com/steve/2010/01/11/about-the-unused-argument-syntax-in-r2009b/#comment-22603 Well, [ ] seems to me like the obvious candidate because of consistency in syntax with the input argument list.
If it actually is possible from a parsing point of view to use [ ] I would eagerly like to suggest that you introduce it as an alternative syntax.
/Lars

]]>