« first day (1289 days earlier)      last day (3677 days later) » 

12:02 AM
THEY MISSPELLED QO'NOS
 
I think code should read like English. That's very difficult to do in JS. You have to interject "function" everywhere, there's no true static types,

$(".card").click(function(){
$(this).stop().animate({
...
});
});
That's not English.
Most JS developers claim "OOP is not a language, it's a pattern!"
So C is OOP, apparently.
 
JS is object oriented, it's just not strongly typed
And btnOpen.Click += btnOpen_Click isn't English either
 
But you can break encapsulation with valid syntax in JS. Which makes the language itself not OOP.
 
user1804599
wat
 
user1804599
Encapsulation is not an inherent feature of OOP.
 
user1804599
12:08 AM
OOP is about passing messages to objects that act upon those.
 
Not acording to the inventer of OOP.
The very idea of OOP was to move away from functions.
 
user1804599
Aahahahh.
 
"OOP to me means only messaging, local retention and protection and hiding of state-process" -the inventor of OOP.
 
JS is designed so that it can be OOP, or it can be another paradigm
 
Right. I agree.
But I would not say that it enforces OOP as a language.
 
12:17 AM
Of course not, read what I wrote above
It doesn't enforce OOP so that it can be written in other styles
 
Is every language an OOP language?
Is C?
 
It's very hard to write OO code in C, and it doesn't look like most other OO code, because C was not designed with OOP in mind.
You can write OO C code though
 
I think for JS diehards, OOP is only about passing information. And that's it. They say things like "Encapsulation is not an inherent feature of OOP." But that is their own definition that strayed away from the original definition of the guy that coined the phrase. And s it's not helpful to ask if JS is OOP, but to ask, has the definition of OOP been redefined? What is the definition of OOP now?
And then you find the division.
And that's why I like to call JS Object-based.
So there's a distinction between JS's definition and all the other "OOP" languages.
 
The reason you don't think of JS as OO is because you see JS code that's not purely OO.
 
Yeah like accessing private variables outside the "object"
 
12:24 AM
It's not hard to write very OOP code in JS
@RyanJMcGowan JS doesn't have private object variables, what are you talking about
 
Sure. But it's not because JS has syntax for private. It's because you treat it as a pattern, and it's not the language itself doing it for you.
 
What do you mean? I have no idea what you're talking about.
 
To me, that doesn't tell me JS as a language is very good at OOP. The language itself doesn't make things private. Same goes for inheritance.
JS exists in some sort of limbo where it's almost a OOP language, but falls short.
 
JS has inheritance
 
prototypes
 
12:27 AM
why are private variables necessary for OOP?
@RyanJMcGowan exactly
 
Because that was part of what OOP intended. Objects HIDE their internals.
Here's the guy that invented OOP: "OOP to me means only messaging, local retention and protection and hiding of state-process"
 
There's no reason a JS object has to show its internals
 
It's not whether it has to. It's whether it's possible. That's what protection means.
I mean I can have a public variable and not access it. That doesn't make it a private variable.
 
JS can have private variables too
Just not associated with an object
 
And that makes it object oriented?
That sounds like the opposite. haha
 
12:32 AM
of course not, the internals don't make a difference in whether it's OOP or not
 
By your definition. Which is why I say JS has a different definition.
 
Are you saying JS says the internal implementation of an object determines the object-orientedness?
 
I'm saying every other OOP language does that. Going back to the 60s.
And it's included by the guy that invented the damn word.
 
does what?
 
Protects it's insides.
black boxes and whatnot.
 
12:36 AM
A JS object can do that too.
 
Among other things. But i look at the guy's quote and I see 3 times he talks about that internal nature.
 
But he didn't say how the internals need to be expressed.
Like you said, black box
 
JScript so similar to C# o.O
 
Black box means you can't access the inside.
In JS you can.
with the "this" keyword.
 
@jyrka You just showed your noobiness. JavaScript != JScript, and just because they have curly brackets does not mean they are similar.
@RyanJMcGowan In C# the this keyword gives you complete access to the internals as well, what is your point?
 
12:39 AM
i wasnt rly looking what you were talking about ..
 
