SlideShare ist ein Scribd-Unternehmen logo
1 von 109
Downloaden Sie, um offline zu lesen
.net	
  code	
  
some	
  ideas	
  to	
  improve	
  yours	
  
              Carlos	
  Lopes	
  
              @carlosaml	
  
             ThoughtWorks	
  
code	
  
your	
  code	
  MATTERS	
  
so	
  how	
  can	
  you	
  write	
  be@er	
  code?	
  
and	
  so	
  on	
  
.net	
  
C#	
  
stuff	
  like	
  that	
  
ok	
  
 	
  	
  	
  	
  	
  	
  	
  IEnumerable<int>	
  FilterAndSort(IEnumerable<int>	
  numbers)	
  
	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  var	
  evens	
  =	
  new	
  List<int>();	
  
	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  foreach	
  (var	
  i	
  in	
  numbers)	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  if	
  (i	
  %	
  2	
  ==	
  0)	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  evens.Add(i);	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  evens.Sort();	
  
	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  return	
  evens;	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  
IEnumerable<int>	
  FilterAndSortRevisited(IEnumerable<int>	
  numbers)	
  
{	
  
	
  	
  	
  var	
  evens	
  =	
  numbers.Where(i	
  =>	
  i	
  %	
  2	
  ==	
  0).ToList();	
  
	
  
	
  	
  	
  evens.Sort();	
  
	
  
	
  	
  	
  return	
  evens;	
  
}	
  
IEnumerable<int>	
  FilterAndSortStrikingBack(IEnumerable<int>	
  
numbers)	
  
{	
  
	
  	
  	
  	
  return	
  numbers	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  .Where(i	
  =>	
  i	
  %	
  2	
  ==	
  0)	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  .OrderBy(i	
  =>	
  i);	
  
}	
  
IEnumerable<int>	
  FilterAndSortEvenBe@er(IEnumerable<int>	
  
numbers)	
  
{	
  
	
  	
  	
  	
  return	
  from	
  n	
  in	
  numbers	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  where	
  n	
  %	
  2	
  ==	
  0	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  orderby	
  n	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  select	
  n;	
  
}	
  
IEnumerable<int>	
  FilterAndSortYetAgain(IEnumerable<int>	
  
numbers)	
  
{	
  
	
  	
  	
  	
  	
  	
  return	
  from	
  n	
  in	
  numbers	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  where	
  n.IsEven()	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  orderby	
  n	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  select	
  n;	
  
}	
  
wait	
  
IEnumerable<int>	
  FilterAndSortYetAgain(IEnumerable<int>	
  
numbers)	
  
{	
  
	
  	
  	
  	
  	
  	
  return	
  from	
  n	
  in	
  numbers	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  where	
  n.IsEven()	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  orderby	
  n	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  select	
  n;	
  
}	
  
 public	
  staWc	
  class	
  MyExtensions	
  
	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  public	
  staWc	
  bool	
  IsEven(this	
  int	
  number)	
  
	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  return	
  number	
  %	
  2	
  ==	
  0;	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  }	
  
we’ll	
  come	
  back	
  to	
  this	
  
 	
  	
  	
  	
  	
  	
  	
  IEnumerable<int>	
  FilterAndSort(IEnumerable<int>	
  numbers)	
  
	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  var	
  evens	
  =	
  new	
  List<int>();	
  
	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  foreach	
  (var	
  i	
  in	
  numbers)	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  if	
  (i	
  %	
  2	
  ==	
  0)	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  evens.Add(i);	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  evens.Sort();	
  
	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  return	
  evens;	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  
IEnumerable<int>	
  FilterAndSortYetAgain(IEnumerable<int>	
  
numbers)	
  
{	
  
	
  	
  	
  	
  	
  	
  return	
  from	
  n	
  in	
  numbers	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  where	
  n.IsEven()	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  orderby	
  n	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  select	
  n;	
  
}	
  
so	
  what?	
  
“Any	
  fool	
  can	
  write	
  code	
  that	
  a	
  
   computer	
  can	
  understand.	
  
Good	
  programmers	
  write	
  code	
  that	
  
    humans	
  can	
  understand.”	
  


                                              Mar;n	
  Fowler	
  
Robert	
  C.	
  Mar;n	
  
fast,	
  slow,	
  slower	
  rhythm	
  
