« first day (3145 days earlier)      last day (1795 days later) » 

12:04 PM
Back from my back to back meetings. Are we still abusing OO concepts?
@R.Anandan Depends on how that WCF service is exposed. What binding and contract does it use?
A WCF service exposing a netTcpBinding will be a pain to access. If it exposes a webHttpBindings - much easier.
 
@AvnerShahar-Kashtan We woudl never ever do something like that
 
When I deploy SSRS project this shows up, how do I know these credentials?
https://i.stack.imgur.com/WQqC2.png
 
Also, back to the design discussion - I really don't think an OO Zoo Management application should model an inheritance hierarchy of animals. It makes no sense.
 
@AvnerShahar-Kashtan Why?
Every animal has atleast a gender!
.Male, .Femal, .KindaBoth?
 
OO is usually taught as an approach that models real-world elements as classes, but this is easily misinterpreted as an approach that models all real-world elements as objects. The purpose of OO isn't to create a 1:1 model between the real world and the representation in code.
The point is to model your business and domain entities as objects.
Chances are, all you need is an Animal class, because for the purposes of zoo management, you don't need to call animal.Eat(IFood food) - the animals eat, true, but your zoo management software doesn't.
 
12:09 PM
Aye
 
It can sometimes be confusing, because what you should model and what it initially appears you should model are not the same.
Eric Lippert has a good article about it, of course. About how, when approaching writing a D&D-style game, your initial intuition is to model "Wizard" "Warrior" and "Sword" and "Wand" as object hierarchies of Class and Weapon and you end up suffering when trying to model concepts like "Wizards can Equip Wands, but not Swords", because the actual entity you should be modeling is GameRule, not CharacterClass.
> We’ve been struggling in the last four episodes to encode the rules of our business domain — which, recall, could be wizards and warriors or papers and paycheques or whatever — into the C# type system. The tool we’ve chosen seems to be resisting our attempts, and so maybe it’s a good time to take a step back and ask if we’re on the right track in the first place.
Just because your users will be interacting with Animals doesn't mean that your OO model should be based on Animal objects doing things.
 
:46329056 ReptileFeedingSchedule : FeedingSchedule
For example
 
Or, more likely, an instance of FeedingSchedule with metadata saying it's for reptiles.
Because a schedule is a schedule, regardless of who its for. If reptiles need feeding only every other day, and at night - that's the business logic of a FeedingSchedule.
 
Eh, probably, but suppose that snakes only need to eat between ten and twenty days after they last ate, which may not have been at any regular interval, and they may not take what they're given this time either. Whereas say large carnivorous mammals need to eat every other day and ungulates need grazing continuously
i.e. the process is tangibly different
 
Hello, anyone knows where i can find the interface ISingleton? I need it for core
 
12:24 PM
@TomW Yes, but being carnivorous mammals or snakes isn't part of the business domain. You need objects that can express complex schedules, such as "10-20 days after last feeding" or "every other day" or "graze continuously" - those are the business rules. Build a FeedingSchedule that can handle those parameters. Use inheritance, sure - SinceLastFeedingSchedule vs ByIntervalFeedingSchedule or whatever.
 
@AvnerShahar-Kashtan You arrived a minute too late for the zoo debate
@Squirrelintraining Back in my day gender was a bit, now we need a LOB data field up to 2GB to make room for each possible case scenario
 
@AvnerShahar-Kashtan try justifying that to zookeepers :P "Of course the fact that they're carnivorous and mammals is important!"
I agree with you but domain modelling is hard when you have to get over these kinds of received wisdom
 
@TomW And that's the job of the business analyst and solution architect. To take those business needs and model them properly.
 
@HéctorÁlvarez ay
@HéctorÁlvarez aswell it was always a nullable bit (snails are both)
 
In SQL everything is nullable unless NOT NULL is specified.
And it doesn't throw exceptions when it is.
but the execution planner is far from happy to find this identifier.
 
12:32 PM
@AvnerShahar-Kashtan I think the risk of abstracting to that degree is that the users won't understand how to use the software to accommodate new information. They know that a reptile is a reptile, not that it's a StockInstance associated with an OnDemandFeedingSchedule
 
@TomW The users don't need to be exposed to the OO hierarchy.
 
