The Artima Developer Community
Sponsored Link

Java Community News
Syntactic Sugar: What Makes It Sweet ?

21 replies on 2 pages. Most recent reply: Oct 7, 2008 8:45 PM by art src

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 21 replies on 2 pages [ « | 1 2 ]
Carson Gross

Posts: 153
Nickname: cgross
Registered: Oct, 2006

Re: Syntactic Sugar: What Makes It Sweet ? Posted: Apr 30, 2008 8:52 AM
Reply to this message Reply
Advertisement
> The point I was making is that there is no "we should be
> trying to....".

I don't think I understand. You are saying you have a problem with my use of the word "we"?

Maybe if you explained it to me again...

Cheers,
Carson

Dick Ford

Posts: 149
Nickname: roybatty
Registered: Sep, 2003

Re: Syntactic Sugar: What Makes It Sweet ? Posted: Apr 30, 2008 9:50 AM
Reply to this message Reply
We'd be better off focusing on what makes good library and framework design (my opinion: make the simple things *dead* simple and the hard things possible) rather than inventing new DSLs. Unfortunately, the latter is more fun and sexier, so we'll have to fight its allure.

Maybe I misunderstood your original post (given above) and what you mean by "we". But the point is (and expressed pretty well by Bill Pyne) is that different teams and individual developers work productively with different tools (there's no one size fits all). So there's no point and it's even a little arrogant to start trying to speak for others.

Morgan Conrad

Posts: 307
Nickname: miata71
Registered: Mar, 2006

Re: Syntactic Sugar: What Makes It Sweet ? Posted: Apr 30, 2008 10:46 AM
Reply to this message Reply
Dick, despite repeated appeals for you to get into the real debate and offer an example of what you think is "good" syntactic sugar, you instead argue pedantically over "we" vs. "I".

Therefore, I assume you have no good examples of syntactic sugar, illustrating that WE are better off without it.

Dick Ford

Posts: 149
Nickname: roybatty
Registered: Sep, 2003

Re: Syntactic Sugar: What Makes It Sweet ? Posted: Apr 30, 2008 11:35 AM
Reply to this message Reply
> Dick, despite repeated appeals for you to get into the
> real debate and offer an example of what you think is
> "good" syntactic sugar, you instead argue pedantically
> over "we" vs. "I".
>
> Therefore, I assume you have no good examples of syntactic
> sugar, illustrating that WE are better off without
> it.

I just gave an example regarding the using statement, but I guess you weren't interested in following the "real debate"

Morgan Conrad

Posts: 307
Nickname: miata71
Registered: Mar, 2006

Re: Syntactic Sugar: What Makes It Sweet ? Posted: Apr 30, 2008 2:18 PM
Reply to this message Reply
You said:

"You would rather the language restrict someone from doing their own using (C#) statement and I would rather have something like a Boo macro system in order to be able to do my own"

Well, it took me quite a while to parse your statement. Since "using (C#) statement" sounded like normal english to me, not code with the using keyword. And Boo, which I have never heard of before, is close to Foo, a normal "whatever" code word. That's why "we" are asking for an actual example.

Now that I undedrstand your point, the first thing I notice is that in Boo if I go

using SomethingThatIsntDisposable

nothing happens, even though I think I'm doing something clever about releasing resources. C# would (I assume, I've never used C# nor Boo) throw a compiler error. Suddenly, the "using" keyword acts differently than one might expect. Which is why many of us (the great "we") distrust syntactic sugar.

Gregor Zeitlinger

Posts: 108
Nickname: gregor
Registered: Aug, 2005

Re: Syntactic Sugar: What Makes It Sweet ? Posted: May 24, 2008 11:56 AM
Reply to this message Reply
> Again, I'm willing to change my opinion if you can show me
> a good, simple example of DSLs (the original topic) that
> solves a believable business logic problem in a way that
> general purpose would stumble over syntactically.
I think XAML (technically: the WPF dialect of XAML) (or it's predecessor XUL) is a pretty convincing example.

Is there any GUI API that is equally concise?

Or would you reject XAML because there is a canonical mapping to Objects?

art src

Posts: 33
Nickname: articulate
Registered: Sep, 2005

Re: Syntactic Sugar: What Makes It Sweet ? Posted: Oct 7, 2008 8:45 PM
Reply to this message Reply
I can't think of anything better than XPath to reference nodes in XML documents. I think XPath is an excellent DSL.

Others useful languages include make, ant, ivy, maven, JRules, SQL, XQuery, HTML, XSLT, BPEL, properties files, a miriad of graphics files, such as .rc files.

I think if this as a cost benefit issue. Currently DSL's have a high cost, so lots of potential DSL's are not cost effective. I don't see this as a good argument for keeping the cost artificially high. I don't know how low the cost can go.

Flat View: This topic has 21 replies on 2 pages [ « | 1  2 ]
Topic: WebKit Project Releases New JavaScript Performance Benchmark Previous Topic   Next Topic Topic: Sun Releases NetBeans 6.1

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use