Re: How convice people that D it's wonderfull in a hour ?

2011-10-16 Thread Granville Barnett

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


How convice people that D it's wonderfull in a hour ?

2011-10-09 Thread Zardoz
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 ?


Re: How convice people that D it's wonderfull in a hour ?

2011-10-09 Thread Robert Clipsham

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/


Re: How convice people that D it's wonderfull in a hour ?

2011-10-09 Thread Dmitry Olshansky

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


Re: How convice people that D it's wonderfull in a hour ?

2011-10-09 Thread Trass3r
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.


Re: How convice people that D it's wonderfull in a hour ?

2011-10-09 Thread maarten van damme
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 :)


Re: How convice people that D it's wonderfull in a hour ?

2011-10-09 Thread deadalnix

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.


Re: How convice people that D it's wonderfull in a hour ?

2011-10-09 Thread Roderick Gibson

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.