The user is 101% chance agnostic of the implementation details.
 
Then what do you call the artefacts in the code that presents the user interface?
 
In other words, do you know how to perfectly program your car's CPU to enable and disable ABS at will?
Will that hurt your ability to drive the car?
 
Well it's useless to say you should or shouldn't create certain classes. It's all in the context of what the program needs to do
 
12:35 PM
Well, it's the Feed Tracker screen in the app, that shows the planned schedule. And yes, the UI might be different for the reptiles than for the mammals, which makes sense. But the users don't care if it's a ReptileFeedingSchedule behind the scenes or a SinceLastFeedingSchedule { TargetType = "Reptile"}.
 
You probably don't need an implementation for each animal type, but probably isn't certainly
in the end, the scope is how the program functions, not how the code is modeled
the code structure is simply a means to an end
 
@Neil It's not about "certain classes, yes or no". It's "do you model your OO hierarchy and concepts in the same way that your users think about them".
 
@AvnerShahar-Kashtan how is it relevant how the users think about them?
they won't even see your code
 
What I'm getting at is that I would try and steer away from abstractions that the business doesn't describe on its own terms, because the subject matter experts won't understand them
 
Think sideways, if you want to provide this service you might be interested in this interface opens tenchcoat that gives directions to any news feeds to get and send info to a screen.
 
12:37 PM
writing an Animal class helps us, the programmers
it's not something done for the user outside of the scope of simply doing what it should do
that's not to say that the code should be shit either. the scope of writing good program structure is for maintenance and readability
 
@Neil This. The abstraction is for you, not for the user.
 
but it's important to recognize it for what it is
 
@Neil That's exactly what I'm saying. That the fact that the user thinks of the app in terms of specific animals, of reptiles and of types of food that are good for types of animals, shouldn't dictate the object model.
@TomW That's also true. SMEs are important. But they should define the external interfaces of your app, your user stories, your data types - not necessarily your OO model.
 
@AvnerShahar-Kashtan no, but we're human just like our users (at least most of us are), so naturally we think of program structure in the same terms
We could just as easily create an Entity class which performs the same actions as Animal class
but Animal helps in our understanding of what it does
 
@Neil Check out the Eric Lippert article I linked to earlier (and possibly follow the links to the four preceding articles) for a good (even if simplistic) example of how trying to model our code based on our user model can fail us.
Because that's where the official conceit of OO design fails. At the end of the day, I'm not trying to design a zoo, which happens to be constructed of bits and classes instead of cages and, umm, something else that zoos are made of. I'm trying to design management software, which isn't a zoo.
Zoo Management Software probably has more in common with School Management Software than it has with Zoos.
 
12:45 PM
The fauna in schools is pretty similar to zoos, except some of those little mongrels can read.
 
@AvnerShahar-Kashtan I get that article and the point, but having a thousand and one rules dictating proper game state isn't exactly a solution either
 
@Neil Depends on your app. If you model your game as "a set of rules dictating how game state is changed", than it is.
 
if you forget a rule, then you're potentially in a position where any number of other problems could occur, each compounding on the other
 
That's true for any code.
 
Are you guys talking about abstraction?
Hehe :)
 
12:46 PM
yes, but in this case, forgetting a rule is devastating for the proper functioning of the game, moreso with another design
what happens if a wizard can wield a sword? it attempts to perform an action only a sword wielder could do, and it can do so.. suddenly your wizard is like a warrior at level 99
and then you update the game, and you basically have to revert your entire database because of players like this
 
I like this example because I have a direct query about it.
 
I think you're right in that you don't have to make Animal deal with everything related to Animals, but I'm not convinced his approach is ideal
 
How about the wizard can actually use the sword because he's not an idiot, just he can't swing it fast nor hard at the enemy.
 
well we were under the assumption that there was supposed to be a rule that prevents wizards from holding swords
 
what if the rule you imposed is overly restrictive, but you were afraid of anything going wrong, so you closed it far beyond its reaching point?
 
12:49 PM
basically the article states that you wouldn't have a Wizard class check if weapon being passed is a sword or not, but rather a Player class which can have any Weapon class
what ensures consistency are rules
@HéctorÁlvarez I suppose that would come out during testing
 
