« first day (3166 days earlier)      last day (2006 days later) » 

00:01
@CapricaSix hi
@Rob hi
@mr5 had a lively discussion about js and c# being typed or not
What did you mean when you said "javascript doesn't have delegates."?
when you want to write an anonymous or local method you can just do so. you don't use a delegate
probably has to do with typing
	Func<int, int> sqr = x => x * x;

	Transformer<int> sqr2 = x => x * x;
i would never need to do that in javascript
delegate T Transformer<T> (T arg);
learning typescript is how I got to wanting to learn C#
00:23
@ChristianMatthew How is that different than C#?
typescript?
The only difference I know (besides syntax) is that JS doesn't use the name "delegate"
delegate T Transformer<T> (T arg);
what purpose does this serve?
That defines a new type
exactly
that doesn't happen in javascript
if I want to use this method
 static int Square(int x) =>
	x * x;
00:26
Oh, that's because JS doesn't have static types
Rob
Rob
The delegate keyword is rarely used in C# these days. But one benefit it has over Func/Action is you can name the arguments
Nothing to do with functions
When you add static typing (TS) then you get back to being able to define new types
@Rob what I was reading is that local methods are preferred... but 2 things. a lot of the framework has already been written with delegates and delegates or Func/Action are better for closure creation
i.e. functions as parameters
but you wouldn't' consider a local method a delegate would you?
Rob
Rob
Nope
A delegate is a wrapper around a function pointer
so would you say that a Func / Action are like anonymous delegates where they act almost like the var keyword
but still give generic typing of inputs and outputs
Rob
Rob
00:34
Not sure what you mean by acting like the var keyword
because I can do this
var x = (x) => x * x;
or in C# it would be this
Func<int, int> sqr = x => x * x;
I can't do this is in C#
var sqr3 = x => x * x;
The reason you can't do that is not because of delegates, but because of expression trees
lambda expressions can be compiled to expression trees, which are not delegates/functions.
either way
i can locally variable with the var keyword a method
can't
Rob
Rob
Not with the var keyword. But you can pass it to a function without explicitly typing. For example, you can write DoSomething(x => x * x). You can't assign it to var because C# can't figure out what you're constructing
x => x * x can represent an expression tree, or a Func<T, TT>. And in addition, it doesn't know what T or TT are
that's why I said Func is like var but with typing
because Func doesn't care about a predefined delegate
Rob
Rob
00:48
Func and var are completely different
and the lambda expression is just an anonymous method
Rob
Rob
var is a keyword for the compiler to automatically determine the type
Func is a function pointer
Func is just a wrapper for a delegate?
Rob
Rob
No
or rather it creates a delegate in memory
Rob
Rob
00:50
A 'delegate' in programming is a wrapper around a function pointer. It can also add additional functionality, like multi casting
Func ultimately creates a delegate
Rob
Rob
The c# delegate keyword is a type of delegate
Rob
Rob
Func is a delegate, but not a c# delegate
PourCoffeeAsync
The Func and Action Delegates
With generic delegates, it becomes possible to write a small set of delegate types that
are so general they can work for methods of any return type and any (reasonable)
number of arguments. These delegates are the Func and Action delegates, defined
in the System namespace (the in and out annotations indicate variance, which we
will cover shortly):
delegate TResult Func <out TResult> ();
delegate TResult Func <in T, out TResult> (T arg);
delegate TResult Func <in T1, in T2, out TResult> (T1 arg1, T2 arg2);
these seem like c# delegates that are just overloaded
Rob
Rob
01:01
Huh. You're right, they are indeed c# delegates. Wasn't aware of that
Which means they also support multi casting... interesting
i glazed over multi-casting
Rob
Rob
Func<int, int> a = x => { Console.WriteLine(x); return x; };
a += x => { Console.WriteLine(x * 2); return 15; };

