« first day (1051 days earlier)      last day (3882 days later) » 

12:00 AM
It's really interesting how amicus became novio in Spanish. wonders which other language influenced that
 
m59
Tienes los ojos de baca feo.
 
@OctavianDamiean ʘ‿ʘ
 
m59
Errr.... Tienes los ojos de vaca bonita! <--- complement version
 
I mean I'm aware that there's amigo in Spanish which obviously originates from amicus but there's no word for boyfriend in Latin.
 
@OctavianDamiean I don't know, novio means groom too.
 
12:05 AM
^ pure fucking talent
 
m59
oh dangit
 
@BadgerGirl Ohhh!
Now that changes everything.
 
m59
cow is vaca, with a "v"
my bad.
 
Right.
 
m59
LOL
baca is roof.
That makes really no sense :)
 
12:06 AM
Since novus mariti would mean groom. I can see how that became novio.
 
@phenomnomnominal That makes me cry :(
 
Bastante de esto! Es hora de dormir.
 
@BadgerGirl exactly!
And that's him with a freaking cold!
 
Just to show you how close that is to Romanian. Destul de asta! Este ora de dormit.
By that I meant Spanish.
 
@OctavianDamiean Buenas noches, que sueñes con tus gatos.
 
12:10 AM
Dormir = sleep?
 
chewing on you know what...
 
@phenomnomnominal Yea.
@BadgerGirl No! Bad girl!
 
m59
Good night, what ___ with your cats?
 
@m59 dream of your cats
 
m59
I was googling haha
que != what ?
 
12:12 AM
In this case it's subjunctive.
 
m59
^ I'm too dumb for that.
=D
 
I'm so hungry, somebody buy me something healthy.
 
Mi gato dice hola. :D
 
No te ibas a ir a dormir?
 
Lo se, tengo que irme.
 
12:19 AM
Dile hola a tus gatos, y cuídate de que no mastiquen ya sabes qué. Buenas noches.
 
Sí, claro.
 
m59
Is new ok as a property name?
jsbin throws a warning but my ide doesn't.
 
user1125394
 
user1125394
(playback)
 
12:39 AM
Fruity Pebbles are like tiny dried leaves from a rainbow tree.
 
1:07 AM
@Aaron Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
@Freak_Droid Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
1:22 AM
Airport internet sucks.
@copy You probably like his line of thought
Personally, I think cryptography is perfectly fine to do if you understand what you're doing :P Which is less than 1% of web developers... probably less since the Math involved is usually pretty hard.
 
@BenjaminGruenbaum Actually, in my last flights, it wasn't half bad.
 
I guess it's my fault for downloading big files
Then again I pay money for it (There is free internet too), so I feel entitled to get good service.
 
Crypto is hard
 
I like cryptography, it's a lot of fun algorithms that make studying things like Mathematical groups feel worthy very early on.
It's a very nice way to justify the usefulness of abstract Math to students.
The hard thing about crypto is that often people - me included, use "standard, well known" schemes without understanding the underlying algorithms and the mathematical properties of everything, which makes even the slightest deviation very easy to attack.
The problem is - because of the Math involved, it has become acceptable to use complicated schemas without actually understanding what they do. We often like to joke about jQuery people who don't know the DOM or framework people... but most developers (me included from time to time) are those people when it comes to Crypto. Given the slightest deviation - I'm likely clueless, the only difference is that I'm shit scared :)
 
That's why you should use working software or protocols like SSL, PGP etc.
 
1:37 AM
In 99% of cases they do, sometimes you need something slightly different and you're screwed :)
Even if they work nicely, there are often implementations I don't really trust implementing known schemes.
Now, I've studied (in Uni) about most of the common algorithms that are usually used for Cryptography (in "Crypto 101") - but that makes me one of those people who have some theoretical background but no practical understanding of how to correctly implement and test it, and the scope of attack vectors I know is also very limited.
Most of the security is that there are a lot of people who make mistakes that are a lot more obvious. Like Ruby people who love storing their DTOs in their database directly (So you could send "role":2 in your JSON :P). Or PHP people who love them SQL injections.
 
1:51 AM
Waiting for the haters...
0
A: What is proper way to create complex elements?

Benjamin GruenbaumIf I may suggest a traditional approach, I'd do something like this: var group = document.createElement("div"); group.className = "btn-group"; var btn = document.createElement("button"); btn.className = "btn dropdown-toggle"; btn.title = "Manage"; btn.setAttribute("data-toggle","dropdown"); va...

Lol jQuery, you so slow.. jsperf.com/create-native-or-jquery
 
94% slower
well damn
and that was on jQuery 2
 
Yep, I don't like micro optimizations though, I was just surprised at how unoptimized that ended up being compared to working directly with the DOM
I mean, if you nest it just 2-3 levels deeper that might actually matter
It's jQuery 1.9 iirc, not 2.0
 
ah, ok. weird that it says 2 then
 
It's the two suggested implementations from the question.
Anyway, I've got a plane to catch - so I'll be back later
 
have a safe trip
 
2:02 AM
ty
 
 
@user2550807 Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
m59
2:36 AM
sigh...I don't get why this doesn't work :(
pageEditing = $scope.pages[key];
pageOrig = JSON.stringify(pageEditing);
$scope.pages[key].title = 'changed junk';
pageEditing = JSON.parse(pageOrig);
 
@Retsam Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
m59
pageEditing ought to be a reference to [key] and therefore reset the value to it....
 
I'm reading through the "pseduo-rules", and came across "3. Do you believe in the philosophy "Just use jQuery"?", under "Are you a help vampire". I'm curious, what does jQuery have to do with being a help vampire?
 
@m59 Do you believe that if you change pageEditing it also changes $scope.pages[key]?
 
m59
yes
 
2:42 AM
Well, that is not the case
 
m59
I thought that was the idea of references.
 
We do not have that in our beautiful language
 
m59
Have I been in php too much??
 
I hope not
 
m59
dang I'm confused.
@copy ok...this whole thing has been odd. I think my brain was dead. Scratch all that. I'm not confused.
Too much coding.
 
2:55 AM
It's the PHP
Always blame the others
See here for a sane language: udacity.com/course/cs262
 
 
1 hour later…
3:58 AM
The last message was posted 1 hour ago.
 
4:44 AM
@ThomasShields Hey
 
5:09 AM
@copy you bored?
 
Yeah
 
hey there
when i type the query string at the end of my asp.net mvc project, like this: localhost:3456/home/applist?apps=nba&dinner
it just get the string nba in my action
how can i get the full string "nba&dinner" in my action?
 
@paulcheung Hmm. So you'd want to add a character that normally gets crunched, since it's meaning is significant to URLs.
 
oh,
 
perhaps replace it with some sort of 'escape' character instead
 
5:17 AM
eacape char, such as?
#$%^?
can the two div content be selected at the same time in web page?
 
Impossible!
 
5:42 AM
@paulcheung Depends. How many jiggawatts of RAM does your HDD have?
 
Is there a way, I can access c within my function

function count(str) {
var c = ["qqq","dfsdf","sdfdsfdsf","ds","zzzzzz"];
return str.length
}
count(c);
 
@Mike yes, through the variable c
 
No no no ... NO
 
m59
Catastrophe.
 
@SomeKittens: how? please elaborate
 
m59
5:47 AM
@Mike there are many ways.
Study scope
 
@m59 do you mean closures?
 
m59
somewhat, yes.
encapsulation
 
Even though my web app is primarily in PHP, the concepts are really the same compared to JS. I have been developing a web app in PHP (and JS, HTML, CSS) for quite some time now and I have stopped and asked myself: Should I have built this in an object-oriented approach? So I thought I will ask the experts here too. Should I have built it in an object-oriented design? Is there any benefits/advantages in doing so compared to non-object-oriented design?
 
m59
My gosh man.
ALWAYS OOP.
 
5:50 AM
No you should not
 
m59
There are ALL the benefits.
 
NEXT
 
Well, I guess I shouldn't expect serious answers, huh?
 
m59
I am dead serious.
Just about everything is wrong with non-OOP.
 
Most answers related to OOP are wrong
 
m59
5:52 AM
That's like saying, should I write, clean, understandable, non-explosive, efficient code, or just awful code in most every way?
 
The opposite to OOP is not bad
 
@m59 Non-object-oriented can't always be bad.
And OOP doesn't always work. There are tons of examples where OOP won't work (or I don't think it will).
 
m59
Sad day.
 
m59
@copy you trollin'?
 
5:54 AM
@m59 No, you?
 
m59
Not a bit.
Just confused how procedural global catastrophe code can be good.
I've never seen or heard of it.
 
Let's look at a discussion community website for example, you can't really put that in an OOP form.
 
m59
I think you think OOP is like MVC.
That's a file/code structure vs a coding paradigm.
 
Nah, I am not even talking about file structure stuff and I know how you would think that I am talking about mvc, but I am not.
 
m59
A "website" being oop makes no sense.
There's no OOP html/css
 
5:59 AM
OOh, a religious war
 
Primarily in PHP and Javascript.
 
m59
nor would the interaction between client/server be called OOP.
 
@m59 LESS, SASS
 
@TheGuyWhoCouldn'tTalkToTheGirl You should look into MVC
 
m59
@JanDvorak owned, true.
I would gladly accept that procedural garbage code is somehow not garbage if someone that knows what they're talking about wants to explain how.
 
6:01 AM
@m59 some RPC frameworks (GWT, e.g.) use an object-oriented approach to the server, the client, and their communication.
 
Well here is the actual reason I ask, in school, they teach you OOP in programming. So now I question myself whether I should follow the correct way instead of just putting out all sorts of code.
 
define 'correct'.
 
Throwing code at a problem until something works is about as maintainable as a house made of pasta.
 
m59
^ how can you possibly not find the answer in your statement there.
"I question myself whether I should write great code or just fail all over the place."
 
always code with the expectation you will be rewriting eventually. Make that rewrite happen when you have the full spec, not sooner.
 
6:03 AM
@JanDvorak What they teach you in school.
 
@TheGuyWhoCouldn'tTalkToTheGirl then I believe in incorrect things
 
@SomeKittens Which is exactly why I feel that I have a ton of inefficient code just going around.
 
@TheGuyWhoCouldn'tTalkToTheGirl they teach evolution in schools...
 
@TheGuyWhoCouldn'tTalkToTheGirl Seriously, look into MVC, it's a pretty neat (if not universally accepted) way of structuring your code when it comes to web developement
 
6:05 AM
@TheGuyWhoCouldn'tTalkToTheGirl also, they perpetuate the flat earth myth
 
m59
that should help.
 
Though I'm talking to a guy who can't make a decision to save his life...
 
@SomeKittens Ill look into it. I have never dealt with it before, so it will be a little confusing at first I guess.
@SomeKittens ?
 
In reference to "OOP is the only way to program", I'll throw in for saying, no, that's not always true. I've recently been looking into functional programming (inspired by John Carmack's recent quakecon talk), and there are a lot of benefits there.
 
m59
@Retsam I said I'm absolutely willing to agree, but could you name them and at least some kind of reason?
 
6:11 AM
@Retsam sssshhhhh, don't confuse the noob
 
No side-effects makes debugging and understanding code a lot easier.
 
m59
That sounds like the exact opposite.
 
Opposite of what?
 
m59
Those are two exact reasons I'd say to write OOP.
 
Well, sure, the point of any coding style is to make it easier to understand and debug.
 
m59
6:16 AM
A point is that things are in their own little world, only dealing with the things they are concerned with thereby not clashing with anything else and very orderly. I don't have a problem debugging anything because I find the thing that isn't working perfectly labeled and structured. Just like looking in a nice filing cabinet. Procedural is like throwing all of the files into a fire and then trying to read them while hopping over it screaming.
 
I'm talking about functional.
You seem to think non-OOP programming means "mass chaos"; actually functional programming style is more restrictive than OOP is.
 
m59
Ohh, I thought you meant procedural.
 
@m59: thanks
 
procedural is often faster than OOP
 
m59
@Mike np
 
6:18 AM
Hi everyone.
 
I wouldn't be afraid to use it in math-heavy blocks
 
And I will say, it's possible to write well structured and well labeled procedural code as well.
 
m59
I can't fathom how.
global disaster.
 
Maybe that's a flaw with you, not procedural programming.
 
Can anyone please explain to me what is the different between PUT/DELETE versus standard GET/POST methods of form submission??
 
6:19 AM
@m59 good naming, lots of structural commments
 
m59
lol gosh, but that's still non intuitive.
 
@cuzmAZN DELETE is supposed to remove a resource from the server
 
A benefit of OOP is that it basically tells you how to structure your program; procedural you need to be smart and do it yourself, but it's possible.
 
PUT is supposed to add a resource to the server
 
m59
Like my cache object. It's 1 thing that has some properties. It shouldn't be 5 different, seeminly non related functions.
 
6:21 AM
both should be idempotent IIRC
@m59 Agreed. I would use OOP here
 
@cuzmAZN POST 'must' be idempotent. PUT doesn't have to be.
 
Idempotent?
What does it mean?
Sorry, English isn't my strength.
 
It means doing something multiple times should be the same as doing it once.
 
I mean that you can issue them twice with the same effect as issuing them once
 
x = 5 is idempotent.
x = 5; x = 5; x = 5, has the same effect as x =5
 
6:23 AM
I see. So by that logic, how can "POST" be idempotent?
 
x++ is not idempotent, as x++; x++; x++ is different than x++
 
Like, you POST several times, it actually sends several requests.
 
POST is not idempotent
 
Oh; did I get that backwards?
 
that's why you can't cache it and refire at will
 
6:24 AM
So POST is not idempotent, and PUT is?
 
Stars are not favorites
 
Is there any practical application for method PUT?
 
@cuzmAZN not sure about PUT
 
I see in NodeJS ExpressJS, they use app.put();
 
@cuzmAZN Yeah, uploading a file
 
6:24 AM
@cuzmAZN PUT is supposed to turn a 404 URL to a 2xx URL
 
Uploading a file?
 
61
Q: OOP vs Functional Programming vs Procedural

Ashutosh Singh-MVP SharePointWhat are the differences between these programming paradigms, and are they better suited to particular problems or do any use-cases favour one over the others? Architecture examples appreciated!

 
Ok, let me try to understand it slowly.
 
PUT = create a resource = make some URL exist
 
Ok.
So when you PUT submit a file onto a server, it creates a link to that file temporarily, is it about that?
 
6:26 AM
Well, the exact definition of PUT/POST is sort of arbitrary, I should say. They're more like... guidelines... than actual rules.
 
so PUT is not idempotent?
 
So, just to simplify, can I substitute PUT by POST?
 
Looked it up; PUT should be idempotent.
 
Google obviously doesn't have enough resources on those unfamiliar methods.
 
m59
I just read 8 articles on functional programming and can't determine what that means.
 
6:27 AM
@cuzmAZN search with MDN in the query
 
The idea of functional programming is that everything is a function that takes input and gives output.
 
m59
But that's what things do anyway...
 
Not always, no.
I'm sure you've defined objects with methods that take no arguments or return no arguments.
 
m59
Sure.
But why make them if they don't need to?
That screws encapsulation.
 
Functional approach is about eliminating side-effects
 
m59
6:29 AM
Encapsulation and separation of concerns are for eliminating side effects, no?
 
@Jan Right; and if a function has no side-effects, there's no point to a function that doesn't both take in arguments and give out a result.
 
@Retsam int getRandom()
 
Okay; fair enough.
(Arguably, that has 'hidden' inputs)
(From a true functional standpoint, it takes as input the random number generator's current state)
 
m59
Sorry to be argumentative. I don't come to any belief lightly.
 
I am reading an answer from stackoverflow about POST vs PUT. I sort of understand the problem. There is 1 thing I can't understand though: They say, "If the request is not idempotent, use POST". I mean, is there really a situation when you send request 2 or more times and the effects stay the same?
 
6:31 AM
@Retsam correct. sorry
no-arg pure functions are constants
except with the potential to be lazily evaluated.
 
OOP -doesn't- eliminate side-effects. It's good to minimize them, but side effects are core to OOP.
 
m59
such as?
I don't get what you mean?
My code does what I want it to...I don't see the issue.
 
object.setValue(X) has a side effect.
 
@Retsam OOP eliminates side-effects across objects
 
Right. Which is certainly less mad than having crazy side-effects everywhere.
But, functional programming goes a step further and eliminates all side effects altogether.
 
m59
6:34 AM
I just don't get what that means.
 
@Retsam which makes it harder to maintain a global state
 
Instead of object.setValue(X), you might see something object = setValue(object, X) in a functional style.
 
m59
Could you tell me a real case "side-effect"?
 
(function () {
    window.fuck = 'fuck';
})();
 
@m59 setX(int)
 
6:36 AM
Anything that a function does, other than returning a value, is a side effect.
 
m59
that sounds fine....
@phenomnomnominal window is having a lucky night?
 
unexpected side-effects are the worst thing in maintainance
 
It's 'fine', and in some cases, 'necessary'.
But side-effects make code harder to understand and maintain.
 
m59
so.... functions can't append to the dom??
I mean, this makes no sense.
 
it doesn't make sense for every situation
 
6:38 AM
@m59 they can, but they have to take the DOM as an argument, and return the new DOM
 
because sometimes side-affects are unavoidable
 
@phenomnomnominal user I/O?
 
but there are languages where you just can't have side effects
 
m59
all I hear is global mess :(
and hoop-jumping.
 
There can't be a global mess in functional programming.
 
6:39 AM
@m59 yep
 
go try to do a nice UI in haskell
 
Because there's no global.
There's no global data to modify; it's just not allowed.
(In pure functional programming. Like, haskell as @phenomnomnominal mentioned)
 
@Retsam which makes it harder to maintain a global state if needed
 
m59
This is the js room, lol.
 
In JavaScript we're lucky, we basically have the option, because we have first class functions
so it becomes a stylistic thing
if nothing else, learning a functional programming language is good for just thinking about software in a different way
 
6:41 AM
I like the table paradigm for data scraping
 
m59
I could totally imagine how things might work in other languages, but I haven't even begun to understand how this makes sense for js.
 
every time you do [1, 2, 3, 4].map(Math.sqrt)
^ functional
 
m59
But that's one little piece.
 
yes, but you can always pass a function
 
Javascript isn't a pure OO language, either.
 
6:41 AM
functional = great. pure functional = mess
 
m59
That, to me, sounds like I should say all of my code is functional since I use functional concepts in some of my IIFE's when returning objects.
 
object oriented = great. pure object oriented = mess (see Java)
 
Sometimes it's better to program js in a OO style. But sometimes it's better to program it in a functional style.
(I happen to like Java... as a language. If it asks me to update again, I'm going to hurt someone)
 
m59
If you write a "functional style" script that accomplishes some goal, I'd love to see it.
Maybe then I would understand.
 
objects / classes are a great way to bind a set of functions to the stateful data they use.
 
6:44 AM
I have an AI for 4x4x4 tic tac toe written in a functional style
but it's not up anywhere yet
 
m59
Is one function having one purpose separation of concerns or is that called something different on that scale?
 
yep
 
m59
html/php/js separation, obviously. but I don't know what to call it.
Ok cool.
 
var compose = function (func1, func2) {
    return function (val) {
        return func1(func2(val));
    }
};
addOne = function (val) { return val + 1 };
timesTwo = function (val) { return val * 2 };
var timesTwoPlusOne = compose(addOne, timesTwo)
timesTwoPlusOne(2) // 5
 
@phenomnomnominal of course, in lambda calculus, you would separate that in two functions taking one argument each
 
m59
6:47 AM
Well, you brilliant people taught me separation, encapsulation, inheritance and probably some other good stuff and OOP is the only thing I've seen handle it
 
of course
plusOneTimesTwo = compose(timesTwo, addOne);
plusOneTimesTwo(2) // 6
 
oop = great; pure oop = hell
 
@m59 functional programming is very powerful stuff
 
m59
how can you have inheritance without objects?
 
6:48 AM
(Basically like how JS does it?)
 
@m59 function reuse
inheritance != polymorphism
 
m59
Oh, just skip it.
I get it.
 
A lot of the power of functional programming, that OO really doesn't do, is use code to manipulate code.
 
@Jay Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
6:50 AM
i always forget just how cool lazy evaluation is
 
@Retsam are you talking about first-class functions?
 
Yeah.
 
m59
I gotta sleep like 2 hours ago =D
All I see is really confusing math and really confusing code
 
you can have 1CF in OOP
 
You can, I suppose. JS obviously being an example.
 
6:52 AM
except in Java you wrap the function in an object implementing a predefined interface
 
m59
Whatever all of that code is doing....maybe I can see what you mean.
But I have no idea what any of that is.
 
You really should look into trying to understand functional programming. It really is worth knowing, once you wrap your brain around it.
Personally, I enjoyed learning LISP, which is a good example. I got tons of xkcd jokes when I did.
 
m59
The thing is, I'm still not at all convinced that anything I do makes sense that way.
Like the cache thing I mentioned earlier.
 
Well, 1) if you in JS, there's probably worth to learning functional style, as JS has good support for it, and can benefit from it
 
m59
cache.get(name);
cache.save(name, val);
cache.getSize();
and that's namespaced on top of that
 
6:55 AM
And 2) understanding it will make you a better programmer, even if you don't use it for the stuff you are working on.
 
m59
Pretty hard to learn without being able to use it.
 
you use javascript, so you can use it
 
OO may be the right decision for the project at hand, but you should KNOW that's the right decision by understanding the alternatives, not just making that decision because that's all you know.
 
m59
I'm still very hung on encapsulation, lol.
How can you do anything on the web and not have to worry about a namespace at minimum?
or an isolated scope
 
You'll still have to worry about some of this stuff. Again, we aren't saying -pure- functional.
 
m59
6:57 AM
pref both
 
//javascript (ES6):

var op = function(a,b) a+b;

//java:

var op = new BinaryOperator<int,int,int>{
  public final int calculate(final int a, final int b){
    return a+b
  }
}
 
@suczker Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
(Oh gosh, I don't know if I've ever seen the function() brackets omitted. I didn't know that's legal)
 
ES6
 
m59
Then we're probably arguing semantics.
 
6:58 AM
Mmm, I don't think so.
Functional style isn't just "semantics".
 
m59
Like I said, OOP is a means to accomplishing the requirements I stated for good code... that's all I've been arguing for.
 
Right, it's 'a' means. It's not 'the only' or even always 'the best' means.
 
your basis of "good code" comes from a solely OOP position though
 
m59
lol tug of war.
 

« first day (1051 days earlier)      last day (3882 days later) »