« first day (1559 days earlier)      last day (3390 days later) » 

10:00 AM
Yeah, I remember that
 
Started using it on our project today
 
How is it going?
 
Pretty well, it's a huge improvement over RobotFramework
 
Speaking of stupid questions... How to handle that ?
0
Q: javascript while loop result not matching value set

MichelI am reading the eloquent Javascript book and there's a code sample like so: var number = 0; while (number <= 12) { console.log(number); number = number + 2; } What I don't understand is that the loop says loop the number if it is less or equal than 12, yet the result i...

 
10:00 AM
excuse the lack of read me :P
 
@dystroy answer it, it's a legitimate question that's researched.
OP doesn't understand that looks run until the condition is false, so it'll get to 14 and not stop at 12.
He has a basic (but real and concrete) programming problem.
 
@BenjaminGruenbaum he got it following my comment, it seems
 
@dystroy yeah, but answering it would have been just fine
 
sooo
quote for today
> Javascript is an OK language to do small-scale development: an animation here, an on-click transition there. There are a number of warts in the language, e.g. its verbosity, and a large amount of surprising behavior, but while your code-base doesn't extend past a few hundred lines of code, you often will not mind or care.
> However, Javascript is not an easy language to work in at scale: when your code-base extends to thousands, tens or hundreds of thousands of lines of code. The un-typed nature of the language, which is fine for small applications, becomes an issue when you are mainly working with code that you did not write.
 
10:17 AM
I had no luck with google.. Can I somehow return an array as the result of a Constructor Call and then keep the prototype functions? Because right now the prototype functions seem to vanish when I return an array from the constructor.
 
@BartekBanachewicz I wouldn't say JavaScript is verbose (unless you put in that bag the asynchronicity management)
 
@dystroy I'd say it's somewhere in the middle.
It's a tad shorter than say java because you don't have to write type annotations and all that, but it's far behind functional languages
 
There's no possible comparison with java on verbosity. It's a magnitude order.
 
yeah, I agree that java is absurd in that regard
 
10:22 AM
@dystroy ES6 solves this issue
@BartekBanachewicz really? do you have an example?
 
@FlorianMargaine every single one with operator sections, partial application and composition
because that's what you mostly do, incidentally. Get data, process it, return results.
 
@Schoening That's actually simple. For example one of mine:
 
@BartekBanachewicz example?
 
'use strict';

/**
 * Represents the model.
 * @class
 */
function AlertResponse() {}

AlertResponse.prototype = [];

/**
 * Convert the document to a model instance.
 * @param {!Object} document
 * @return {!AlertResponse}
 */
AlertResponse.fromDocument = function (document) {
    var response = new AlertResponse();
    [].concat(document.alert).forEach(function (alert) {
        response.push(alert);
    });
    return response;
};

module.exports = AlertResponse;
^ There you go. Prototype to [] and then add more stuff.
 
Oh! That's neat!
Thx
 
10:26 AM
head . map fn . filter (>3) $ xs
  where fn = isEven . (+1)
@FlorianMargaine dunno, something like that
you need to use parens on every call in JS, obviously
 
head(xs).filter(supThree).map(fn).filter(isEven);
you mean this is verbose? ^
 
@FlorianMargaine that's backwards
 
yeah well, excuse my haskell lack of knowledge :P
 
@FlorianMargaine where's supThree
 
x => x>3
not terrible to insert anyway
 
10:28 AM
^
 
all in the details vOv
 
head(xs).filter(x => x > 3).map(fn).filter(x => x % 2);
 
head =<< map fn =<< filter (>3) $ xs
  where fn = isEven . (+1)
 
@BartekBanachewicz lol, bs of the bay :D
 
I don't agree with that quote at all. Except perhaps that typeless can be annoying at times, but often, is not.
 
10:30 AM
@RoelvanUden that's enough for me.
 
hi
 
@BenjaminGruenbaum oh well, i suppose YMMV
 
I get what @BartekBanachewicz is saying here, especially since Haskell powers all the world's large scale applications since it has such a wow typesystem.
Because that's what languages are all about a typesystem - not being able to express yourself of creating a mental model that makes sense for programmers.
 
oh right, Ben is in the trolling mode again.
hi ben
how's weather
 
Of course we as people don't think of things as state - state is not natural - we don't have things that change in life. Instead - we think of things as a series of functional transformations - that's much easier.
 
10:31 AM
@BenjaminGruenbaum Miaou now runs on iojs and I saw no downside
 
When I go get a cup of tea I'm not thinking "Hey, I'm gonna make some tea", that's stupid and corporate enterprise BS. Instead I think "I'm going to perform a transformation on the world from the world exactly as it is to the world in some other state only me making tea in it".
 
