www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How convice people that D it's wonderfull in a hour ?

reply Zardoz <luis.panadero gmail.com> writes:
Recently I've been asked if I could give a speech about D in my university. It
will be of one hour of long.
I not respond yet, but I think that I will do it. Actually I have the problem
that I don't know well how explain well too many features and things of D that
I like. I think that only talking about D's arrays and type system I will need
around half-hour.
Any recommendation of how I should focus it ?
Oct 09 2011
next sibling parent Robert Clipsham <robert octarineparrot.com> writes:
On 09/10/2011 11:00, Zardoz wrote:
 Recently I've been asked if I could give a speech about D in my university. It
 will be of one hour of long.
 I not respond yet, but I think that I will do it. Actually I have the problem
 that I don't know well how explain well too many features and things of D that
 I like. I think that only talking about D's arrays and type system I will need
 around half-hour.
 Any recommendation of how I should focus it ?

My best advise would be to assume everyone is closed-minded, has a favorite language, and has no intention to switch away from it or try anything different. Don't try and sell D to them, just tell them about it - trying to tell them/imply D is better will cause them to dislike it for no real reason. If you can get some audience participation in there then you can judge how they're reacting to it and adjust as necessary. As for content, assuming everyone has a decent general knowledge of programming in general, I'd talk about cool stuff that D can do that other languages can do but in more difficult ways. Talk about things that can go well beyond the scope of your talk so people can go away and try it after if they like. I advise you refer to some of Andrei's talks for ideas, you can generally see how well things work/don't work based on questions from the audience/Andrei's responses. I forget the topic, but there's definitely been a couple of occasions where Andrei didn't have a decent response (free copies of TDPL were given out as a result ;)). -- Robert http://octarineparrot.com/
Oct 09 2011
prev sibling next sibling parent Dmitry Olshansky <dmitry.olsh gmail.com> writes:
On 09.10.2011 14:00, Zardoz wrote:
 Recently I've been asked if I could give a speech about D in my university. It
 will be of one hour of long.
 I not respond yet, but I think that I will do it. Actually I have the problem
 that I don't know well how explain well too many features and things of D that
 I like. I think that only talking about D's arrays and type system I will need
 around half-hour.
 Any recommendation of how I should focus it ?

Depending on the audience if I'd be giving a talk to a gang of C++ programmers I'd try to focus on small separate cool topics like: -arrays & slices, with optional GC -delegates & nested functions -scope(exit/success/failure) -simple uses of CTFE Then maybe clean template with static if & template constraints, maybe variadic template and alias params, maybe codegen with string mixin. Stuff like typeof(...) and __traits usually blows mind off way too early. Based on my (limited) experience with fellow programmers it's only hurts to go into greater detail, it causes thoughts like 'as huge as C++ and with a pack of new pitfalls' and little to no enthusiasm. So you'd have to place your bet on a few prime features (e.g. 3 like in one of Andrei talk). And then you can casually present a short list of other cool features and say a thing or two about them, not forgetting that there is even more. -- Dmitry Olshansky
Oct 09 2011
prev sibling next sibling parent Trass3r <un known.com> writes:
Talk about stuff that's hard to do or impossible in C++ (or just a PITA  
like the whole language) and compare it to some nifty D code.

For example template metaprogramming. No easy way to do template  
constraints, no is expressions nor a proper typeof so you have to use  
specialization a lot.
You could also show something that checks for an "interface" at  
compile-time, like
template isInputRange(R)
{
     enum bool isInputRange = is(typeof(
     {
         R r;              // can define a range object
         if (r.empty) {}   // can test for empty
         r.popFront();     // can invoke popFront()
         auto h = r.front; // can get the front of the range
     }()));
}

CTFE is another strong feature.
You could for example show some code that generates Token handling code  
(an enum for the tokens, associative arrays for token 2 string and the  
other way around, etc.) to be used by a lexer without the necessity for a  
DSL like in Clang or a separate tool like dmd.
Oct 09 2011
prev sibling next sibling parent maarten van damme <maartenvd1994 gmail.com> writes:
--0016e6dd97a5ac0bbf04aee3b795
Content-Type: text/plain; charset=ISO-8859-1

Things that really convince me are comparisons with already existing stuff.
Show what the problems are with an example program like c++ or java and show
how d resolves the issue. Be careful though, one of the first things that
put me off is when I feel it's too biased and they only show possitive
points. "if something is too good to be true it usually is"

show them how open D is to multiple programming paradigms and how well it is
integrated in the language.
show them the shining points of D like it's array's or CTFE.
show how beautifully the syntax looks compared to c++.
Show them that with D you can write high level but go low level very easily
if you need it.

Just playing with ideas here :)

--0016e6dd97a5ac0bbf04aee3b795
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Things that really convince me are comparisons with already existing stuff.=
 Show what the problems are with an example program like c++ or java and sh=