Kerievsky’s	
  5.0	
  syndrome	
  
release	
  1.0	
  is	
  quickly	
  delivered	
  
release	
  2.0	
  is	
  delivered	
  
but	
  the	
  junky	
  code	
  slows	
  you	
  down	
  
then	
  you	
  go	
  slower	
  and	
  slower	
  
mysterious	
  bugs	
  
demoWvaWon	
  
etc	
  
and	
  around	
  release	
  4.0	
  …	
  
complete	
  rewrite!	
  
5.0	
  !!!	
  
-­‐-­‐-­‐-­‐-­‐	
  -­‐-­‐-­‐-­‐-­‐	
  -­‐-­‐-­‐-­‐-­‐	
  
less	
  code	
  
less	
  bugs	
  
“If	
  you	
  love	
  wri;ng	
  code	
  -­‐-­‐	
  really,	
  truly	
  
       love	
  to	
  write	
  code	
  -­‐-­‐	
  you'll	
  love	
  it	
  
        enough	
  to	
  write	
  as	
  liEle	
  of	
  it	
  as	
  
                         possible.”	
  


                                                              Jeff	
  Atwood	
  
“Code	
  is	
  bad.	
  It	
  rots.	
  It	
  requires	
  
periodic	
  maintenance.	
  It	
  has	
  bugs	
  that	
  
need	
  to	
  be	
  found.	
  New	
  features	
  mean	
  
     old	
  code	
  has	
  to	
  be	
  adapted.”	
  


                                                   Rich	
  Skrenta	
  
coming	
  back	
  
funcWonal	
  programming	
  
“Typically	
  the	
  main	
  func;on	
  is	
  defined	
  
  in	
  terms	
  of	
  other	
  func;ons,	
  which	
  in	
  
 turn	
  are	
  defined	
  in	
  terms	
  of	
  s;ll	
  more	
  
func;ons,	
  un;l	
  at	
  the	
  boEom	
  level	
  the	
  
   func;ons	
  are	
  language	
  primi;ves.”	
  


                  John	
  Hughes	
  –	
  “Why	
  Func;onal	
  Programming	
  MaEers”	
  
F#,	
  ok	
  
but	
  
C#	
  ?!?!	
  
C#	
  is	
  an	
  imperaWve	
  language,	
  dude	
  
agreed	
  
but	
  
how	
  about	
  mixing	
  paradigms?	
  
again,	
  …	
  
less	
  code	
  
less	
  bugs	
  
-­‐-­‐-­‐-­‐-­‐	
  -­‐-­‐-­‐-­‐-­‐	
  -­‐-­‐-­‐-­‐-­‐	
  
expressiveness	
  
say	
  what	
  
IEnumerable<int>	
  FilterAndSortYetAgain(IEnumerable<int>	
  
numbers)	
  
{	
  
	
  	
  	
  	
  	
  	
  return	
  from	
  n	
  in	
  numbers	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  where	
  n.IsEven()	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  orderby	
  n	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  select	
  n;	
  
}	
  
not	
  how	
  
 	
  	
  	
  	
  	
  	
  	
  IEnumerable<int>	
  FilterAndSort(IEnumerable<int>	
  numbers)	
  
	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  var	
  evens	
  =	
  new	
  List<int>();	
  
	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  foreach	
  (var	
  i	
  in	
  numbers)	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  if	
  (i	
  %	
  2	
  ==	
  0)	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  evens.Add(i);	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  evens.Sort();	
  
	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  return	
  evens;	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  
ok	
  
what	
  else?	
  
funcWons	
  are	
  kind	
  of	
  a	
  big	
  deal	
  
principle	
  of	
  least	
  surprise	
  
immutability	
  
no	
  side-­‐effects	
  
lazy	
  evaluaWon	
  
higher-­‐order	
  funcWons	
  
etc	
  
but	
  how?	
  
extension	
  methods	
  
IEnumerable<int>	
  FilterAndSortYetAgain(IEnumerable<int>	
  
numbers)	
  
{	
  
	
  	
  	
  	
  	
  	
  return	
  from	
  n	
  in	
  numbers	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  where	
  n.IsEven()	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  orderby	
  n	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  select	
  n;	
  
}	
  
 public	
  staWc	
  class	
  MyExtensions	
  
	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  public	
  staWc	
  bool	
  IsEven(this	
  int	
  number)	
  
	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  return	
  number	
  %	
  2	
  ==	
  0;	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  }	
  
 public	
  staWc	
  class	
  MyExtensions	
  
	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  public	
  staWc	
  bool	
  IsEven(this	
  int	
  number)	
  
	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  return	
  number	
  %	
  2	
  ==	
  0;	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  }	
  