var result = a(10);
so a single delegate targeting multiple methods
what is this implying
@Rob
ApplyButter(toast);
Rob
Rob
01:19
?
i'm actually trying to recreate this
and it was very confusing the method return a class part
here is the list of tasks to complete
static void Main(string[] args)
{
    Coffee cup = PourCoffee();
    Console.WriteLine("coffee is ready");
    Egg eggs = FryEggs(2);
    Console.WriteLine("eggs are ready");
    Bacon bacon = FryBacon(3);
    Console.WriteLine("bacon is ready");
    Toast toast = ToastBread(2);
    ApplyButter(toast);
    ApplyJam(toast);
    Console.WriteLine("toast is ready");
    Juice oj = PourOJ();
    Console.WriteLine("oj is ready");

    Console.WriteLine("Breakfast is ready!");
}
i'm not sure what ApplyButter(toast) is supposed to represent
Rob
Rob
A function that depends on toast
Rob
Rob
ApplyButter and ApplyJam can't execute until ToastBread() is finished
ok i have some work done
i'll show you
01:24
morning
lol omg the more I look at the word toast the more i feel like that is the wrong spelling
static async Task Main(string[] args)
{
	Coffee cup = PourCoffeeAsync(500);
	Console.Write("Coffee is ready\r\n");

	Egg eggs = FryEggsAsync(2000);
	Console.Write("Eggs are ready\r\n");

	Bacon bacon = FryBaconAsync(4000);
	Console.Write("Bacon is ready\r\n");

	Toast toast = ToastBreadAsync(2000);
	ApplyButter(toast);
	ApplyJam(toast);
	Console.Write("toast is ready\r\n");

	Console.Write("Breakfast is ready!");
}