If JS as a language wanted to be OOP, they'd at the very least have syntax that enforced privacy.
this can't be used in C# from outside the object.
 
C# doesn't enforce privacy
 
this is only valid inside a class.
 
@RyanJMcGowan Neither can it in JS
 
Sure it does.
 
12:39 AM
Of course not
You can make everything public
 
How can you access a private property in C# from another class without having to add some public accessor?
 
You can't
Neither can you access the internals of a JS object from outside its scope
 
Yeah you can. Hang on. Let me find a snippet.
I'm seeing one where you don't even need "this" it looks like.
If you pass the constructor into another object, you can access it's private members.
Reflection.createExposedInstance = function(objectConstructor)
{
  // get the functions as a string
  var objectAsString    = objectConstructor.toString();
lists all the functions, including private.
 
You can use reflection on C# too, your argument is invalid.
 
Except in this case, it's not some attribute. It's just passing a function into another.
 
12:54 AM
In fact, I think you can hide your functions from attacks such as this. I saw a library that does just that.
@RyanJMcGowan What do attributes have to do with it?
 
I'm not 100% proficient with C# Reflection, but can you really access the private field with it? Why is it so hard to do unit testing on private members then?
 
1) Yes 2) because reflection is very verbose
 
idk man. I don't think you can.
 
You sure can
 
Not according to MSDN
"A property is considered public to reflection if it has at least one accessor that is public. "
 
12:57 AM
All you have to do is pass a flag telling it to probe nonpublic members
 
Ah, I should have kept reading.
Now is that a flag on the type or the reflection class?
 
On the method that gets the member
 
because a flag on the type is pretty much just a public accessor at that point.
 
such as GetField
 
I never use reflection. Other than a few MVC attributes.
Never rolled my own anyway.
 
1:00 AM
Reflection doesn't have anything to do with OOP though
 
Well in JS, the name of the variable was Reflection. It was just an ordinary var.
 
All OOP languages have their internals open to decompilation. It's a fact of life.
 
So why don't those decompilers show private elements?
 
They do
 
Which one do you use?
 
1:02 AM
ILSpy
 
I'll try it out. I could use that.
 
gotta run, bbl
 
later
 
oh, it's great tool
largely superseded by referencesource.microsoft.com for me though
 
bookmarked
Ah, that's the .Net framework though. I wanna do more hackish stuff.
Reverse engineer some DLLs.
On invoke private methods through reflection: "I am going to get myself into so much trouble with this. – Frank Schwieterman Mar 10 '09 at 18:10"
hahaha
 
1:07 AM
@RyanJMcGowan You're only decompiling .NET binaries?
 
No, I wish. But a lot of them are .Net.
 
Hm, okay
 
user1804599
@KendallFrey It is easy to write OO code in C.
 
user1804599
struct user {
    char* name;
};

inline void greet(struct user* user) {
    printf("Hello, %s!\n", user->name);
}
 
user1804599
If you are ermahgerd must be private then just put the definitions in a .c file and declarations in a .h file.
 
user1804599
1:18 AM
Polymorphism can be achieved in numerous ways, most of which are pretty straightforward.
 
Polymorphism? You mean encapsulation I think.
 
user1804599
WTF? Those are totally different things.
 
I know.
 
user1804599
Why would I confuse those?
 
You're talking about private fields and then said polymorphism.
 
user1804599
1:20 AM
Yes. I was done talking about the former and then I went on to the latter.
 
Ah ok.
 
user1804599
You can achieve polymorphism with function pointers or switch-based dispatch, and probably in other ways.
 
user1804599
Oh well.
 
user1804599
People who believe that OOP implies encapsulation are not nearly half as bad as those who think encapsulation is specific to OOP.
 
user1804599
room topic changed to C#: C# is not object-oriented. [.net] [asp.net] [asp.net-mvc] [c#] [entity-framework] [linq] [visual-studio] [wcf] [wpf]
 
1:27 AM
Why is it that it meant encapsulation to the guy that invented it, but not now?
To make room for JavaScript?
 
user1804599
Who cares anyway.
 
user1804599
You don’t need language-enforced limiting of field access.
 
I have a Corvette. Other people call it a Corsica. But to me, it's a Corvette.
 