LINQ	
  
IEnumerable<int>	
  FilterAndSortStrikingBack(IEnumerable<int>	
  
numbers)	
  
{	
  
	
  	
  	
  	
  return	
  numbers	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  .Where(i	
  =>	
  i	
  %	
  2	
  ==	
  0)	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  .OrderBy(i	
  =>	
  i);	
  
}	
  
a	
  nice	
  way	
  to	
  query	
  stuff	
  
series	
  of	
  extension	
  methods	
  
Select()	
  
  Skip()	
  
  Take()	
  
OrderBy()	
  
GroupBy()	
  
 Where()	
  
    	
  
    …	
  
+	
  
syntacWc	
  sugar	
  
IEnumerable<int>	
  FilterAndSortStrikingBack(IEnumerable<int>	
  
numbers)	
  
{	
  
	
  	
  	
  	
  return	
  numbers	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  .Where(i	
  =>	
  i	
  %	
  2	
  ==	
  0)	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  .OrderBy(i	
  =>	
  i);	
  
}	
  
IEnumerable<int>	
  FilterAndSortEvenBe@er(IEnumerable<int>	
  
numbers)	
  
{	
  
	
  	
  	
  	
  return	
  from	
  n	
  in	
  numbers	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  where	
  n	
  %	
  2	
  ==	
  0	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  orderby	
  n	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  select	
  n;	
  
}	
  
laziness	
  
iterators	
  
 	
  	
  	
  	
  	
  	
  	
  IEnumerable<int>	
  Fibonacci()	
  
	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  yield	
  return	
  0;	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  yield	
  return	
  1;	
  
	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  var	
  previous	
  =	
  0;	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  var	
  current	
  =	
  1;	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  while	
  (true)	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  var	
  next	
  =	
  previous	
  +	
  current;	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  yield	
  return	
  next;	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  previous	
  =	
  current;	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  current	
  =	
  next;	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  
 	
  	
  	
  	
  	
  	
  	
  IEnumerable<int>	
  Fibonacci()	
  
	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  yield	
  return	
  0;	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  yield	
  return	
  1;	
  
	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  var	
  previous	
  =	
  0;	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  var	
  current	
  =	
  1;	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  while	
  (true)	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  var	
  next	
  =	
  previous	
  +	
  current;	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  yield	
  return	
  next;	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  previous	
  =	
  current;	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  current	
  =	
  next;	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  
 	
  	
  	
  	
  	
  	
  	
  IEnumerable<int>	
  Fibonacci()	
  
	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  yield	
  return	
  0;	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  yield	
  return	
  1;	
  
	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  var	
  previous	
  =	
  0;	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  var	
  current	
  =	
  1;	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  while	
  (true)	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  var	
  next	
  =	
  previous	
  +	
  current;	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  yield	
  return	
  next;	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  previous	
  =	
  current;	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  current	
  =	
  next;	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  
watch	
  out:	
  
    	
  
performance	
  
 side	
  effects	
  
         …	
  
lambdas	
  
IEnumerable<int>	
  FilterAndSortStrikingBack(IEnumerable<int>	
  
numbers)	
  
{	
  
	
  	
  	
  	
  return	
  numbers	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  .Where(i	
  =>	
  i	
  %	
  2	
  ==	
  0)	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  .OrderBy(i	
  =>	
  i);	
  
}	
  
syntacWc	
  sugar	
  
anonymous	
  methods	
  
 	
  	
  	
  	
  	
  	
  	
  IEnumerable<int>	
  FilterAndSortStrikingBackAgain	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  (IEnumerable<int>	
  numbers)	
  
	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  return	
  numbers.Where(delegate(int	
  number)	
  {	
  return	
  
number%2	
  ==	
  0;	
  });	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  
delegates	
  
funcWon	
  pointers	
  
pass	
  funcWons	
  around	
  
-­‐-­‐-­‐-­‐-­‐	
  -­‐-­‐-­‐-­‐-­‐	
  -­‐-­‐-­‐-­‐-­‐	
  