I have also read that article but solution is not provided at the end of article
 
still better being overly restrictive
 
for this 2 problems :
 //A warrior can only use a sword.
    //A wizard can only use a staff.
 
unless you're playing skyrim
 
@ILoveStackoverflow It's still a good article and it's good that you read it
It brings up what is a common mistake that people make
 
12:53 PM
    Any1 using VS 2017 and can confirm the following:

    Highlighting [THIS TEXT] and pressing CTRL+K, CTRL+C results in:
    Highlighting /* [THIS TEXT]*/  and pressing CTRL+K, CTRL+C result in:; and not in this:
//Highlighting [THIS TEXT] and pressing CTRL+K, CTRL+C results in:
 
To solve that problem, the mistake would be to create a Wizard class derive from Player class which checks if the player can wield that weapon
 
@Neil Do you know The Strange Log? twitter.com/thestrangelog?lang=en
 
@AvnerShahar-Kashtan proxy :/
 
@Neil Right. I'm going to deviate here a bit because the example is depicted as "player has weapon, but can't have this weapon type" which is so clear.
But normally the rule isn't about the wizard carrying a sword or using it, it's more about whether your wizard had a staff, sword, bow, and shield, he only has 2 hands and there exists the chance that any weapon can be polymorphed into a bow which is a 2-handed weapon, so what would happen if a sword-and-shield player would have its sword polymorphed into a bow?
 
@Neil "Documenting the strange poetry of changelogs and patch notes"
> Elbows should only bend in certain, expected, ways regardless of what T-Shirt you are wearing.
> You can't eat a pile of salt anymore.
 
12:54 PM
But the bow takes both slots and overrides the shield too, but the shield hasn't been removed magically, it's still there in your left hand while you hold a bow in your other hand.
 
Change log from games (originally mostly The Sims, I think) showing what happens when you miss some rules.
 
@HéctorÁlvarez If you had rules, than you'd apply those rules with the weapon type being a bow and not a sword
 
@HéctorÁlvarez Fantasy physics. Swords are conductive, no bueno for casting, he'd fry his arm off
 
The point is that any decently complex game has thousands of rules. And if they're scattered around dozens of different classes, they're even more likely to have errors.
> Holograms no longer cause people to be flung off of segways
 
@HéctorÁlvarez Put the shield onto the back
 
12:56 PM
Why. Wizard take staff with left hand. Then right hand can be used to wield the sword
 
> Fixed issue where a demon eating a skewer of human skulls would unexpectedly dance when spoken to.
 
@AvnerShahar-Kashtan oh maybe I have seen that..
WHEEZE
 
Guide to successfully coding robust game rules:
1) Copy Dwarf Fortress.
 
@Neil No but this is a case where the rules dictate a weapon can be polymorphed, and the person who had to choose how said "Well, we simply won't let 1-h weapons turn into 2-h weapons and problem solved!" saving himself the trouble in the future and removing more components than were needed initially.
 
> During "A Little Help From My Friends", slapping Ringo will no longer instantly kill him
Do I want to know what game this is from?
 
12:57 PM
@Squirrelintraining Huh
 
@HéctorÁlvarez well I mean you change the weapon however possible and then check it against the rulebook without knowing what the rules are
 
I'm trying to specify a case where the case scenario is so specific you have no way to tell this would happen at design time.
 
well you can't tell at design time anyway
the rulebook is probably loaded dynamically
 
@Neil rofl
 
@Neil exactly:
> And what new scenarios have we enabled? Rules are now more like data than like code, and that is powerful!
 
1:00 PM
If rules are like data now, business users can fuck them up by entering garbage
How is that beneficial
 
That's a trick I've picked up over the years. If you can make data determine behavior, then a lot of the normal requirements of extending behavior no longer apply
 
> The Pope is no longer likely to personally excommunicate you just because he slightly dislikes the look of your face
 
But that's applicable only if it remains somewhat simple and straightforward
 
@TomW For the same reason having anything as data/configuration instead of code is beneficial.
 
That was a tongue in cheek remark
 
1:01 PM
in simple terms, everything is data
 