user1804599
And even then, limiting access to data in JavaScript can be perfectly achieved using closures.
 
user1804599
function User(name) {
    this.greet = function() { alert('Hello, ' + name + '!'); }
}
var user = new User('rightfold');
// cannot access name directly
 
user1804599
1:33 AM
But you don’t need this. Just prefix “private” fields with an underscore or use Object.defineProperty or something.
 
What I've seen usually entails passing a function into another function to access the private fields.
 
user1804599
If you are afraid someone will fiddle with those “private” fields, just make sure no morons touch your code base, and since you should do that anyway, it’s a non-issue.
 
What if I am the moron?
 
user1804599
Then don’t touch the code base.
 
Oh man, this healthcare site will never get done now.
 
user1804599
1:39 AM
Better never than when written by morons.
 
user1804599
Esp. if it’s healthcare.
 
@rightfold Of course you can do that, but like I said, it's different than typical OO code, and more advanced OO concepts like polymorphism are harder to implement then with a 'traditional' OO language.
 
user1804599
Most often, indeed.
 
user1804599
It’s sad C doesn’t offer static polymorphism.
 
user1804599
C++ FTW!
 
1:45 AM
@RyanJMcGowan Why do you keep insisting that JS does not fit the definition of OOP?
 
Because I think there's two different definitions going on.
 
How does JS define it differently?
 
user1804599
Beh object-oriented programming.
 
What's one OOP-related thing that C# supports and JS doesn't have an analog for?
 
user1804599
inb4 threading
 
1:49 AM
I said OOP-related, silly
and yes, JS does have an analog for threading
 
user1804599
There are people who say that threading is OOP-related. :P
 
How?
 
user1804599
Or exceptions.
 
user1804599
@KendallFrey They are morons.
 
Exceptions are typically implemented in a very OO fashion, but fundamentally have nothing to do with it
 
user1804599
1:51 AM
The world needs more functional programming. <3
 
The world needs more REBEL :)
@rightfold with new Axe Peace...
 
user1804599
My Styx compiler works, by the way!
 
sorry, too many Axe commercials
What is Styx?
 
user1804599
It is a programming language that I am working on.
 
user1804599
1:53 AM
% cat test2.styx
(define print
  (lambda (x)
    (.log $console (string x))))

(print "Hello, world!")
% cat test2.styx | node styx.js | node
Hello, world!
 
user1804599
:D
 
functional, right?
 
It allows OOP as a pattern. When I say X language is OOP, I would mean that to imply the syntax has some sort of enforcement of OOP principles. JS does when it comes to instances. But encapsulation is an afterthought for JS. But the newer definition seems to be that encapsulation is no longer associated with OOP. And I'm not going to argue that anymore.
 
user1804599
 
user1804599
@KendallFrey Functional and object-oriented.
 
user1804599
1:54 AM
But mainly functional.
 
I would not call Exceptions OOP. That makes no sense at all.
 
@RyanJMcGowan You seem to continue to think that JS objects cannot have internal state, when this is in fact not the case.
@rightfold Looks quite verbose
 
user1804599
I’m going to add shorter definition syntax.
 
I know they do. I'm not saying it's not possible. I'm saying it's easy to break.
 
user1804599
(define (all xs) …) instead of explicit lambda.
 
1:55 AM
The English words do make it pretty readable to noobs though
@RyanJMcGowan In what way?
If you can break it, it's not a black box
 
user1804599
It’s only easy to break if you are a moron.
 
user1804599
Write good code.
 
passing functions into constructors like I showed earlier.
 
user1804599
There are no excuses ever for writing bad code.
 
user1804599
1:56 AM
Use simple and straightforward techniques and use common sense.
 
user1804599
IOW:
 
user1804599
22 mins ago, by rightfold
But you don’t need this. Just prefix “private” fields with an underscore or use Object.defineProperty or something.
 
@RyanJMcGowan That doesn't expose internal state, it merely exposes implementation. This can be blocked in JS, but not C#.
@rightfold not true
Welcome to the business world, where bad code that makes money is good code.
 
By blocking, do you mean something inherit in JS that is designed to do that? Or some obscure measure?
I mean, a simple keyword like "private" is a language feature.
Not some pattern.
 