one	
  more	
  thing	
  
don’t	
  forget	
  OO	
  
you	
  might	
  be	
  tempted	
  
order.Items.Select(item	
  =>	
  item.Price).Max();	
  
(from	
  item	
  in	
  order.Items	
  select	
  item.Price).Max();	
  
duplicaWon	
  
encapsulaWon	
  
all	
  right	
  
that’s	
  about	
  it	
  for	
  today	
  I	
  guess	
  
quesWons?	
  
thank	
  you!	
  

Weitere ähnliche Inhalte

Was ist angesagt?

Python programming Workshop SITTTR - Kalamassery
Python programming Workshop SITTTR - KalamasseryPython programming Workshop SITTTR - Kalamassery
Python programming Workshop SITTTR - KalamasserySHAMJITH KM
 
04. Console Input Output
04. Console Input Output 04. Console Input Output
04. Console Input Output Intro C# Book
 
Chapter 22. Lambda Expressions and LINQ
Chapter 22. Lambda Expressions and LINQChapter 22. Lambda Expressions and LINQ
Chapter 22. Lambda Expressions and LINQIntro C# Book
 
Python-02| Input, Output & Import
Python-02| Input, Output & ImportPython-02| Input, Output & Import
Python-02| Input, Output & ImportMohd Sajjad
 
How to start functional programming (in Scala): Day1
How to start functional programming (in Scala): Day1How to start functional programming (in Scala): Day1
How to start functional programming (in Scala): Day1Taisuke Oe
 
Python language data types
Python language data typesPython language data types
Python language data typesHoang Nguyen
 
Rx: Curing Your Asynchronous Programming Blues | QCon London
Rx: Curing Your Asynchronous Programming Blues |  QCon LondonRx: Curing Your Asynchronous Programming Blues |  QCon London
Rx: Curing Your Asynchronous Programming Blues | QCon LondonJiby John
 
16. Arrays Lists Stacks Queues
16. Arrays Lists Stacks Queues16. Arrays Lists Stacks Queues
16. Arrays Lists Stacks QueuesIntro C# Book
 
GE8151 Problem Solving and Python Programming
GE8151 Problem Solving and Python ProgrammingGE8151 Problem Solving and Python Programming
GE8151 Problem Solving and Python ProgrammingMuthu Vinayagam
 
Python Datatypes by SujithKumar
Python Datatypes by SujithKumarPython Datatypes by SujithKumar
Python Datatypes by SujithKumarSujith Kumar
 
A Language Designer’s Workbench. A one-stop shop for implementation and verif...
A Language Designer’s Workbench. A one-stop shop for implementation and verif...A Language Designer’s Workbench. A one-stop shop for implementation and verif...
A Language Designer’s Workbench. A one-stop shop for implementation and verif...Eelco Visser
 

Was ist angesagt? (16)

Python programming Workshop SITTTR - Kalamassery
Python programming Workshop SITTTR - KalamasseryPython programming Workshop SITTTR - Kalamassery
Python programming Workshop SITTTR - Kalamassery
 
04. Console Input Output
04. Console Input Output 04. Console Input Output
04. Console Input Output
 
Chapter 22. Lambda Expressions and LINQ
Chapter 22. Lambda Expressions and LINQChapter 22. Lambda Expressions and LINQ
Chapter 22. Lambda Expressions and LINQ
 
Python-02| Input, Output & Import
Python-02| Input, Output & ImportPython-02| Input, Output & Import
Python-02| Input, Output & Import
 
DITEC - Programming with Java
DITEC - Programming with JavaDITEC - Programming with Java
DITEC - Programming with Java
 
How to start functional programming (in Scala): Day1
How to start functional programming (in Scala): Day1How to start functional programming (in Scala): Day1
How to start functional programming (in Scala): Day1
 
Python language data types
Python language data typesPython language data types
Python language data types
 
Rx: Curing Your Asynchronous Programming Blues | QCon London
Rx: Curing Your Asynchronous Programming Blues |  QCon LondonRx: Curing Your Asynchronous Programming Blues |  QCon London
Rx: Curing Your Asynchronous Programming Blues | QCon London
 
16. Arrays Lists Stacks Queues
16. Arrays Lists Stacks Queues16. Arrays Lists Stacks Queues
16. Arrays Lists Stacks Queues
 