@Neil When it comes to tabletop games it actually happens all the time. My card says "destroy this monster to deal 1 damage to enemy life". My other card says "when you deal damage to the enemy life, you may restore one monster back to life". I can beat you with those 2 cards by spamming and infinite combo but you forgot about that peculiar combination in your game of 5000 cards.
 
but the more you make your logic into data, the more work you have to do to write the logic
 
@Wietlol But the more you can separate the concerns between the programmer and the game/app designer.
 
0.o?
 
@HéctorÁlvarez Look at hearthstone.. infinite combos have happened :)
 
1:02 PM
the designer tells the programmer what he should make, the programmer makes it
 
that is a real risk
 
so, the programmer makes the logic and the data
 
If you express your logic as data or a DSL, then it's your job, as a programmer to be able to read and properly execute the logic from the data. It's now a business task to encode the rules as data.
 
I once had to program essentially a rules matrix, where the base data was a spreadsheet. The problem was that the spreadsheet was used by SMEs as a communication tool, which meant they felt at liberty to put whatever crap they liked in it
 
I think the only way to defend against such problems is by having a backup plan like, a maximum of 20 recursions can occur as a consequence of rules being applied
 
1:03 PM
@Neil the giggle
 
@TomW Well, yes, that like letting your SMEs write code in the system.
 
Eventually this was untenable so we went through a sanitising exercise of stripping out all the columns that were just notes, all the ambiguous cells which didn't have an allowed value, and so on
The first thing they did with the sanitised version was to start putting all the crap back in
 
@TomW The problem is that apparently they didn't think of that file as machine-readable data, as a ruleset for the system, but as human-readable text.
 
@Neil Good example. Now that's what I'm trying to convey here, sometimes it's not as easy as "let's enact this simple rule" because doing so you may be more restrictive than you initially thought, and you sure want to be able to back off that statement as soon as possible.
 
@AvnerShahar-Kashtan Quite. No matter how many times it was explained
 
But admittedly, I don't know how else you could implement hearthstone other than this rule system
you can't conceivably imagine every possible combination
nor would it be very flexible if you could
 
@AvnerShahar-Kashtan I didn't get that turkey reference.
@Neil Correct! The rule system is far from perfect, although it's doable. The problem however is too sided. Lousy rules enable infinite combos while over-restrictive ones make the game unplayable.
And in the future they also limit your capabilities by a lot.
 
so weird being in my office on a bank holiday
 
If you literally say "You can't play 2 murloc cards in a row" you have to remember you can't add a murloc card that has the effect "When played after another murloc in the same turn..." because it will never work.
 
but I think it's safe to assume that if existing mechanics don't have infinite combinations with other cards, then simply modifying the amount of damage/healing/whatever of that card isn't going to create another infinite combination of some kind
It's new mechanics that are likely to create problems
 
1:07 PM
Not weird for me, I'm always in on Bank Holidays
And sundays
 
though not even that is guaranteed
 
what an unlucky situation
 
@HéctorÁlvarez Hearthstone does have rules like this, and they can stack potentially
I think that's safe to allow because there is a max hand size
 
@HéctorÁlvarez It is entirely context-free, wherein lies its power.
 
so long as you don't, say, drop a murloc in your hand and draw another card
 
1:10 PM
@AvnerShahar-Kashtan Oh so I can go with the Ottoman jannisary forces? Cool.
 
Oh, I automatically read it as Turkey, the bird.
 
^
 
> Hitting a thief no longer yells for help, instead apologizes for being a thief
 
seems legit
 
> Drinking tea at home creates a new, slightly depressing memory
 
1:12 PM
I remember that in Theme Hospital, if a machine exploded, patients could die, but employees couldn't
so if there was an employee in the room when it exploded, they simply wouldn't exist anymore
 
Don't you think a miserable bird carcass filled with veggies would have a leading article? "The turkey" would be more fitting than "Turkey", unless the turkey was actually called Turkey, as in "Turkey the turkey", which is also hilarious to say out loud in a turkey tone.
 
A turkey from Turkey
 
@HéctorÁlvarez If it's not a specific bird but the abstract concept of turkey, the food. "Turkey is too powerful" in the sense of "Turkey restores too much HP when eaten".
 
> The bird, or the country?
> Yes
-_-
 