user1804599
@KendallFrey We follow the rules at work.
 
1:58 AM
It is somewhat obscure, because it's not typically something you care about
Why does it matter if the internal implementation is visible?
 
user1804599
Also, good code that makes money is also good code.
 
user1804599
So it does not have to be bad code.
 
OOP is about good code, not security
@rightfold That's true, but sometimes bad code will make more money than good code.
 
user1804599
Until you have to maintain it and it slows you down like hell.
 
At that point it's not making you money anymore
If it's a one-off, there's no reason to make it maintainable.
Most code should be clean though
 
2:13 AM
@KendallFrey you still here?
 
Do you sleep?
 
sometimes
 
You're like the lord commander of this chat room xD
 
3:05 AM
hi. In asp.net do all request pass through the UrlRoutingModule? Before .net framework v4.0 was it like this?
 
 
5 hours later…
7:59 AM
Hey Johan, you got any time on your hands?
 
kinda busy with my own code but don't hesitate to ask. Also ping cos I'm not paying much attention to chat. :9
 
@JohanLarsson Any experience with Entity Framework?
 
very little only played around, never used it really
what is the question?
drch & Travis in this chat are pros when it comes to ef & db
 
I'm having the hardest time trying to figure out how to implement the repository pattern. So many different articles all doing it in a different flavor. Some have multiple projects, some say keep it in one project.
 
I'd lean towards keeping things in one project if it is small
you can always move things out later ime
 
8:04 AM
yeah I'd say its small and that's the way I was leaning, but there seems to be a lot of moving parts. I can't find a comprehensive explanation with examples
 
adding layers tends to mean needing much code that does nothing but shovel around data
 
I'm going to spend the next couple hours continuing to look
The value in doing this, apparently, is to make the code testable and I definitely would like that.
 
I don't know enough to guess on best practices, rubberducking is the best you'll get from me.
@TheRedLou To make things testable design it so that you pass in everything that touches db via constructors and as interfaces
If you have that testing should be np
 
@JohanLarsson That's alright, I'll still to the WPF questions with you then. I'll try to catch the guys you mentioned sometime if I can't figure it out.
@JohanLarsson Yeah, that's what this pattern seems to be suggesting but it's slightly over my head at the moment. I may need to just power through some more reading.
 
If you aim for testability an IoC container can be handy. Here is a toy sample for sm & ninject. Here is another toy sample using ninject & Moq.
Dependency injection sounds scary and advanced but is really simple. The only pain point is the interfaces ime.
Not painful really, I just don't love them cos I find them noisy.
 
8:19 AM
@JohanLarsson Thanks Johan, duly noted and appreciated as usual.
 
 
5 hours later…
1:39 PM
Anyone here?
need some help with WinAPI - Aeroglass
how to get rid of that little dot in the middle? mediafire.com/view/4fmdoaz5mhvv1tt/scrn-535d09d0.png
form is 720;480 , i made it draw glass from all sides by half. (360;240)
 
What if you increase to 361x241?
 
1:56 PM
still there
 
2:18 PM
I'm here, yes.
 
I meant the dot :)
 
Anyone know anything about the RichTextBox control in WPF?
where's the property to put text in?
 
2:36 PM
not Text?
 
2:46 PM
ha
I mean ah
You have to set its Content property to a FlowDocument
more than I need really, I'll just use a TextBlock
 
that's strange...does anything happen if you set Text?
in code, I mean
 
the wpf richtextbox doesn't have a Text property
 
oh epic fail! I managed to find the Forms RichTextBox docs instead
 
3:02 PM
Is there a property called FlowDocument?
 
3:15 PM
Hi guys!
 
How to remove that menu when you click icon on windows form?
 
3:40 PM
@LasseV.Karlsen The RichTextBox's Content property is called Document which is of type FlowDocument
A FlowDocument is like microsoft word in a control
 
4:17 PM
Hi Dose Entity Framework 6 support Read only Context?
 
 
3 hours later…
7:02 PM
too quiet today
 
Everybody working hard
 
Just woke up and about to get started. You?
 
Was thinking, in C# room to end sentences with ";" like this;
:)
 