Making tea is in fact conceptually a sequence of transformations on the world. State is controlled and explicit - just like I love it. Way easier to reason about :D
 
I'd expect someone less experienced shoot out cliche's like this, not you
 
shots fired
 
10:33 AM
Damn, @BenjaminGruenbaum starts to be as unfair as @BartekBanachewicz...
3
 
Yet I shoot them just fine - functional programming very often makes for a more complicated mental model which is why although it has been available for as long as imperative programming, and more marketing effort was put into it at various points in history - most people are not doing it.
 
this is better
 
See, if a program makes me think where an alternative program could have been obvious - it's a fail.
 
I'd much rather inherit a project from @Benji than @Bartek
 
@dystroy this is still an overgeneralized blanket statement.
but yeah, perhaps it's getting there
 
10:34 AM
@BartekBanachewicz yes, of course it is. I'm not hating on you @BartekBanachewicz nor am I trolling you here. I'm answering a blanket statement with a blanket statement.
 
I just cited an article.
And you felt compelled to start an anti FP tirade already
get it together, dude.
 
> tirade
 
I'm not anti FP, I think I use it than most developers.
> Haskell is stupid since Haskell code is written by idiots such as @BartekBanachewicz and @BenjaminGruenbaum
^ just quoting, so I get to say anything I want :D
Software is hard, software design is hard and most importantly writing software isn't a black vs. white problem.
 
@BenjaminGruenbaum Is that really a citation ? Did I miss some fun ?
 
@BenjaminGruenbaum my point exactly
I am kinda realizing why people aren't much inclined to try/get into FP
 
@dystroy uhh... sure :P It was said by SPJ or something :D
@BartekBanachewicz hint: it's not because they're stupid or bad developers.
 
no, of course not.
 
Ok, you have my attention - why do you think it is then?
 
@BartekBanachewicz Be careful where you tread. You now have @BenjaminGruenbaum's attention.
 
Plus we both know that one of the reasons you come here is that I argue aggressively when you argue aggressively - it's funner and makes for interesting discussion.
 
10:40 AM
@BenjaminGruenbaum it's because FP might not have an obvious appeal to people who already have the world sorted. If you start with tea-making as an algorithm, then move to software design as an imperative change over mutable state... everything else feels weird. I'd say the better you are at OOP/imperative programming, the louder will the crack be when you start to understand FP concepts.
Which is precisely why I think teaching FP to beginners is important. At least the basics.
As for large-scale design, there are development methodologies in imperative programming for absurdly large-scale systems that work. FP isn't a silver bullet; it just has different tradeoffs when you reach that scale.
 
Is anyone going to want to be a programmer when they get taught FP?
 
@BartekBanachewicz also, mutable state is how the outside world works - it's an easier mental model very often.
 
I'd certainly not have started. It's now, 10 years later, that I have mild interest.
 
@RoelvanUden have you read Dijkstra's paper on that?
 
@BartekBanachewicz "paper on that" pfft, are you talking about that letter on hating Java?
His point there is that he wants to teach FP because students already know imperative programming when they come to the university, and that Java is bad.
I like Haskell and dislike Java but I wouldn't try to teach Haskell as a first language again.
 
10:44 AM
holy fuck this room still exists
 
@OctavianDamiean HOLY FUCK YOU STILL EXIST 2.9
 
@BenjaminGruenbaum I would.
 
@OctavianDamiean hey bro!
Wassup?
 
HAI Y'ALL
 
10:44 AM
@BenjaminGruenbaum and it's a harder model quite often enough too
 
not much, I kind of remembered there should be a room full of web nerds like me on SO
so I thought I might as well say hello
 
@BartekBanachewicz that's nice, try it sometime. A lot of schools would love to have you for 3 hours a week teaching kids programming. I dare you to try Python as a first language in one class and Haskell in another and see how many students you have after a month in the Haskell class.
@OctavianDamiean stick around :D
 
tab pinned
 
@BenjaminGruenbaum I'd love to do that if I were given such an opportunity
 
now my browser will remember this room exists
 
10:46 AM
@BartekBanachewicz go grab it. Seriously, they'd love to have you.
 
I don't know. I don't have a BEng yet
 