If you catch a Chinchilla in Chile
And cut off its beard, willy-nilly.
You can honestly say.
That you have just made.
A Chilean Chinchilla's chin chilly.
2
 
1:14 PM
@AvnerShahar-Kashtan Oh damn I hadn't seen that one. Nerf Turkey definitely.
I've written it enough times to have my brain think it's misspelled anyhow. Turkey, tarkey, turquoise... 'tis all the same.
There once was a small juicy orange,
...fuck.
 
@Neil say what
 
mr5
hello fellas
@Wietlol hey. I still cannot see te source code
 
I know
how far do you want to see the compiler actually working?
 
mr5
I have asked Roel what it is like living in Netherlands. He haven't responded yet. Guess I won't be going there anymore.
 
it generates a program instruction declaration but it cant do anything after that
because of difficult targets
roel left ze netherlands?
 
mr5
1:24 PM
@Wietlol like, solving complex Math: ((1+1)*3+2/3-3)*(4+4)) should give me a compile error
 
why?
 
mr5
Roel don't want me to visit him there
Extra parenthesis
 
oh, unbalanced parens
 
> Complex math.
 
that would definitely give you an error
 
mr5
1:25 PM
@HéctorÁlvarez it's complex because it has multiple operands
 
That's not complex
 
actually, that wouldnt even compile with balanced parens
 
Oh you mean in that sense.
 
because I removed the operator overloading stuff
 
Aside from the unbalanced parens its fine
 
1:26 PM
so all those operators are unexpected tokens
@mr5 I want to have something running, but I dont have anything that produces something useful yet
i need to make a JS generator prolly
 
mr5
so you're just making another Coffee Script
 
Wow Wiet's meme language will "compile" to another meme language
 
I want LLVM
 
mr5
@HéctorÁlvarez yeah. I consider that Math already complex because it requires me thinking
 
but it is such a pain
I could produce CIL, but I would have to learn it
and someone would have to build a better type system in it
 
mr5
1:29 PM
how about just basic output, like 1+1?
 
still operators
 
Hello worldS?
 
hello world compiles
and produces a "pid"
 
If you can't manage 1+1 that's a slight problem
 
I can only not manage it because I removed operators from the pattern matcher
 
1:30 PM
Well why did you do that
 
because it isnt necessary for hello world
:P
at first, I thought that simply returning 42 from a main method was the simplest application
but then I realized, I wanted to generate JS
and 42 is an integer
 
mr5
@Wietlol you should have prioritize to make 1+1 working before that "hello world"
 
1 + 1 is also integers
and still JS
 
mr5
ugh, I don't understand why you didn't prioritize the operators?
 
why should I?
 
1:35 PM
So your language can do the most basic operations of a computer?
 
you still have functions
for the program instructions, operators dont exist
only functions
 
So you already have functions like Add(1, 2)?
 
1 + 1 would be equivalent to 1.plus(1)
or sum(1, 1)
and that sum function would be "external"
the generator would understand which function it is and generate JS code that would do the sum operation
or the CIL code that would do the sum operation
or the LLVM IR code that would do the sum operation
etc
 
But right now, you can't add two numbers?
 
I can
 
1:38 PM
How?
 
just not using the syntax 1 + 1
but for example using sum(1, 1)
 
Ah so you already have the sum function implemented?
 
the intention is to make X.plus(y: Y) have an "attribute" that would define the operator
@Squirrelkiller the generator does that
 
The generator...implements the framework function?
 
0.o?
 
1:41 PM
sum
I asked whether you have it implemented
And you said the generator does that
 
@Squirrelkiller yes
 
mr5
@Wietlol oh. that's why you want an LLVM
 
I really want LLVM because it can produce machine code for windows/mac/linux and pretty much everything else
and has a whole set of optimizers
 
mr5
Does it produce binaries directly and does it support per CPU instruction set?
 
If only there was a bunch of other languages which used it already, which other people are already familiar with and are commonly used
 
mr5
1:45 PM
I wish I am working on low level stuffs instead of apps
 
@mr5 i have no clue
 
mr5
I'm kinda not fit in this field
 
You...want to work low level?
 
mr5
yeah. Hard to fit every logic in real world
hard to please real world in mobile app level
And I find myself not so interested in doing UI stuffs
Except if I am the one doing the UI Framework
 