new sentence("Lol you have to initialize each sentence too.");
Is anyone here a quasi-expert with EF?
 
7:18 PM
MessageBox.Show("Must go for a while");
 
7:37 PM
return jyrka;
:)
 
 
2 hours later…
9:15 PM
Anyone here?
 
Yes, but not for long.
 
Can you help me with one problem ?
 
I hesitate to answer yes, because when people ask that question instead of asking the real question, it usually means it's a lot of work.
But shoot, we'll see.
 
checkBox1.MouseDown += (s, e) =>
{
if (e.Button == MouseButtons.Left)
{
ReleaseCapture();
SendMessage(this.Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0);
}
};
Made it so can drag when mouse is down on checkbox, but now cannot check it :/
 
You probably want to handle that in MouseMove instead, noting that you've first pressed down on it.
ie. handle MouseDown by just saving "MouseIsDown = true;", and then in MouseMove check if that is true, and if you've moved "enough", then you do the above code.
 
9:24 PM
Ok i will try;
Well, the problem is in "ReleaseCapture()"
 
Do you want to drag the form or the checkbox?
 
form
 
I made it all Aero with DwmExtendFrameIntoClientArea()
 
Did my code work?
 
9:40 PM
Yes, thx :)
@LasseV.Karlsen have you ever made program like this?
 
What do you mean by "like this"? The glass look? No.
 
yep the glass
 
 
1 hour later…
11:15 PM
Does anyone have a link to read on adding google oauth to an MVC app? Everything I've got after a few hours of searching seemingly assumes you already know.
 
@Kivin I know that one of the default project templates in visual studio 2013 has it already built in and ready to go.
 
Anyone know how to get process image name?
 
@TheRedLou For whatever reason, I can't find a template in my install that shows anything. Besides, I want to install it in to an existing production and could really use a simple "these are all the components that make it work"
 
@Kivin Here's a link that might help as well: asp.net/mvc/tutorials/mvc-5/…
 
The "description" part in task manager.
 
11:19 PM
@TheRedLou Unfortunately, that's exactly what I'm referring to: That's a pointless article that takes a thousand words to say "use the template."
 
What version of visual studio you running (update version)
?
 
2013 12.0.21005 apparently
 
Read after that number. Does it say Update or something? I'm assuming you went to About
You must install Visual Studio 2013 Update 2 RC or higher to use Google OAuth 2
 
I doubt I have that. Might explain things.
 
Says right there at the top of that link I sent you.
 
11:24 PM
I don't think I've ever updated (or had to) a visual studio install before, so it failed to cross my mind
It actually seems to suggest that the update is to resolve SSL warnings, but I'll take your word for it. Installing.
 
Lol I gotcha. Well after that, look into the Nuget package DotNetOpenAuth
I'd say you need considering it's an "and" statement
isn't this why we're supposed to use oxford commas?
 
We'll see soon enough 3 Gig update, yikes
 
whoa
Do you want to just try it first without updating?
Might get lucky
 
Meh it's already running a web install and it's already wasted enough of my time (the reading, not you of course!) so I might as well just let it crank away
 
11:28 PM
I figured there just had to be a site somewhere that'd show what classes and methods to add and call to set it up. Amazingly difficult to get information.
 
Quite uncharacteristic, too. I've noticed EF6's docs are pretty poor as well, compared to older versions. Been using old bookmarks to remind myself how to do stuff.
 
@Kivin Once you grab that update, you can create a sample project and look at it for how to migrate it to your other project.
It's pretty straightforward
 
Here's to hoping
 
I know I am in the wrong place to ask this but I can't find a solution and maybe someone knows a fix, I need to install a new service in my Windows Server 2012 R2 Datacenter but I get the following error : 'The request to list features available on the specified server failed' Screenshot : prntscr.com/3e3tms
Anyone?
 
11:34 PM
Sorry, I have no idea
 
>_< The only stupid solution I found was format the server and reinstall it ._.
 
wow i'm having issues today.
 
serverfault.com.... hmmm
Okay
 
Nobleleader: Try posting your question on serverfault?
 
Will do
thanks
 
11:40 PM
Probably cast a wider net that way and get some real experts
 

« first day (1289 days earlier)      last day (3677 days later) »