GE8151 Problem Solving and Python Programming
GE8151 Problem Solving and Python ProgrammingGE8151 Problem Solving and Python Programming
GE8151 Problem Solving and Python Programming
 
Python for Beginners(v2)
Python for Beginners(v2)Python for Beginners(v2)
Python for Beginners(v2)
 
Python programming
Python  programmingPython  programming
Python programming
 
Python : Data Types
Python : Data TypesPython : Data Types
Python : Data Types
 
Python Datatypes by SujithKumar
Python Datatypes by SujithKumarPython Datatypes by SujithKumar
Python Datatypes by SujithKumar
 
02basics
02basics02basics
02basics
 
A Language Designer’s Workbench. A one-stop shop for implementation and verif...
A Language Designer’s Workbench. A one-stop shop for implementation and verif...A Language Designer’s Workbench. A one-stop shop for implementation and verif...
A Language Designer’s Workbench. A one-stop shop for implementation and verif...
 

Andere mochten auch

Girba Phd Presentation 2005-11-14
Girba Phd Presentation 2005-11-14Girba Phd Presentation 2005-11-14
Girba Phd Presentation 2005-11-14Tudor Girba
 
Advanced Code Analysis In .NET
Advanced Code Analysis In .NETAdvanced Code Analysis In .NET
Advanced Code Analysis In .NETStephen Ritchie
 
Code-Review-Principles-Process-and-Tools (1)
Code-Review-Principles-Process-and-Tools (1)Code-Review-Principles-Process-and-Tools (1)
Code-Review-Principles-Process-and-Tools (1)Aditya Bhuyan
 
Advanced Code Analysis with .NET
Advanced Code Analysis with .NETAdvanced Code Analysis with .NET
Advanced Code Analysis with .NETStephen Ritchie
 
Code review guidelines
Code review guidelinesCode review guidelines
Code review guidelinesLalit Kale
 
Code Review
Code ReviewCode Review
Code Reviewrantav
 
Writing clean code in C# and .NET
Writing clean code in C# and .NETWriting clean code in C# and .NET
Writing clean code in C# and .NETDror Helper
 
C# coding standards, good programming principles & refactoring
C# coding standards, good programming principles & refactoringC# coding standards, good programming principles & refactoring
C# coding standards, good programming principles & refactoringEyob Lube
 

Andere mochten auch (10)

Girba Phd Presentation 2005-11-14
Girba Phd Presentation 2005-11-14Girba Phd Presentation 2005-11-14
Girba Phd Presentation 2005-11-14
 
Advanced Code Analysis In .NET
Advanced Code Analysis In .NETAdvanced Code Analysis In .NET
Advanced Code Analysis In .NET
 
Code-Review-Principles-Process-and-Tools (1)
Code-Review-Principles-Process-and-Tools (1)Code-Review-Principles-Process-and-Tools (1)
Code-Review-Principles-Process-and-Tools (1)
 
Advanced Code Analysis with .NET
Advanced Code Analysis with .NETAdvanced Code Analysis with .NET
Advanced Code Analysis with .NET
 
Code review guidelines
Code review guidelinesCode review guidelines
Code review guidelines
 
ClearCase Basics
ClearCase BasicsClearCase Basics
ClearCase Basics
 
Code Review
Code ReviewCode Review
Code Review
 
Effective code reviews
Effective code reviewsEffective code reviews
Effective code reviews
 
Writing clean code in C# and .NET
Writing clean code in C# and .NETWriting clean code in C# and .NET
Writing clean code in C# and .NET
 
C# coding standards, good programming principles & refactoring
C# coding standards, good programming principles & refactoringC# coding standards, good programming principles & refactoring
C# coding standards, good programming principles & refactoring
 

Ähnlich wie .net code: some ideas to improve yours

C++ Course - Lesson 2
C++ Course - Lesson 2C++ Course - Lesson 2
C++ Course - Lesson 2Mohamed Ahmed
 
Java Foundations: Arrays
Java Foundations: ArraysJava Foundations: Arrays
Java Foundations: ArraysSvetlin Nakov
 
Algorithms with-java-advanced-1.0
Algorithms with-java-advanced-1.0Algorithms with-java-advanced-1.0
Algorithms with-java-advanced-1.0BG Java EE Course
 