public static Coffee PourCoffeeAsync(int x)
{
	string cookingAction = "Pouring Coffee";
ok this is what I have come up with so far for the synchronous example
01:46
what is this returning exactly
ApplyButter(toast);
how can I make the toast return be an integer i.e. 1000
CS1061 'UserQuery.Egg' does not contain a definition for 'GetAwaiter' and no extension method 'GetAwaiter' accepting a first argument of type 'UserQuery.Egg' could be found (press F4 to add a using directive or assembly reference)
when i am trying to switch them to async I am getting this error
02:18
@Rob do you know about stopwatch
Rob
Rob
Sure
well maybe i don't need stopwatch
is there a way to create work that is non-blocking on the thread
i think sleep and delay are blocking
Rob
Rob
Sleep blocks the thread, delay won't
static async Task Main(string[] args)
{
	Coffee cup = PourCoffeeAsync(500);
	Console.Write("coffee is ready\r\n");

	Egg eggs = await FryEggsAsync(2000);
	Console.Write("eggs are ready\r\n");

	Bacon bacon = await FryBaconAsync(4000);
	Console.Write("bacon is ready\r\n");

	Toast toast = await ToastBreadAsync(2000);
	ApplyButter(toast);
	ApplyJam(toast);
	Console.Write("toast is ready\r\n");

	Juice oj = PourOjAsync(1500);
	Console.Write("oj is ready\r\n");

	Console.Write("Breakfast is ready!");
this seems to be blocking.
everything is happening in sequence
Rob
Rob
Yes, because you're awaiting in sequence
Check the tutorial you linked a little further down
It discusses re-ordering the awaits
02:22
but when I don't use the await it doesn't delay
Rob
Rob
Well, yes, it's a task that will produce a result after x amount of time
so how can i represent a work of time that is not blocking
Rob
Rob
With delay
meaning even though time is elapsing
static async Task Main(string[] args)
{
	Coffee cup = PourCoffeeAsync(500);
	Console.Write("coffee is ready\r\n");

	Egg eggs = await FryEggsAsync(2000);
	Console.Write("eggs are ready\r\n");

	Bacon bacon = await FryBaconAsync(4000);
	Console.Write("bacon is ready\r\n");

	Toast toast = await ToastBreadAsync(2000);
	ApplyButter(toast);
	ApplyJam(toast);
	Console.Write("toast is ready\r\n");

	Juice oj = PourOjAsync(1500);
	Console.Write("oj is ready\r\n");

	Console.Write("Breakfast is ready!");
this is delay
Rob
Rob
It's printing in sequence because you're awaiting in sequence
See the tutorial further down
Where they create tasks at the start, and then await them later
Also...
delay.Result is going to block
02:27
well you are right about 1 thing
delay.Result is the one that was blocking
now the actual delay doesn't work
Rob
Rob
I'm assuming you just removed the writeline?
i took out the param but essentially yes
Rob
Rob
Right. So in your code, you're starting a task
And then never referencing it again
If you change the signature to:
public static async Task<Coffee> PourCoffeeAsync(int x)
Then, you should await delay before returning the coffee
i have that with egg
Rob
Rob
Indeed... all your methods should await delay
return await Task.FromResult(new Egg());
You can just return new Egg()
await Task.FromResult() is going to wrap an item in a task, and then immediately unwrap it with await
02:35
public static Coffee PourCoffeeAsync(int x)
{
	string cookingAction = "Pouring Coffee";
	var delay = Task.Run( async () => { Stopwatch sw = Stopwatch.StartNew();
                                    await Task.Delay(x);
                                    sw.Stop();
                                    return sw.ElapsedMilliseconds; });
	Console.WriteLine("{0} took {1} minutes to make:", cookingAction, delay.Result/1000);
	return new Coffee();
	//return await Task.FromResult("Eggs are ready");
}
i think the delay is doing anything
what I want is for the time to elapse with a rate limit of the highest time = max time
Rob
Rob
Hmm?
i want work done for a period of time that is non-blocking on the tread
Rob
Rob
Right. So you need to await the delay
what do you mean
where would I do that?
Rob
Rob
public static async Task<Coffee> PourCoffeeAsync(int x)
{
	string cookingAction = "Pouring Coffee";
	var delay = Task.Run(async () =>
	{
		Stopwatch sw = Stopwatch.StartNew();
		await Task.Delay(x);
		sw.Stop();
		return sw.ElapsedMilliseconds;
	});
	var duration = await delay;
	Console.WriteLine("{0} took {1} minutes to make:", cookingAction, duration / 1000);
	return new Coffee();
}
mr5
mr5
02:43
Is the address convention similar to all European countries?
Address { Street, HouseNumber, PostalCode, City } ?
no way
that looks like US
mr5
mr5
Are you from Europe too?
i know you get funky stuff with overseas
mr5
mr5
I'm parsing an Address from Denmark
no i am from us but I travel a lot
Rob
Rob
02:45
Don't forget apartment/unit numbers
mr5
mr5
Hmm good to know.
I'll ask our PM about that
public static Coffee PourCoffeeAsync(int x)
{
	string cookingAction = "Pouring Coffee";
	var delay = Task.Run( async () => { Stopwatch sw = Stopwatch.StartNew();
                                    await Task.Delay(x);
                                    sw.Stop();
                                    return sw.ElapsedMilliseconds; });
	Console.WriteLine("{0} took {1} minutes to make:", cookingAction, delay.Result/1000);
	return new Coffee();
	//return await Task.FromResult("Eggs are ready");
}
no it is doing the same thing
Rob
Rob
Because that's the same code you posted before
and duration isn't giving me back any number
Rob
Rob
You're still not awaiting the delay
You're blocking on .Result
02:47
public static async Task<Egg> FryEggsAsync(int x)
{
	string cookingAction = "Frying Eggs";
	var delay = Task.Run( async () => { Stopwatch sw = Stopwatch.StartNew();
                                    await Task.Delay(x);
                                    sw.Stop();
                                    return sw.ElapsedMilliseconds; });
	var duration = await delay;
	Console.WriteLine("{0} took {0} minutes to make:", cookingAction, duration / 1000);
	return new Egg();
	//return await Task.FromResult("Eggs are ready");
that is just the first one
the rest are changed
and duration isn't giving any number
Rob
Rob
It's because you're returning 500. 500/1000 is integer division, giving 0
static async Task Main(string[] args)
{
	Coffee cup = await PourCoffeeAsync(5000);
	Console.Write("coffee is ready\r\n");

	Egg eggs = await FryEggsAsync(2000);
	Console.Write("eggs are ready\r\n");

	Console.Write("Breakfast is ready!");
}

public static async Task<Coffee> PourCoffeeAsync(int x)
{
	string cookingAction = "Pouring Coffee";
	var delay = Task.Run(async () =>
	{
		Stopwatch sw = Stopwatch.StartNew();
		await Task.Delay(x);
		sw.Stop();
		return sw.ElapsedMilliseconds;
	});
	var duration = await delay;
Prints:
Pouring Coffee took 5 minutes to make:
coffee is ready
Frying Eggs took 2 minutes to make:
eggs are ready
Breakfast is ready!
this is my printout
Pouring Coffee took 0 minutes to make:
coffee is ready
Frying Eggs took 2 minutes to make:
eggs are ready
Frying Bacon took 4 minutes to make:
bacon is ready
Toasting Bread took 2 minutes to make:
applying butter
applying jam
toast is ready
Pouring Oj took 1 minutes to make:
oj is ready
Breakfast is ready!
Rob
Rob
You're getting 0 because of integer division
Change the duration to > 1000
02:50
oh no that's fine
i understand that
my issue is... this is taking 10 seconds to complete
it should only take 4 seconds to complete
Rob
Rob
Because you're awaiting them in order
The second task is only being created after the first one finishes
Again... go back to the tutorial and scroll down
It addresses this very thing :)
lol i think i see what you're saying. i am going to scroll down now
but i thought it was supposed to work like that
boom asynchronous
Rob
Rob
When you await a task, you're suspending execution of the rest of the method until the task produces a result
Thus.. you should create tasks, and then only await them when you need the result
but if you start them all at once
Rob
Rob
If you create them all before the first await, then yes, they're run as you expect
03:01
wow
that works
static async Task Main(string[] args)
{
	Coffee cup = PourCoffeeAsync(500);
	Console.Write("coffee is ready\r\n");
	Task<Egg> eggTask = FryEggsAsync(2000);
	Task<Bacon> baconTask = FryBaconAsync(4000);
	Task<Toast> toastTask = ToastBreadAsync(2000);
	Toast toast = await toastTask;
	ApplyButter(toast);
	ApplyJam(toast);
	Console.Write("toast is ready\r\n");

	Juice oj = PourOjAsync(1500);
	Console.Write("oj is ready\r\n");

	Egg eggs = await eggTask;
	Console.Write("eggs are ready\r\n");
	Bacon bacon = await baconTask;
ok so in that next part 2 things occurred 1. we offloaded the method call / instantiation to Task's 2. we moved the await statements below the Task's
why did moving the await statements make this work
ohhh is it because the task's start together synchronously kicking off all of the events
Rob
Rob
Because everything below an await won't execute until the awaited task produces a result
mr5
mr5
Have anyone remember that boolean expression law to simplify inversion?
Rob
Rob
Do you mean truth tables?
Oh, de morgan's?
mr5
mr5
Yes. De morgan's
bool IsComplete => !(
            string.IsNullOrEmpty(HouseNumber) &&
            string.IsNullOrEmpty(Street) &&
            string.IsNullOrEmpty(PostalCode) &&
            string.IsNullOrEmpty(City));
My brain is still lagging right now.
03:16
how do you know Task.Result is blocking?
Rob
Rob
Change the ands to ors
mr5
mr5
Is the above expression met the name?
I was advised to use: ! a || ! b || ! c || ! d
@ChristianMatthew don't use Task.Result
Rob
Rob
That will validate if any are not empty
You need to do !a && !b && !c && !d
Or !(a || b || c || d)
i see that but why is it blocking how did you know that
Rob
Rob
Because you're not awaiting to get the result
03:18
ahhhh
mr5
mr5
It would run on the same SynchronizationContext, if ever that context is MainThread, you'll notice.
i see what you're saying
Rob
Rob
Or another possibility... new [] { houseNumber, street, postalCode, city }.All(s => !string.IsNullOrEmpty(s))
mr5
mr5
@Rob nope. That's overengineered.
Rob
Rob
Is it?
I'd disagree with that
It's easier to read, and it's also less likely to contain a typo
mr5
mr5
03:19
well, I hate creating new type
Rob
Rob
You're not making a new type
You're making an array with the values
so essentially Result is waiting/blocking until it is finished separately?
Rob
Rob
Yes, it blocks the thread waiting for the result of the task
Which also means you can cause deadlocks
mr5
mr5
@Rob yes you're correct.
@Rob .All enumerates them all right?
Rob
Rob
Nope. It'll stop when it finds a false result
mr5
mr5
03:21
I think it should be .Any?
i learned 1 important lesson here. Asynchronous programming is not the same as concurrent programming (concurrency).
Rob
Rob
You can use any. But you need to invert the result, and the expression would b e string.IsNullOrEmpty(s)
mr5
mr5
I suppose, if any of these are empty would still be a correct English statement?
Rob
Rob
That is assuming you want isCompleted to be true when all fields have a value
Yes. But then you're not representing, isCompleted, you're representing isIncomplete
mr5
mr5
Well, I'd go for the most closest thing to English language.
Rob
Rob
03:23
@ChristianMatthew Async is a type of concurrency
It's different from parallelism
well in this context isn't concurrency different from the asynchrony
mr5
mr5
> true if every element of the source sequence passes the test in the specified predicate, or if the sequence is empty; otherwise, false.
meaning the other code was asynchronous but it was concurrent
Rob
Rob
Not necessarily... each Delay is timed concurrently
mr5
mr5
03:25
"if every element"
which means, it will iterate every element?
Rob
Rob
No
It can know for sure not every element is true, if it finds even one that isn't
the reason why i knew something was wrong was because instead of taking 4 seconds it was taking the additive amount of time which was 10
the limiter was 4 seconds
The composition of an asynchronous operation followed by synchronous work is an asynchronous operation. Stated another way, if any portion of an operation is asynchronous, the entire operation is asynchronous.
Rob
Rob
Pretty much, yep
var reqiuredField = new[]{"address","zipcode","state"};
var emptyField = reqiuredField.FirstOrDefault(x=>string.IsNullOrEmpty(data[x]));
Log.Error("A required field was empty: "+emptyField);
Rob
Rob
Which is why async needs to go all the way up, unless you end up blocking on a task
03:30
from what i see they are saying everything you do needs to be async
Rob
Rob
@nyconing That'll always log an error. It'll also always be an empty string/null in emptyField, so the message won't betoo useful
that's it just better to be asynchronous all the way around
Rob
Rob
Uh, it depends really
You shouldn't make a method async unless it needs to await something
var reqiuredField = new[]{"address","zipcode","state"};
var emptyField = reqiuredField.FirstOrDefault(x=>string.IsNullOrEmpty(data[x]));
if (emptyField !=null) Log.Error("A required field was empty: "+emptyField);
they argue differently. they say incoming calls and requests are better served when you are non-blocking...
Rob
Rob
03:32
That won't log an error if the field is null :P. But even for empty string values, the log error message doesn't need to include +emptyField because we've just proven that variable has no information in it
even if it is in a callback scenario which is pretty much was my inital iteration was
Rob
Rob
Well, that's for a web server
But you can still have it async. But methods don't always need to be async
hmmmm isn't everything the web
Rob
Rob
If you had a method to concatenate a string, that doesn't need to be async
Async methods could use it, but it itself isn't async
no they're not saying everything inside of an async method call needs to be awaited. some code in those blocks can be synchronous but for main methods in general
Rob
Rob
03:34
@nyconing Whoops, no, I misread it. That should work
If you're not awaiting anything in your code, there's no benefit to using async
the reason why I wonder is that when i read most code in the asp.net core world it is Task everywhere
Rob
Rob
Even if you marked it async, unless you await something, it does nothing except generate a bunch of overhead
hmmm they're saying yes that an incoming call won't be blocked
so that's a good thing
Rob
Rob
Depends what you're doing
If you had an endpoint that took a number, and returned the square
There's no need for it to be async
If you had an endpoint that read something from disk, then yes, it might be useful to use async
but what if another operation needs my thread
or needs to get going
it can't if i am blocked
Rob
Rob
03:36
It doesn't matter. The only point at which the thread may be re-used is when the code hits an await
Otherwise, it's still executing synchronously, await keyword or not
not for TAP
that is always async
whether awaiting or not
Rob
Rob
That's different from what people are saying
here i'll show you
Rob
Rob
When you have proper async support, you're less likely to be starved of threads that can be used to accept connections
But if all those methods are marked async, and none of them await anything, there is no benefit at all
Initiating an asynchronous operation
An asynchronous method that is based on TAP can do a small amount of work synchronously, such as validating arguments and initiating the asynchronous operation, before it returns the resulting task. Synchronous work should be kept to the minimum so the asynchronous method can return quickly. Reasons for a quick return include the following:

Asynchronous methods may be invoked from user interface (UI) threads, and any long-running synchronous work could harm the responsiveness of the application.
Rob
Rob
03:40
> Synchronous work should be kept to the minimum so the asynchronous method can return quickly
And if you never await anything, all your work is synchronous
no it's asynchronous
with synchronous methods
but it's still asynchronous
Rob
Rob
That's not correct
The composition of an asynchronous operation followed by synchronous work is an asynchronous operation. Stated another way, if any portion of an operation is asynchronous, the entire operation is asynchronous.
Rob
Rob
Yes. And if you do not use await, there is no portion of it which is asynchronous
Target environment
When you implement a TAP method, you can determine where asynchronous execution occurs. You may choose to execute the workload on the thread pool, implement it by using asynchronous I/O (without being bound to a thread for the majority of the operation’s execution), run it on a specific thread (such as the UI thread), or use any number of potential contexts. A TAP method may even have nothing to execute, and may just return a Task that represents the occurrence of a condition elsewhere in the system (for example, a task that represents data arriving at a queued data struc
i think they're basing asynchronous on non-blocking
Rob
Rob
03:43
static async Task Main(string[] args)
{
	var task = DoSomething();
	Console.WriteLine("This should fire immediately!");

	await task;
}


static async Task DoSomething() {
	for (var i = 0; i < int.MaxValue; i++) {
		//
	}
}
> Console.WriteLine("This should fire immediately!");
so even if you're not awaiting anything you're still in an asynchronous event
Rob
Rob
Will not execute until that loop is finished. Even though the method is async
You've blocked the thread with work
hmmm i kind of agree with that
Rob
Rob
Again.. I know you don't believe me, but marking a method async doesn't do anything except generate some boilerplate code
It's when you use await that things become interesting
lol i believe you
Rob
Rob
03:46
The task created by DoSomething() is only created when it awaits
Or when it returns
but i think they're trying to say that if something else comes in it won't be blocked. in the await scenario it is it is pausing and waiting for that to be finished and then continuing on
Rob
Rob
In this case, it'll return after running the entire loop. The resulting task is an empty task
It will be blocked if you write something like the above
If you never await, there's no difference between async and not
this is what i am readin
reading...
lol when I say they
so they're saying Task should return an awaitable type
that's why I did the Task.FromResult() method
posted on June 13, 2019 by Scott Hanselman

I've always been fascinated by making apps as small as possible, especially in the .NET space. No need to ship any files - or methods - that you don't need, right? I've blogged about optimizations you can make in your Dockerfiles to make your .NET containerized apps small, as well as using the ILLInk.Tasks linker from Mono to "tree trim" your apps to be as small as they can be. Work is on goin

Rob
Rob
Using Task.FromResult() is only useful if you need to return a task elsewhere in your method as well
It doesn't make it async
In fact, it's just synchronous code wrapped in a task
mr5
mr5
04:09
Is town can be considered as street?
Rob
Rob
No
Not anywhere I've ever seen
mr5
mr5
how about city?
Rob
Rob
Nope
The street is really just the street..
If there is only one street in the small city?
mr5
mr5
I mean town
Can it be considered as city?
Rob
Rob
04:15
In practice, yeah
Many forms would even specifically have a field named "town/city"
mr5
mr5
Hmm. I think I need to refactor my copied address parser
How about house number. Does it come in a form of numbers and letters combination?
04:36
yes
mr5
mr5
04:47
Are you sure?
Is it true in any EU countries?
@Rob just to ask
what is the point of having a call to another method as a parameter doing
is this considered a closure
Rob
Rob
Not sure what you mean
here's the refactored code
static async Task Main(string[] args)
{
	Coffee cup = PourCoffeeAsync(100);
	Console.Write("coffee is ready\r\n");
	var eggTask = FryEggsAsync(3000);
	var baconTask = FryBaconAsync(5000);
	var toastTask = maketoastWithButterAndJamAsync(3000);

	Egg eggs = await eggTask;
	Console.Write("eggs are ready\r\n");
	Bacon bacon = await baconTask;
	Console.Write("bacon is ready\r\n");
	Toast toast = await toastTask;
	Console.Write("toast is ready\r\n");
	Juice oj = PourOjAsync(100);
	Console.Write("oj is ready\r\n");
why do i need to have the submethods i.e. applybutter call the main method... what is the point of that
Rob
Rob
Still not clear on what you mean
It's not calling the main method
so a param is not calling plaintoast?
Rob
Rob
04:51
It's the same as any other method. It's providing the toast to be buttered
plainToast is the result of the task. It's an object
so they way I would think of it .. if I have a method and a parameter is another function I would expect that function to be executed no?
Rob
Rob
It's not a function
It's an object
yes
ok what is doing with that object
Rob
Rob
In your implementation, nothing
lol
just checking
but doesn't it technically instantiate it when it is called like that
Rob
Rob
04:54
Instantiate what?
maybe I am overthinking it
what could it do
 Toast toast = ToastBread(2);
    ApplyButter(toast);
    ApplyJam(toast);
what is the purpose of doing something like that
Rob
Rob
ApplyButter and ApplyJam need to do something to a toast object
well the object can only hold properties and values right
Rob
Rob
And methods
and methods
Rob
Rob
04:57
But.. examples like these are very rarely enlightening
so you're saying in ApplyButter I could then access the toasts values
Rob
Rob
If instead you had something like
var line = ReadNextLine(); Print(line);
That's something more useful
which would be print ReadNetLine();
05:45
how do you make a conditional parameter
05:56
@ChristianMatthew Maybe with out

« first day (3166 days earlier)      last day (2006 days later) »