Ew mobile apps
 
mr5
1:49 PM
Yeah I know. My first choice was a game developer but the salary here is so low
 
Nah business logic is where it's at
Warehousing & logistics is excellent fun
 
[Column]
public Int32? AccountId { get; protected set; }

public virtual Account Account { get; internal set; }
in EF, if the AccountId has a value, that means Account is not null, right?
 
mr5
ew
 
Rob
2:08 PM
@Wietlol Nope, someone could set AccountId without setting Account
If you've just loaded it from the database, then yeah, it should
 
it loads it from the database on a new dbcontext, but i get an NRE on it.Account.Something
 
Rob
Have you made sure to .Include() the Account table?
 
When you are using .NET full framework (not Core), then virtual objects will be lazy loaded to my knowlage
So you don't have to manually include it
It is loaded when it is asked
But this has it's own drawbacks, it can sometimes work by it's own will, so it is more logical to disable lazy loading and load only what you need (with .Include() )
EF Should be that smart to connect Account and AccountId property names without defining [ForeignKey("")] annotation
 
mr5
2:41 PM
Google Live Docs is really useful :D
 
Google docs is awesome
that included sheets
 
mr5
My GF and I are working on a single document to make project for her sister.
She's on another country :D
I provide the layout she provides the data.
 
2:57 PM
I miss google wave :/
 
mr5
3:13 PM
Have any of you tried opening a bank account using only an app?
 
3:34 PM
yeah
honestly its quite simple
 
3:53 PM
hi guys
linq sum not work as expected , did i miss something
 var result = from scheduleStatus in dbContext.ScheduleStatus.Where(ss => ss.Date >= dateFrom && ss.Date <= dateTo)
                         join members in dbContext.Members on scheduleStatus.MemberId equals members.MemberId
                         join phones in dbContext.Phones on members.MemberId equals phones.MemberId
                         join schedules in dbContext.Schedules on phones.ScheduleId equals schedules.ScheduleId
                         join scheduleDetails in dbContext.ScheduleDetails on schedules.ScheduleId equals scheduleDetails.ScheduleId
Charges = g.Sum(c=>c.charges.Amount)
the sum is returned without grouping , it sum all records :(
 
mr5
4:18 PM
@Bassem if I were you, I will try to break those down first in to very simple queries
 
it is a simple join
i want to know if i have something wrong in grouping
 
mr5
it's so simple you can't even solve
 
i am speaking about join
 
mr5
just try to scrape out the unnecessary properties in your joins
just so you have a working example
 
grouping syntax is right ?
 
mr5
4:39 PM
@Bassem see this example: ideone.com/G6hlnv
 
@mr5 it was a problem in join
( the simple query )
 
mr5
I'm not familiar with that LINQ syntax and I'm trying to avoid it cuz it's not intuitive syntax
 
you were right
:( :(
 
mr5
yeah just learn from it. you do simple things first before jumping into that complex queries
 
 
 
3 hours later…
7:12 PM
I have a what should be an easy question but all tutorials I encounter are not answering my case
I want to make a helper class. It will just be filled with static values (making a game and need to set game int and string values there).
Is that just a static class?
and how would I call that in different pages?
 
mr5
You should marked the class static and the variables as consts
 
ah I think marking the variables as consts is what I might be missing
 
 
2 hours later…
9:06 PM
this is hello world basically
the minimalistic part to make a hello world application
the json below it is the program instruction declaration
it contains all information required to understand the behavior of the application
and it is what a generator would use to produce the program in the target of your choosing
 
9:32 PM
Which laptop do you use for c# development?
 
9:42 PM
msi gl72 6qf
 
9:59 PM
(version with annotation arguments, which kind of also makes sense for hello world)
 
10:17 PM
const root = {
	NativeString: {
		construct: function(value) {
			return {
				value: value,
			};
		}
	},
	printLine: function(text) {
		console.log(text.value);
	},
	main: function() {
		root.printLine(root.NativeString.construct("Hello World!"));
	}
};

root.main();
maybe something like this from a js generator
(I intentionally wrapped the string value and dont use prototype)
 

« first day (3145 days earlier)      last day (1795 days later) »