The Phill Dellow Experience

The Ancient and Accepted Art of Virtual Pizza Making

or how I tried to stop the struggle for sanity and dive into the number storm

OK, sorry to say this right out the front like this, but this blog entry is for me this week. I figure if I can express my learning of something as unfamilar feeling as C# still is, to me, in something I am very familar with, (PIZZA), I will be ahead for the week. So, in an attempt to make sense to myself, I am ardently sorry if I loose you on the way.

When we are making the pizza, the first thing we are thinking about is the equipment and resources we have to make that pizza. We are needing good brick wood fired ovens, though some people use gas fired modern conveyours and still get away with it. We want to be thinking about our reptior of skills as represented by our cooks and finally we want to think about and hold in mind what our library of ingredients is.

It C# it is the sane as is represented by the first lin(s) of code you will see in the program:

using System /b using System.Collections

is just the same as waking the cook, turning the oven up to 220 and unlocking the fridge, i.e:

using chefskills /b using woodfiredbrick oven

Next, it's the namespace:

namespace letsgeourpizzaon

namespace is really a declaration as to what you are tring to acheieve, and could be easily thought of in this metaphore as the stores BRAND. It could be Pizza Hut, Dominos or on the other hand it could be a backyard artisan authentic - It's really up to you how you want to name what itis that your trying to acheive and that's what a namespace is for

namespace callitdescriptor

Now were on to the interestingly highlighted topic from this last weeks study, class. Class can be defined as a collection of related objects: methods, variables etc. which then are "instance variable and instance methods - Wikipedia has a good summary of these:

So an instance variable like a instance method is as it's described, an instance of that classes object(s) and is never a part of a static class, that being the obvious opposite to instance. Instance can change, static cannot, in a very broad brushstroke way of speaking.

Here's what it looks like in my pizza model

First the static Main Class

Public(ly Accepted) Static Main((Approach to creating)Pizza)

///This class and it's objects are all about the way in which a pizza is made, the fundamentals that dont change: Dough, sauce, cheese and topping. And so we may have a method that says

{
PizzaProduction(want)
{
Dough
{
if(Size=BigPizza) dough=0.5;
else if(Size=MedPizza) dough=0.4;
else if(Size=MedPizza) dough=0.4;
else throw Argument.Exception "Nah, we is making the pizza, not the funny-time.";
}
void Sauce();
}
PizzaConstructor
{
Pizza = (dough + sauce);
Pizza.Add Toppings; }

These would all be examples of STATIC CLASS (METHOD.VARIABLES) OBJECTS - i reckon, therefor not instance variables as I'm trying to percieve them, but rather instances of static class variables, but I may be digging a hole there and and they are indeed examples of instance variable simply becasue they are an instance of a varible.

Holes, non-withstanding and under the sheer will of imagined confidence with pogo sticks, let's segway over to what would be condisered an instance variable in the true sense. Let's say our virtual pizza maker now moved into making different types of Pizza, that even in the world of virtual, that one standard construction class and method didn't encompass the needs of the wanters. For this we will need to maybe have another class, maybe a class for each different type of pizza the wanters want:

Public class Toppings //This is going to be aclass containing all the different toppings
Public String[] Tuscana = new String[] Tuscana = ("Potatoes"+"Procuito"+"Porcini"+"Pecarino");
Public String[] Margarita = new String[] Margarita = ("Pomodori"+"Mozzerella");
Public String[] Americano = new String[] Americano = ("this"+"that"+"more"+"too much"+"blurr"+"lost"+"abborance"+"floor sweepings");
{ if (topping=Tuscana) pizza.Add(Tuscana) };
{ if (topping=Margarita) pizza.Add(Margarita) };
{ if (topping=Americano) pizza.Halt.PizzaProduction goto packasad};


Although this may not represent the true C# code, but rather a psedo bash, I think I have managed to, (in my mind at least), construct a class herewith named Toppings, that sits outside and along side of the main class and therefor is not bound by that main classes "static' designation. This then uses truely instance variables and instance methods which can be called during the main class' methods in various instances.

Blog Index

CSS Cheat_Sheet

Culture Blog Week 1

Culture Blog Week 3

Culture Blog Week 4

Culture Blog Week 5

Culture Blog Week 6

Culture Blog Week 7

Technical Week 1

Technical Week 2

Technical Week 3

Technical Week 4

Technical Week 5

Technical Week 6

Technical Week 7

Culture Blog Week 8

Phill and Nary pair a web page in an hour

Main Index