In your opinion, what is interesting about the code??

  • Thread starter Thread starter TJO
  • Start date Start date
T

TJO

Question:
Let us say we're using .Net 4.0, and IsPrime(int x) is a function that
determines whether a number is a prime number or not:

var simplelist = Enumerable.Range(1, 1000000);

var q = from x in simplelist.AsParallel()
where IsPrime(x)
select x;

foreach (var x in q)
{
Console.WriteLine(x);
}

In your opinion, what is interesting about the code listed above and
why is this important for the future of programming?
 
TJO said:
Question:
Let us say we're using .Net 4.0, and IsPrime(int x) is a function that
determines whether a number is a prime number or not:

var simplelist = Enumerable.Range(1, 1000000);

var q = from x in simplelist.AsParallel()
where IsPrime(x)
select x;

foreach (var x in q)
{
Console.WriteLine(x);
}

In your opinion, what is interesting about the code listed above and
why is this important for the future of programming?

I will wait with answering the question until I am sure that your test
is over...
 
Question:
Let us say we're using .Net 4.0, and IsPrime(int x) is a function that
determines whether a number is a prime number or not:

var simplelist = Enumerable.Range(1, 1000000);

var q = from x in simplelist.AsParallel()
where IsPrime(x)
select x;

foreach (var x in q)
{
Console.WriteLine(x);

}

In your opinion, what is interesting about the code listed above and
why is this important for the future of programming?

What's most interesting is how obvious homework questions usually are
-- they stand out like flashing red lights from the normal questions
you see on newsgroups.
 
TJO said:
Question:
Let us say we're using .Net 4.0, and IsPrime(int x) is a function that
determines whether a number is a prime number or not:

var simplelist = Enumerable.Range(1, 1000000);

var q = from x in simplelist.AsParallel()
where IsPrime(x)
select x;

foreach (var x in q)
{
Console.WriteLine(x);
}

In your opinion, what is interesting about the code listed above and
why is this important for the future of programming?

Is this a homework question?

If so, I am impressed with your course. This is exactly the type of
questions that should be being asked right now in 2009.

The clue is in the methodcall .AsParallel()
 
Back
Top