Java Code The traditional way to deal with these in Parsers is the .pdf
Java Code The traditional way to deal with these in Parsers is the .pdfJava Code The traditional way to deal with these in Parsers is the .pdf
Java Code The traditional way to deal with these in Parsers is the .pdfstopgolook
 
DS LAB RECORD.docx
DS LAB RECORD.docxDS LAB RECORD.docx
DS LAB RECORD.docxdavinci54
 
Applications of ICT Lecture 3.pptxjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj...
Applications of ICT Lecture 3.pptxjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj...Applications of ICT Lecture 3.pptxjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj...
Applications of ICT Lecture 3.pptxjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj...ammarqazi53
 
Create a menu-driven program that will accept a collection of non-ne.pdf
Create a menu-driven program that will accept a collection of non-ne.pdfCreate a menu-driven program that will accept a collection of non-ne.pdf
Create a menu-driven program that will accept a collection of non-ne.pdfrajeshjangid1865
 
Mixing functional programming approaches in an object oriented language
Mixing functional programming approaches in an object oriented languageMixing functional programming approaches in an object oriented language
Mixing functional programming approaches in an object oriented languageMark Needham
 
arrays-120712074248-phpapp01
arrays-120712074248-phpapp01arrays-120712074248-phpapp01
arrays-120712074248-phpapp01Abdul Samee
 
Testing for share
Testing for share Testing for share
Testing for share Rajeev Mehta
 
Groovy Refactoring Patterns
Groovy Refactoring PatternsGroovy Refactoring Patterns
Groovy Refactoring PatternsNaresha K
 
This is a lab for a java program that I am very unsure of, it has to.pdf
This is a lab for a java program that I am very unsure of, it has to.pdfThis is a lab for a java program that I am very unsure of, it has to.pdf
This is a lab for a java program that I am very unsure of, it has to.pdfoptokunal1
 
Chapter 7.1
Chapter 7.1Chapter 7.1
Chapter 7.1sotlsoc
 
Computational Complexity.pptx
Computational Complexity.pptxComputational Complexity.pptx
Computational Complexity.pptxEnosSalar
 
Parallel and Async Programming With C#
Parallel and Async Programming With C#Parallel and Async Programming With C#
Parallel and Async Programming With C#Rainer Stropek
 
Presentation 6 (1).pptx
Presentation 6 (1).pptxPresentation 6 (1).pptx
Presentation 6 (1).pptxSagarGhosh48
 

Ähnlich wie .net code: some ideas to improve yours (20)

C++ Course - Lesson 2
C++ Course - Lesson 2C++ Course - Lesson 2
C++ Course - Lesson 2
 
07 Arrays
07 Arrays07 Arrays
07 Arrays
 
Java Foundations: Arrays
Java Foundations: ArraysJava Foundations: Arrays
Java Foundations: Arrays
 
Algorithms with-java-advanced-1.0
Algorithms with-java-advanced-1.0Algorithms with-java-advanced-1.0
Algorithms with-java-advanced-1.0
 
Java Code The traditional way to deal with these in Parsers is the .pdf
Java Code The traditional way to deal with these in Parsers is the .pdfJava Code The traditional way to deal with these in Parsers is the .pdf
Java Code The traditional way to deal with these in Parsers is the .pdf
 
DS LAB RECORD.docx
DS LAB RECORD.docxDS LAB RECORD.docx
DS LAB RECORD.docx
 
Applications of ICT Lecture 3.pptxjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj...
Applications of ICT Lecture 3.pptxjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj...Applications of ICT Lecture 3.pptxjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj...
Applications of ICT Lecture 3.pptxjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj...
 
EXPT1.pptx
EXPT1.pptxEXPT1.pptx
EXPT1.pptx
 
Create a menu-driven program that will accept a collection of non-ne.pdf
Create a menu-driven program that will accept a collection of non-ne.pdfCreate a menu-driven program that will accept a collection of non-ne.pdf
Create a menu-driven program that will accept a collection of non-ne.pdf
 
Mixing functional programming approaches in an object oriented language
Mixing functional programming approaches in an object oriented languageMixing functional programming approaches in an object oriented language
Mixing functional programming approaches in an object oriented language
 
arrays-120712074248-phpapp01
arrays-120712074248-phpapp01arrays-120712074248-phpapp01
arrays-120712074248-phpapp01
 
Testing for share
Testing for share Testing for share
Testing for share
 