ow how d resolves the issue. Be careful though, one of the first things tha=
t put me off is when I feel it&#39;s too biased and they only show possitiv=
e points. &quot;if something is too good to be true it usually is&quot;<div=

d how well it is integrated in the language.=A0</div><div>show them the shi= ning points of D like it&#39;s array&#39;s or CTFE.</div><div>show how beau= tifully the syntax looks compared to c++.</div> <div>Show them that with D you can write high level but go low level very e= asily if you need it.</div><div><br></div><div>Just playing with ideas here= :)</div> --0016e6dd97a5ac0bbf04aee3b795--
Oct 09 2011
prev sibling next sibling parent reply deadalnix <deadalnix gmail.com> writes:
Le 09/10/2011 12:00, Zardoz a écrit :
 Recently I've been asked if I could give a speech about D in my university. It
 will be of one hour of long.
 I not respond yet, but I think that I will do it. Actually I have the problem
 that I don't know well how explain well too many features and things of D that
 I like. I think that only talking about D's arrays and type system I will need
 around half-hour.
 Any recommendation of how I should focus it ?

I think you should show through several exemples. AS IT IS UNIVERSITY, I guess your public will know about programming. Explain difference between struct and classes, and how it is great compared to C++ (no slicing for exemple). Show some stuffs about first class function and delegates (for callback for exemple) coppared to how painful it is in C++ or java (using interface and useless object) Then, gove a talk aboit metaprogramming (how you can implement behaviral pattern with no cost at runtime, how you can make very generic code like STL) and why it is way better than C++ (usability with stuffs like static if) or java (generic isn't metaprogramming). And last but not least : explain memory model and how it help to deal with multithrading problems where other languages usually aren't good. The point isn't to bash C++ or java, but to show how some problem you face in thoses languages can be solved elegantly in D. If your public knows others languages than java and C++, then adapt the speach to what they know.
Oct 09 2011
parent Roderick Gibson <kniteli gmail.com> writes:
On 10/9/2011 5:18 PM, deadalnix wrote:
 Le 09/10/2011 12:00, Zardoz a écrit :
 Recently I've been asked if I could give a speech about D in my
 university. It
 will be of one hour of long.
 I not respond yet, but I think that I will do it. Actually I have the
 problem
 that I don't know well how explain well too many features and things
 of D that
 I like. I think that only talking about D's arrays and type system I
 will need
 around half-hour.
 Any recommendation of how I should focus it ?

I think you should show through several exemples. AS IT IS UNIVERSITY, I guess your public will know about programming. Explain difference between struct and classes, and how it is great compared to C++ (no slicing for exemple). Show some stuffs about first class function and delegates (for callback for exemple) coppared to how painful it is in C++ or java (using interface and useless object) Then, gove a talk aboit metaprogramming (how you can implement behaviral pattern with no cost at runtime, how you can make very generic code like STL) and why it is way better than C++ (usability with stuffs like static if) or java (generic isn't metaprogramming). And last but not least : explain memory model and how it help to deal with multithrading problems where other languages usually aren't good. The point isn't to bash C++ or java, but to show how some problem you face in thoses languages can be solved elegantly in D. If your public knows others languages than java and C++, then adapt the speach to what they know.

The threading model is what attracted me to D.
Oct 09 2011
prev sibling next sibling parent %u <foo bar.com> writes:
== Quote from Zardoz (luis.panadero gmail.com)'s article
 Recently I've been asked if I could give a speech about D in my

 will be of one hour of long.
 I not respond yet, but I think that I will do it. Actually I have

 that I don't know well how explain well too many features and

 I like. I think that only talking about D's arrays and type

 around half-hour.
 Any recommendation of how I should focus it ?

Well, I am going through the DPL book. The first chapter is pretty cool. Maybe just shamelessly copy Andreescu's chapter 1, but throw in stuff about garbage collection and threading model, which I think are pretty cool. I think having some cool examples that highlight features of the language is the way to go. Good luck with your presentation!
Oct 10 2011
prev sibling parent Granville Barnett <granville gbarnett.org> writes:
On 09/10/2011 18:00, Zardoz wrote:
 Recently I've been asked if I could give a speech about D in my university. It
 will be of one hour of long.
 I not respond yet, but I think that I will do it. Actually I have the problem
 that I don't know well how explain well too many features and things of D that
 I like. I think that only talking about D's arrays and type system I will need
 around half-hour.
 Any recommendation of how I should focus it ?

For me the selling points of D are as follows: - encourages what all good programmer do today but with the assistance of libraries, i.e. D provides unit testing and contracts that are actually part of the language...now there's no excuse - sanitized templates - "there if you want it" philosophy: you can use D to access the guts if you want to but in a way that is far more powerful than that offered by the likes of Java, C# etc (languages that your colleagues may well use very often) HTH GB
Oct 16 2011