4

I am interested in reading examples of code in C# that makes use of the Spartan Programming philosophy. Can you please provide a link to any open source project or online code sample that follows this coding style?

George Stocker
  • 57,289
  • 29
  • 176
  • 237
Tangiest
  • 43,737
  • 24
  • 82
  • 113
  • Why'd you make it Community Wiki? – George Stocker Dec 03 '09 at 14:38
  • 1
    George, given that there is no definitive answer to this question, and as it is really a list of links/resources, I thought making it a community wiki was appropriate. Also, it stopped the usual Community Wiki Fascists chiming in with the usual "I think this should be a ...". – Tangiest Dec 03 '09 at 14:41

2 Answers2

2

I know that this is in Java and not C#, and maybe you've already read it, but this is an excellent article: http://ssdl-wiki.cs.technion.ac.il/wiki/index.php/SendAnEmail_case_study

Klaus Byskov Pedersen
  • 117,245
  • 29
  • 183
  • 222
0

This article on the Gamasutra website has a review of C# code written using the Spartan programming style, with a solution that may be downloaded for review. An example of the code is:

virtual public void Update(float t, Camera c)
{
    Vector2 a = new Vector2(0, PixelsPerMeter*9.8f);
    Velocity = Velocity + a * t;
    Position = Position + Velocity * t; // Like n*(n-1)/2
    Position.Y = MathHelper.Min(FloorY, Position.Y);
    Velocity.Y = (Position.Y==0.0)?MathHelper.Min(0, Velocity.Y):Velocity.Y;
}
Tangiest
  • 43,737
  • 24
  • 82
  • 113