@BartekBanachewicz Pft, noob. (Sorry, I couldn't resist)
 
@OctavianDamiean honeyyy 2.9
 
@FlorianMargaine hey sexy! 2.9
 
@GNi33 come back
 
10:47 AM
@RoelvanUden don't worry, I don't care about that that much. It's slowly progressing. That's it.
 
how's life
 
wife's pregnant
 
oh wow! congratulations man!
 
thanks
are you pregnant too?
 
never not
 
10:48 AM
@FlorianMargaine lol
 
@OctavianDamiean doh
 
@BartekBanachewicz I like FP and I like type systems. I just don't think the lack of typesystems really limits JS that much nor do I think that the imperative languages are inferior. In fact I usually much rather have a language that does both like Scala than a language that does one like Haskell or C.
 
in fact being pregnant is one of my new hobbies
 
@OctavianDamiean still gaming a lot?
 
@BenjaminGruenbaum I gave F# a fair try and it was very confusing
 
10:49 AM
yup, still doing lots of internet spaceships
 
@BartekBanachewicz I like F# but I can see why it'd be confusing.
In practice for almost everything C# does a good job and it plays nice with F# so that's also pretty nice.
Also, learning FP is a lot less important than learning a lot of other stuff too many programmers don't know :D
 
@BenjaminGruenbaum In case noone mentioned it yet, the German translation of tipranks.com is not good
 
With the new C# features there is less reason to do F#, too.
 
@RoelvanUden less != 0
 
@OliverSalzburg Oh? It's more of an experiment but what's wrong about it?
 
10:52 AM
@BartekBanachewicz Is masochism a reason?
 
@BenjaminGruenbaum it's just Haskell programs are sooo easy to read. No value semantics. No ownership. Just simple values.
@RoelvanUden how about ADTs and monads
 
@BenjaminGruenbaum A lot of the words being used are not a good fit and sometimes English words are mixed in inappropriately
 
@BartekBanachewicz didn't he just say masochism?
 
there's nothing masochistic about ADTs
 
@BartekBanachewicz I tried it once on people with no programming experience.
 
10:53 AM
I see you're not defending monads :)
 
Guess what they understood.
 
@BenjaminGruenbaum cough
 
@BenjaminGruenbaum haskell?
 
@FlorianMargaine monads are extremely powerful, but often you don't need that power. You just want to print inside your logic and that's fine.
 
@OliverSalzburg will look into it. Can we send you an email about it?
 
10:54 AM
but if you're actually structuring the code, they're much more flexible than objects in OOP
 
@BenjaminGruenbaum Sure
 
and combine much easier
 
@OliverSalzburg can you send me your email at benji at tipranks dot com?
I might have it from earlier
 
@BartekBanachewicz What's a really good reason to learn FP and use it in the real world? What would warrant the investment of time for an entire team to abandon their regular OOP programming practices and start doing FP? Is there anything that really benefits at all, or is it a shiny new toy?
 
10:56 AM
@BartekBanachewicz yes, but I don't see the big point in that for most things.
 
@RoelvanUden The first mistake you're making is assuming you have to completely abandon OOP in order to use FP.
First, there are some problems that are much better solved with OOP than with FP, at least given our current knowledge, state of libraries etc.
Second, a huge majority of modern OOP languages has idiomatic FP language features
you might not even notice you're using them
 
yeah, like monads
 
promises~
 
promises are OOP?
 
promises ~are~ monads :)
 
10:59 AM
yes, but JS is pretty FP oriented. You were saying that FP features are in OOP... but promises are not OOP
 
Sure promises are oop - encapsulate state in objects.
 
@FlorianMargaine FP features are in OOP languages
 
@BartekBanachewicz So again, why switch to a purely functional language when their good points are making their way into our beloved easy-to-comprehend languages? E.g. some good parts of F# are soon making their way into C#, too (e.g. super simple immutability). What reason would I have to ever use F#
 
@BartekBanachewicz oh, nobody is denying that.
 
11:01 AM
The only functional things in promises is .then - if you remove that and get a Java future you can get that's just oop
 
what are FPs?
 
Functional Programming
 
oh
le derp
 
@OctavianDamiean still doing android at work?
 
more or less yea
 
11:02 AM
@RoelvanUden Say, you've already realized that at least some of Haskell/ML ideas are OK (F# is basically haskell). Now, the more you start using those features, the more limitations you'll encounter. First and foremost, the FP features are never the most important thing. Abstractions break and so on. FP languages are centered around those functions. They make much more optimizations with immutability and allow you to write even terser and more natural FP code without the limitations impos..
ed by the need for OOP support.
So F# is simply a different tradeof than C#.
Agda,Coq ----- Idris ------ Haskell ------ F# ---------- C# ----- C++ -------- Java ------ C
(arbitrary scale)
 
where's lisp in there? :P
 
Somewhere between Idris and Haskell?
 
meh
oh btw
 
Welp, the scale is bad.
 
I was wondering
 
11:04 AM
So.. I should just wait for the good points to come to C# instead of trying to break my head to get my business to run on FP languages. Got it. That made sense. :-P
 