Amusing C#
Amusing C#Amusing C#
Amusing C#
 
Groovy Refactoring Patterns
Groovy Refactoring PatternsGroovy Refactoring Patterns
Groovy Refactoring Patterns
 
This is a lab for a java program that I am very unsure of, it has to.pdf
This is a lab for a java program that I am very unsure of, it has to.pdfThis is a lab for a java program that I am very unsure of, it has to.pdf
This is a lab for a java program that I am very unsure of, it has to.pdf
 
Chapter 7.1
Chapter 7.1Chapter 7.1
Chapter 7.1
 
9 Arrays
9 Arrays9 Arrays
9 Arrays
 
Computational Complexity.pptx
Computational Complexity.pptxComputational Complexity.pptx
Computational Complexity.pptx
 
Parallel and Async Programming With C#
Parallel and Async Programming With C#Parallel and Async Programming With C#
Parallel and Async Programming With C#
 
Presentation 6 (1).pptx
Presentation 6 (1).pptxPresentation 6 (1).pptx
Presentation 6 (1).pptx
 

Mehr von Carlos Lopes

Multiple projects, different goals, one thing in common: the codebase! at Agi...
Multiple projects, different goals, one thing in common: the codebase! at Agi...Multiple projects, different goals, one thing in common: the codebase! at Agi...
Multiple projects, different goals, one thing in common: the codebase! at Agi...Carlos Lopes
 
Multiple projects, different goals, one thing in common: the codebase!
Multiple projects, different goals, one thing in common: the codebase!Multiple projects, different goals, one thing in common: the codebase!
Multiple projects, different goals, one thing in common: the codebase!Carlos Lopes
 
The Power of Retrospectives
The Power of RetrospectivesThe Power of Retrospectives
The Power of RetrospectivesCarlos Lopes
 
Gambi Design Patterns
Gambi Design PatternsGambi Design Patterns
Gambi Design PatternsCarlos Lopes
 
Trunk Based Development Demystified
Trunk Based Development DemystifiedTrunk Based Development Demystified
Trunk Based Development DemystifiedCarlos Lopes
 
Trunk Based Development Explored
Trunk Based Development ExploredTrunk Based Development Explored
Trunk Based Development ExploredCarlos Lopes
 
Trunk Based Development
Trunk Based DevelopmentTrunk Based Development
Trunk Based DevelopmentCarlos Lopes
 
The .NET Platform - A Brief Overview
The .NET Platform - A Brief OverviewThe .NET Platform - A Brief Overview
The .NET Platform - A Brief OverviewCarlos Lopes
 
XP In the Real World
XP In the Real WorldXP In the Real World
XP In the Real WorldCarlos Lopes
 

Mehr von Carlos Lopes (11)

Multiple projects, different goals, one thing in common: the codebase! at Agi...
Multiple projects, different goals, one thing in common: the codebase! at Agi...Multiple projects, different goals, one thing in common: the codebase! at Agi...
Multiple projects, different goals, one thing in common: the codebase! at Agi...
 
Multiple projects, different goals, one thing in common: the codebase!
Multiple projects, different goals, one thing in common: the codebase!Multiple projects, different goals, one thing in common: the codebase!
Multiple projects, different goals, one thing in common: the codebase!
 
Cognitive Biases
Cognitive BiasesCognitive Biases
Cognitive Biases
 
The Power of Retrospectives
The Power of RetrospectivesThe Power of Retrospectives
The Power of Retrospectives
 
Gambi Design Patterns
Gambi Design PatternsGambi Design Patterns
Gambi Design Patterns
 
Trunk Based Development Demystified
Trunk Based Development DemystifiedTrunk Based Development Demystified
Trunk Based Development Demystified
 
Trunk Based Development Explored
Trunk Based Development ExploredTrunk Based Development Explored
Trunk Based Development Explored
 
Trunk Based Development
Trunk Based DevelopmentTrunk Based Development
Trunk Based Development
 
10 Years Of XP
10 Years Of XP10 Years Of XP
10 Years Of XP
 
The .NET Platform - A Brief Overview
The .NET Platform - A Brief OverviewThe .NET Platform - A Brief Overview
The .NET Platform - A Brief Overview
 
XP In the Real World
XP In the Real WorldXP In the Real World
XP In the Real World
 

.net code: some ideas to improve yours