@RoelvanUden Remember that good parts from C# also come back to functional languages. Also C# will never get the every possible goodie. It cherry-picks what makes sense for that particular language.
 
if you have 2 unrelated functions to run one after one, in haskell, how do you do that?
 
@FlorianMargaine why would the first function run if they're unrelated?
It would be a noop
 
@BenjaminGruenbaum they're both initializing different parts of an application, for example
 
@FlorianMargaine so the first one would get the app and returned a transformed one, the second would get that as input and transform it further
 
11:06 AM
@FlorianMargaine unrelated. sequenced - pick one
 
@BenjaminGruenbaum not necessarily
 
if there's a need for the 2nd one to be run after the first one, there's a dependency
so they aren't unrelated.
 
^ that, basically.
 
it doesn't need to
it's just that both need to run
 
well it can't be maybe related
we're not doing quantum physics :D
 
11:09 AM
@RoelvanUden there's one more thing though
@FlorianMargaine so just evaluate both. The order is unspecified then.
 
@FlorianMargaine what's going on?
 
@BartekBanachewicz ok. How do you write that?
 
@OctavianDamiean BRO! long time no see :)
 
@GNi33 your honey's back
 
@GNi33 BROOOO!
 
11:09 AM
sweet
 
@FlorianMargaine do { a; b } . but wait
 
@OctavianDamiean how are you doing?
 
@FlorianMargaine I think that kinda depends on the context though
 
@BartekBanachewicz and for sequenced?
(although the second doesn't need the return value of the first)
 
11:11 AM
seq
 
example?
 
or bang patterns.
@FlorianMargaine a `seq` b
 
ok
it's the hip way to write: a(); b();?
 
it's... welp.
It's all because of lazy evaluation, of course
 
ok
thanks
sorry about the "hip", didn't mean to denigrate haskell's way
 
11:13 AM
nah it's fine
to understand it better you need to desugar do
do { a; b } === a >> b
do { x <- a; b x } === a >>= \x -> b x
 
what does >> mean?
 
that's monadic sequencing
 
and in english?
 
> Sequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in imperative languages.
 
11:15 AM
@FlorianMargaine monads abstract a semicolon.
 
but >> doesn't necessarily mean a will be evaluated before b
if b has a monadic dependency on the result of a, I think it will have to be done that way though
 
alright
you cleared my doubts, thank you
off for lunch now :)
 
@GNi33 I'm doing fairly good, how are you?
 
> Even in monadic code, data dependence is the only thing which determines if and when an expression gets evaluated. Although the order of monadic actions affects a program-- it determines the order in which the monadic operations are performed and in which variables are brought into scope-- it does not determine the order in which expressions get evaluated.
 
good, good. Started hitting the gym 3 times a week, finally finished work on the apartment, job is good, some nice freelancing side-projects coming up and right now I'm wondering about where to go for a longer holiday this year
 
11:20 AM
nuice
 
the only thing that I can't get into a regular habit right now is playing guitar, working on that
I'll probably try the giveit100.com approach for singing and that
and stop smoking... again :D
 
11:38 AM
!!nudge 10
 
@SecondRikudo Nudge #1 registered.
 
Hi I need a help
 
@Vishnu 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.
 
@Vishnu just one help or more helps
 
I want to record audio using mediastream in javascript
recording button would be a toggle button for both record and stop
 
11:43 AM
HAMMERTIME!
 
ok guys
 
@SecondRikudo nudge
 
12:10 PM
@OctavianDamiean BROOOOO
 
1 message moved to Trash
vamps will not be tolerated here.
 
12:33 PM
Wow, accept in under a minute stackoverflow.com/a/28088881/1348195
Personal record, probably.
 
12:46 PM
Why is Caprica trolling, can we make her stop
 
HAMMERTIME!
 
@BenjaminGruenbaum Normally OP must wait a few minutes before he can accept an answer. Did that change ?
 
@dystroy only if the question is new
 
@BenjaminGruenbaum oh, ok
 
I wish in chrome dev tools you could favourite a source file
annoying when you have a nested folder stucture, and have to hunt when you want to debug a file
 
12:50 PM
@CapricaSix lol
 
who wrote the Caprica Six bot?
 
she was given to us
by aliens
 
@SuperUberDuper @Zirak did
 
so he has a server running somewhere
 
When he was lonely on Christmas Eve
 
12:53 PM
screen scraping
 
@SuperUberDuper rlemon runs the bot now
 
how does SO allow it?
@CapricaSix howdy do
 
she doesn't appear to like you
 
!!help
 
@Jonathan Information on interacting with me can be found at this page
 

« first day (1559 days earlier)      last day (3390 days later) »