These are chat archives for mithriljs/mithril.js

5th
Apr 2016
khades
@khades
Apr 05 2016 01:48
i dont understand reason of using bind/apply in stateless components to pass callbacks into stateless view-components
can someone explain me why it is neccecary?
khades
@khades
Apr 05 2016 01:56
as is
as it described in "Aggregation of responsibility" part of Components doc
Isiah Meadows
@isiahmeadows
Apr 05 2016 02:02
Mithril generally doesn't call event handlers with the this you want (it defaults to what the DOM gives you, IIRC), and JavaScript doesn't automatically bind methods, so you have to bind it by either creating a closure for this or the value you need, or using bind/call/apply.
khades
@khades
Apr 05 2016 02:04
ye, "this" doesnt work, but will ctrl.function work in that case?
    this.save = function(contact) {           Contact.save(contact).then(update.bind(this))        }.bind(this)
this example is really hard to understand for me
probably mostly cause it is in construction-like function that calls itself on "this.save"
ah i see
i forcefully bind "this" context and then i can easily call this function from "ctrl" argument passed
Isiah Meadows
@isiahmeadows
Apr 05 2016 02:21

First, I'll reformat it so it's a little more readable on Gitter (I also renamed the outer function):

controller: function controller() {
    // stuff...
    this.save = function(contact) {
        Contact.save(contact).then(controller.bind(this))
    }.bind(this)
}

What it's doing is first binding save to the controller instance, and then when save is called, it saves the contact, but then calls the wrapper again with the current controller to reset the controller state.

IMHO it's inefficient (I'd just reset the list directly), but it works.

khades
@khades
Apr 05 2016 02:27
ye, that case is kinda artificial
but in m.component doc there's statement about stateless\statefull components, and i am having one statefull component with several stateless components attached to it
i really have no idea why should i reset controller state
really unclear for me lifetime of objects for mitrhil.js
Isiah Meadows
@isiahmeadows
Apr 05 2016 02:37
It really depends on your use case, and you may not even need to reset it.
khades
@khades
Apr 05 2016 02:38
i have really no idea why should i reset a statefull controller, really
Isiah Meadows
@isiahmeadows
Apr 05 2016 02:39
As for lifetimes, consider route changes and any time the node's parent is removed as times when your controllers are reinstantiated. If you have something like a form reset button, that's when you'll need to reset the controller.
khades
@khades
Apr 05 2016 02:40
form reset button. i would really like just to recreate object in that case
well in case i write function for a .controller that would be the same, yeah
Isiah Meadows
@isiahmeadows
Apr 05 2016 02:43
I would just create a reset function that resets what state needs reset.
khades
@khades
Apr 05 2016 02:43
ye, that's what i mean, external function
js have too many ways to do one thing, sometimes
i mean about that case, defining function while defining function
controller: function update() 
thanks for answers, it is much more clear to me right now :D
khades
@khades
Apr 05 2016 03:03
eh, what's simpliest way to do a view-model in object component, and not singleton?
khades
@khades
Apr 05 2016 03:08
ye, i see solution
khades
@khades
Apr 05 2016 03:27
and now i completely understand "this" and "bind"
cause i made currying function that used "this"
and it didnt worked
An
@kcjpop
Apr 05 2016 06:54
@ArthurClemens thanks for the indentation, works great and saved me a lot of time : )
khades
@khades
Apr 05 2016 07:02
why do people love bootstrap so much?
sigh
Barney Carroll
@barneycarroll
Apr 05 2016 07:13
@khades because it manages to make bloated UI look minimalist
Evgeniy Labutin
@LabEG
Apr 05 2016 07:27
@isiahmeadows can you add mithril.d.ts to typings in package? and not ignore him on publcish in npm? =)
https://github.com/LabEG/is.js - my fork of is.js, converted to typescript, for check types in runtime on deserialization
Evgeniy Labutin
@LabEG
Apr 05 2016 08:31
dontwork
@dontwork
Apr 05 2016 08:44
dontwork
@dontwork
Apr 05 2016 09:09
http://npmcharts.com/compare/vue,mithril what happened to vue on march 15th?
thats what we need
James Forbes
@JAForbes
Apr 05 2016 09:09

@isiahmeadows bluebird is great, I use it everywhere.

I agree with @WreckedAvent though about the naming. It's fascinating to read the thread where they made the wrong decision. promises-aplus/promises-spec#94

khades
@khades
Apr 05 2016 09:28
vue became a buzzword
Dominik Dumaine
@Bondifrench
Apr 05 2016 10:38
@khades check v1.0.18 perf improvement + use of immutable data
Isiah Meadows
@isiahmeadows
Apr 05 2016 11:48
@LabEG Go ahead and send a PR.
Isiah Meadows
@isiahmeadows
Apr 05 2016 12:02
@JAForbes I agree with the pragmatic choice of not separating the two. In Haskell, there's a reason why you have both map and mapM. One uses a -> a for the map function, and the other uses a -> m a. And in my 9
And in my opinion, the two should really just be overloaded, but Haskell doesn't allow that.
Sadly, most more pure functional languages don't.
Hitesh Joshi
@hiteshjoshi
Apr 05 2016 12:18

guys, quick question for anyone who understand's mithril's core well.

Can we refresh m.route settings too? Like if I want to do something like this

m.route(mainElement, "/",routes);

And later change mainElement programatically and then reload route settings, possible?

James Forbes
@JAForbes
Apr 05 2016 12:35

@isiahmeadows I respectfully disagree. Method overloading, variadic functions, it all leads to confusing magic API's. Entropy. We end up writing different code for each new data structure. Solving the same problem, again and again.

Far too often great ideas in FP are dismissed because of pragmatism, but its a false dichotomy in many instances.

If .then was .map a lot of libraries could support many many data structures by default. e.g. m.request, could return a promise, or a future, or an observable, or a task, or a (etc etc) because they would all have the same interface.

That seems more pragmatic to me. Than naming it .then for no real reason.

I know you know this stuff @isiahmeadows, and you have your opinion in spite of this, so I'm sure you have good reasons (And I'd love to hear them).

But it just seems ridiculous to me, that they didn't listen to him in that thread, he was 100% right. And you just look at all the libraries that chose to support Fantasy land, and their great to use, but imagine if the browsers had implemented that spec instead. Imagine how much simpler our code would be.

Isiah Meadows
@isiahmeadows
Apr 05 2016 12:40
I'm not that worried about it at this point. The ship to catch this sailed a long time ago, arguably years before that bug was filed (Domenic was right in mentioning it was a little late to do much about it).
Barney Carroll
@barneycarroll
Apr 05 2016 12:41
@hiteshjoshi what are the 'settings' you're referring to?
You can modify the routes object on the fly, you can also just call m.route( root, defaultPath, hash ) again
James Forbes
@JAForbes
Apr 05 2016 12:51
@isiahmeadows fair enough
Justin
@WreckedAvent
Apr 05 2016 13:30
mapM exists in haskell because the signature is quite intimidating to new folks so they didn't want you to see a scary error when you misused map incorrectly
also, monads came pretty late into the language
Justin
@WreckedAvent
Apr 05 2016 13:37
c.f mapM :: (Monad m) => (a -> b) m a -> m b to map :: (a -> b) -> [a] -> [b]
But @JAForbes I care more about Bluebird's map having nothing to do with map over promises than I do about map and bind being combined into then
Isiah Meadows
@isiahmeadows
Apr 05 2016 14:21
My pragmatic opinion: as long as I'm npt having to type p.iterateAValueThatIsAListOfValuesOrMaybeThenablesAndResolveResultOfCallingCallback(f), I'm good.
:smile:
Justin
@WreckedAvent
Apr 05 2016 14:23
p.iterateAValueThatIsAListOfValuesOrMaybeThenablesAndResolveResultOfCallingCallbackFactoryServiceProviderBeanImpelementation(f)
I do hope the forward pipe proposal goes somewhere
Isiah Meadows
@isiahmeadows
Apr 05 2016 14:26
Yeah, as long as it doesn't require functions to be curried. That's my one condition because of performance concerns.
Justin
@WreckedAvent
Apr 05 2016 14:26
iirc the current proposal does not
if it just did what livescript did I'd be happy
[1, 2, 3, 4]
|> map _, x -> x + 2
idiomatic JS functions are very awkward for currying anyway
Isiah Meadows
@isiahmeadows
Apr 05 2016 14:29
I get what you're saying, but a counter proposal was identical to LiveScript's behavior, including the symbol itself. That doesn't work as well with JavaScript being a little more low level and similarly restrictive than people like to admit (it's no Python or Ruby).
Justin
@WreckedAvent
Apr 05 2016 14:31
A strict F#-like forward pipe wouldn't be much good due to the order of arguments in idiomatic JS functions
Isiah Meadows
@isiahmeadows
Apr 05 2016 14:31
Or more accurately, JS shares more genes with Lua and C-like languages than, say, Python.
Justin
@WreckedAvent
Apr 05 2016 14:31
livescript's has a placeholder var (_) which you can use to indicate where to stick the flowed variable
Barney Carroll
@barneycarroll
Apr 05 2016 14:32
Ramda uses _ by reference
Isiah Meadows
@isiahmeadows
Apr 05 2016 14:32
If we get virtual methods, I would prefer it just compile to a straight function call.
Barney Carroll
@barneycarroll
Apr 05 2016 14:32
TIL
Isiah Meadows
@isiahmeadows
Apr 05 2016 14:32
Lodash uses it for similar reasons.
Barney Carroll
@barneycarroll
Apr 05 2016 14:32
No it doesn't
Justin
@WreckedAvent
Apr 05 2016 14:32
lodash uses it as a namespace
Isiah Meadows
@isiahmeadows
Apr 05 2016 14:34
I mean as a placeholder in _.part and friends.
Barney Carroll
@barneycarroll
Apr 05 2016 14:35
OMG cool
Bit of a hairy overload
Justin
@WreckedAvent
Apr 05 2016 14:36
it uses it for partial application too?
Isiah Meadows
@isiahmeadows
Apr 05 2016 14:37
Yes.
Justin
@WreckedAvent
Apr 05 2016 14:37
iirc livescript uses that for that as well but I never used it much
Isiah Meadows
@isiahmeadows
Apr 05 2016 14:37
Lodash and I think Underscore also uses it.
Justin
@WreckedAvent
Apr 05 2016 14:38
add = (x, y) -> x + y
add5 = add _ 5

add5 20 // => 25
James Forbes
@JAForbes
Apr 05 2016 14:40
There's always flip too
@isiahmeadows what about... native curried functions
Justin
@WreckedAvent
Apr 05 2016 14:40
flip would be painful to use without composition
James Forbes
@JAForbes
Apr 05 2016 14:40
@WreckedAvent oh yeah, I'm saying together with the pipe
Justin
@WreckedAvent
Apr 05 2016 14:41
[1, 2, 3, 4]
|> flip(map(x -> x + 1))
actually not sure that's valid since that's partial application
James Forbes
@JAForbes
Apr 05 2016 14:43
flip(map)( x => x + 1)
Justin
@WreckedAvent
Apr 05 2016 14:44
that could work if flip curries
still seems like a bit of a square peg in JS' round hole, though
Barney Carroll
@barneycarroll
Apr 05 2016 14:51
@isiahmeadows what was your trick for duck-typing arrow functions?
Justin
@WreckedAvent
Apr 05 2016 14:53
what trick?
Barney Carroll
@barneycarroll
Apr 05 2016 14:53
That's the question I'm asking :)
James Forbes
@JAForbes
Apr 05 2016 14:53

The standard library, isn't the language. |> would fit in as a practical tool with libs

Its extremely trivial to write functions that work well with composition in es6

const map = f => list => list.map(f)

Arrow functions will make this pattern pretty common I think. I do this a lot to set up config for XHR, or for Auth in a frontend app

That map function would play nice with |>

Barney Carroll
@barneycarroll
Apr 05 2016 14:54
I thought you could infer arrow functionality by checking for a lack of prototype
James Forbes
@JAForbes
Apr 05 2016 14:54
what's so great about that map definition, is it dispatches to the types map function
Barney Carroll
@barneycarroll
Apr 05 2016 14:54
But that's not what I'm getting in Chrome ATM
James Forbes
@JAForbes
Apr 05 2016 14:54
so map(double)(Promise.resolve([1,2,3])) would work great
(if it was a bluebird promise)
Justin
@WreckedAvent
Apr 05 2016 14:55
the bluebird resolve maps over arrays now?
incoherent grumbling
James Forbes
@JAForbes
Apr 05 2016 14:58
Fine...
map(double)(Future.resolve(1))
point still stands
Barney Carroll
@barneycarroll
Apr 05 2016 14:58
I was positive there was a way of determining whether an entity was an arrow externally without executing it
James Forbes
@JAForbes
Apr 05 2016 14:58
I meant Future.of dammnit
Justin
@WreckedAvent
Apr 05 2016 14:58
Promise.resolve (the actual implementation) takes whatever you gives it and wraps it into a promse
ie, it's return
Barney Carroll
@barneycarroll
Apr 05 2016 14:59
@JAForbes Edit button! ('…' on the right when you hover over a post)
James Forbes
@JAForbes
Apr 05 2016 15:00
@barneycarroll It's been greyed out for me all night, not sure why
@WreckedAvent Yeah its a Promise of an array
Justin
@WreckedAvent
Apr 05 2016 15:01
oh, I didn't see the map at the start
James Forbes
@JAForbes
Apr 05 2016 15:01
Behold: ENTROPY
Promise.map(
    Iterable<any>|Promise<Iterable<any>> input,
    function(any item, int index, int length) mapper,
    [Object {concurrency: int=Infinity} options]
) -> Promise
Barney Carroll
@barneycarroll
Apr 05 2016 15:01
@isiahmeadows got it, just had a reference problem
Justin
@WreckedAvent
Apr 05 2016 15:02
I'm not aware of any to determine whether or not you've got an arrow
James Forbes
@JAForbes
Apr 05 2016 15:02

so you can map over a Promise.all([1,2,3,4]) or a Promise.resolve([1,2,3,4]) or a

Promise.all([1,2,3,4].map(Promise.resolve))

Barney Carroll
@barneycarroll
Apr 05 2016 15:03
'prototype' in ( () => {} ) // false
'prototype' in function(){} // true
James Forbes
@JAForbes
Apr 05 2016 15:03
wow
Justin
@WreckedAvent
Apr 05 2016 15:03
is that... part of the spec?
@JAForbes [1, 2, 3, 4].map(Promise.resolve)
James Forbes
@JAForbes
Apr 05 2016 15:05

Yeah [1,2,3,4].map(Promise.resolve)

[Promise.resolve(1), Promise.resolve(2), Promise.resolve(3), Promise.resolve(4)]

I have no idea if it works with A+

Justin
@WreckedAvent
Apr 05 2016 15:06
A+ doesn't cover static helper methods
Barney Carroll
@barneycarroll
Apr 05 2016 15:08

is that... part of the spec?

That's not a 10 minute answer :)

James Forbes
@JAForbes
Apr 05 2016 15:08
Promise = require('bluebird')
var promiseList = [1,2,3,4].map(Promise.resolve)

await Promise.all(promiseList) //=> [1,2,3,4]
Justin
@WreckedAvent
Apr 05 2016 15:09
just sounds suspiciously like some kind of weird thing that only chrome or FF would do
Barney Carroll
@barneycarroll
Apr 05 2016 15:09
Yeah I hear you
Especially as it obviously does have a prototype
Justin
@WreckedAvent
Apr 05 2016 15:10
it makes sense from one perspective
arrow functions are not allowed to be constructors
Barney Carroll
@barneycarroll
Apr 05 2016 15:10
But then
Object.getPrototypeOf( () => {} ) === Object.getPrototypeOf( function(){} )
Justin
@WreckedAvent
Apr 05 2016 15:10
its actual prototype would be (() => {}).constructor.prototype
Barney Carroll
@barneycarroll
Apr 05 2016 15:11
Which isn't reassuring
Justin
@WreckedAvent
Apr 05 2016 15:12
I'm going to guess the not having own prop of prototype has to do with it not being a constructor, which sounds like it'd be part of the spec
Barney Carroll
@barneycarroll
Apr 05 2016 15:13
The feature I'm trying to detect is whether context can be applied
Justin
@WreckedAvent
Apr 05 2016 15:26
(function() { return this; }).bind({ thing: 'foo' }).bind({ thing: 'bar' })().thing;
> "foo"
that's not a trivial thing to do
Not even sure it's 100% possible to do reliably
Since I could just do this (if I wanted to mess with your other implementation):
var arrow = () => {};
arrow.prototype = {};

arrow.protoype;
> {}
Barney Carroll
@barneycarroll
Apr 05 2016 15:30
That screws up the sniffing in #994 then
Bummer
Justin
@WreckedAvent
Apr 05 2016 15:30
really not sure you can do much from a library perspective
other than assume the people are not trying to break your library
and doing silly things like passing around already-bound constructor functions
Barney Carroll
@barneycarroll
Apr 05 2016 15:34
Kangax says it needs to, so I assume it must be in the spec somewhere: http://kangax.github.io/compat-table/es6/#test-arrow_functions_no_prototype_property
Justin
@WreckedAvent
Apr 05 2016 15:35
it makes sense to me after I walked through it not being a constructor in my mind
But it's still an assignable prop, so it's not a bullet-proof way to detect them
Barney Carroll
@barneycarroll
Apr 05 2016 15:35
But the implementations I'm testing all allow you to set it
Yeah :/
dontwork
@dontwork
Apr 05 2016 15:35
so you see @lhorie 's code here http://lhorie.github.io/mithril-blog/piggybacking-requests-in-a-widgety-world.html ... sometimes I am expecting a model function to return something i can use .then on, so how would i be able to return the cached object and pass it to a .then function?
is this a use case for m.deferred? i havent used it
Barney Carroll
@barneycarroll
Apr 05 2016 15:37
Which part of the code, @dontwork ?
dontwork
@dontwork
Apr 05 2016 15:38
so i have background set to true in all requests
so i make my model requests in my controllers and then trigger a redraw when the data is ready
using .then
Barney Carroll
@barneycarroll
Apr 05 2016 15:38
So far so good
dontwork
@dontwork
Apr 05 2016 15:39
so i want to use lhories idea in that post but I want it to return a function i guess that i can then use .then on
i set the model data into a local variable in controllers
inside a .then callback
Barney Carroll
@barneycarroll
Apr 05 2016 15:39
You should be able to do that
dontwork
@dontwork
Apr 05 2016 15:40
how would i do this
Barney Carroll
@barneycarroll
Apr 05 2016 15:40
User.list keeps a reference to the last m.request in its cache and returns that
Am I missing something?
dontwork
@dontwork
Apr 05 2016 15:40
it keeps a reference to the last thing returned from that m.request
doesnt it
Barney Carroll
@barneycarroll
Apr 05 2016 15:41
Yes, whenever it makes a new request it assigns it to an internal cache object
The term is 'memoization'
dontwork
@dontwork
Apr 05 2016 15:41
im getting a lot of app.bundle.js:64249 Uncaught TypeError: Cannot read property 'then' of undefined
Barney Carroll
@barneycarroll
Apr 05 2016 15:41
But all the code invoking User.list() uses then
If you're returning undefined you've got deeper problems
dontwork
@dontwork
Apr 05 2016 15:42
right i mustve mucked something up
Barney Carroll
@barneycarroll
Apr 05 2016 15:43
@WreckedAvent it gets better
dontwork
@dontwork
Apr 05 2016 15:44
working
my bad
thats agreat bit of code isnt it
Barney Carroll
@barneycarroll
Apr 05 2016 15:44
( () => {} ).constructor === ( function(){} ).constructor
@dontwork yeah, memoizing Promises is essential in building complex apps
Really solid principle
dontwork
@dontwork
Apr 05 2016 15:46
so what is a simple explanation of memoizing
i have heard it a lot
Barney Carroll
@barneycarroll
Apr 05 2016 15:46
Well you could do memoization like this
dontwork
@dontwork
Apr 05 2016 15:46
its like storing state that the app is doing something
Justin
@WreckedAvent
Apr 05 2016 15:48
@barneycarroll well, why do you need to check for an arrow anyway?
Isiah Meadows
@isiahmeadows
Apr 05 2016 16:42
@WreckedAvent First, the check is actually to tell if something is constructible or not. It's useful for accepting both callable factories and constructors within stateful (or not so stateful) APIs.
ES6 classes aren't callable (well, until the call constructor proposal gets finalized), which makes detection for that occasionally necessary.
(re: "prototype" in func)
Isiah Meadows
@isiahmeadows
Apr 05 2016 16:48
I know I'm late.
Justin
@WreckedAvent
Apr 05 2016 16:56
Mithril accepts ES6 classes now?
I've always just used modules with an exported view function, rarely a controller too
import m from "mithril";
export const view = (_, { onClick }) => m('component-name', [
  m('button', { onclick: onClick })
]);
something to that effect
Barney Carroll
@barneycarroll
Apr 05 2016 17:07
When you memoize function X, you return a new function Y. By default, function Y should be invoked exactly as if it were function X. But function Y keeps an internal cache of its return values before handing them over.
If you invoke function Y with the same input twice, the second time it will simply return the cached return value.
Grant Miner
@llambda
Apr 05 2016 17:18
Pat Cavit
@tivac
Apr 05 2016 17:19
yeah angular 2 is definitely enterprise-grade
Barney Carroll
@barneycarroll
Apr 05 2016 17:33
Would anybody be interested in a Mithril debug console?
Leo Horie
@lhorie
Apr 05 2016 17:34
yes
Barney Carroll
@barneycarroll
Apr 05 2016 17:34
And if so, what would they expect it to do? Apart from being made out of mutable classes and introducing a dozen new APIs, obviously
Leo Horie
@lhorie
Apr 05 2016 17:36
the way I use debugging tools (or how I want to use them anyhow) is to help tracing stuff back from the browser to its source line of code
Barney Carroll
@barneycarroll
Apr 05 2016 17:37
I was thinking of 1) route control 2) controller instance inspector 3) draw strategy + trigger control 4) diff reports
Leo Horie
@lhorie
Apr 05 2016 17:37
ooh I want
:)
those sound great
Barney Carroll
@barneycarroll
Apr 05 2016 17:38
I've done 1 and 4 in isolation for the sake of various fiddles
Pat Cavit
@tivac
Apr 05 2016 17:38

route control

?

Barney Carroll
@barneycarroll
Apr 05 2016 17:39
A glorified location bar that identifies params and maps back to your route map with autocompletion etc
Sounds silly but a lot of people get a bit perplexed when they first approach routing
Pat Cavit
@tivac
Apr 05 2016 17:39
huh, ok
Barney Carroll
@barneycarroll
Apr 05 2016 17:40
And it's invaluable when running a routed demo through jsfiddle / jsbin
Pat Cavit
@tivac
Apr 05 2016 17:40
Most useful things I can think of are the diff reports and finding controller instance by DOM node
Barney Carroll
@barneycarroll
Apr 05 2016 17:40
That's an excellent idea
All my plugins rely on that association anyway — it'd be excellent to get a UI for that
Cool
I'm wondering what the quickest win would be for sourcemapping
Justin
@WreckedAvent
Apr 05 2016 17:44
I'd also like some way to figure out what is triggering redraws
took me a while to fully grasp the implications of the auto-redraw being hooked up to run after handlers on things like inputs
Barney Carroll
@barneycarroll
Apr 05 2016 17:45
Chrome dev tools async call stack can help with that
Justin
@WreckedAvent
Apr 05 2016 17:45
@llambda that's hardly even the tip of it
Barney Carroll
@barneycarroll
Apr 05 2016 17:45
Ah right
Justin
@WreckedAvent
Apr 05 2016 17:45
ng2 does this awful thing of using both ES6-style modules and their own DI system
Barney Carroll
@barneycarroll
Apr 05 2016 17:45
FFS
^
Justin
@WreckedAvent
Apr 05 2016 17:45
so it's boilerplate for literally no benefit, since you're still tightly-coupled because of the ES6 imports
Barney Carroll
@barneycarroll
Apr 05 2016 17:46
Ember has a similar schizophrenia
ES6 is awesome so they advocate it for Ember 2
Justin
@WreckedAvent
Apr 05 2016 17:47
ES6 modules by and large remove any need for DI in javascript
Barney Carroll
@barneycarroll
Apr 05 2016 17:47
But then you realise you only ever import Ember — the whole API including jQuery is there
Justin
@WreckedAvent
Apr 05 2016 17:47
but even if you were to desire DI, surely the answer is not to use modules to resolve a hard-coded reference to your DI
to the things you want DI'd*
Barney Carroll
@barneycarroll
Apr 05 2016 17:48
If you want to import something of your own installation, you must prefix it with 'npm:'
Justin
@WreckedAvent
Apr 05 2016 17:48
I haven't had too much exposure to the really large/opinionated stacks outside of angular 1
Barney Carroll
@barneycarroll
Apr 05 2016 17:48
Of course, this isn't too address their mutation of native prototypes
Oh and all the front end stuff is available globally anyway
Justin
@WreckedAvent
Apr 05 2016 17:49
angular 2 also had to write their own HTML parser
because they wanted camelCase inside of HTML
because why have standards, really
Barney Carroll
@barneycarroll
Apr 05 2016 17:51
Oh I forgot. They have their own DI too. In fact 90% of core operations are expressed through custom string-based DSLs
Justin
@WreckedAvent
Apr 05 2016 17:52
so yeah I'm all grumbly about ng2 and the inevitable support it will have due to just name recognition
Barney Carroll
@barneycarroll
Apr 05 2016 17:52
I haven't had a look at ng2's view stuff yet
Justin
@WreckedAvent
Apr 05 2016 17:52
It's ng1 with custom non-validating html syntax
Barney Carroll
@barneycarroll
Apr 05 2016 17:52
I just remember it made @LabEG very angry
Justin
@WreckedAvent
Apr 05 2016 17:52
with good frickin' reason
<component [(model)]="something" ></component"
Barney Carroll
@barneycarroll
Apr 05 2016 17:53
No FFS
Justin
@WreckedAvent
Apr 05 2016 17:54
they spent so much effort and energy to get a worse debugging experience than if you were just to write your views in javascript
Barney Carroll
@barneycarroll
Apr 05 2016 17:54
JSX showed you could — if you thought really hard about it and didn't get carried away with bullshit API surface — get the desirable aspects of structured XML without escaping Javascript
You know that language with references and functions etc
Justin
@WreckedAvent
Apr 05 2016 17:55
without inventing your own bullshit language thing to sit on top of HTML
Barney Carroll
@barneycarroll
Apr 05 2016 17:55
Don't get me started
Ember views fail silently and have such poor logic controls it's impossible to even conceive of ambitious UI with them
But when you do get runtime errors (oh and you will because of their ludicrous reference-by-string dogma), the stack trace goes 100s of functions deep
Justin
@WreckedAvent
Apr 05 2016 17:57
reference by string sounds like PHP
Barney Carroll
@barneycarroll
Apr 05 2016 17:57
Most of the time it is impossible to work out what part of your source code could have caused it
Because anything remotely resembling your reference points is too far up the stack trace to make it into the error log
Pat Cavit
@tivac
Apr 05 2016 17:58

handlebars, not even once

harumph

Justin
@WreckedAvent
Apr 05 2016 18:00
I'm OK with a lot of the older templating languages
Knockout was really simple and didn't add that much mental overhead to a view file
probably because 90% of the action happened in binding handlers and not in some bullshit meta language
Barney Carroll
@barneycarroll
Apr 05 2016 18:01
Exactly ^
I mean, t7 is actually a decent idea
Justin
@WreckedAvent
Apr 05 2016 18:02
people did some scary witchcraft with handlebars but it's just fine if you use it a simple templating language
Barney Carroll
@barneycarroll
Apr 05 2016 18:06
The tragic thing with Ember is that so often I end up thinking ten years ago when all I had were string operations and the DOM API, this would have been trivial
Justin
@WreckedAvent
Apr 05 2016 18:06
imo the hard part of the DOM is not making things, it's tracking things
Barney Carroll
@barneycarroll
Apr 05 2016 18:07
And I struggle to reduce my intended functionality to something that maps to their circular reference API, so that it can convert it back into strings that eventually map to references and DOM APIs at huge expense
The tragedy with Ember and Angular is that they realised virtual DOM was great as an implementation technique and totally buried it under their own opaque black magic
Justin
@WreckedAvent
Apr 05 2016 18:08
lots of tragedy going on there, @barneycarroll :smile:
Barney Carroll
@barneycarroll
Apr 05 2016 18:10
And you get this insane double think
If you try and work out how Ember actions reference resolution works they end up telling you "oh yeah we still haven't documented it yet but basically it's just functions being passed around, which is a really sound principle"
Pat Cavit
@tivac
Apr 05 2016 18:11
functions are great!
I love functions!
that sounds totally fine!
Barney Carroll
@barneycarroll
Apr 05 2016 18:11
But if I can't get observe or debug those references, what's the fucking point?
Pat Cavit
@tivac
Apr 05 2016 18:12
nonono
functions are great
that sounds totally fine
Justin
@WreckedAvent
Apr 05 2016 18:12
the web is increasingly complicated ways of concatenating strings combining functions
Barney Carroll
@barneycarroll
Apr 05 2016 18:12
Not to mention computer science
Pat Cavit
@tivac
Apr 05 2016 18:12
WE COMPUTER SCIENCE'D THE SHIT OUT OF EMBER
that will never not be funny
Barney Carroll
@barneycarroll
Apr 05 2016 18:13
Who was it who was saying we needed to make our own parody framework?
Justin
@WreckedAvent
Apr 05 2016 18:13
@barneycarroll they already did that, it's called angular 2
Barney Carroll
@barneycarroll
Apr 05 2016 18:14
Because this is the thing, you go to Ember slack trying to get some answers to things that still haven't been documented
Pat Cavit
@tivac
Apr 05 2016 18:14
I prefer my trolling to be a bit more ephemeral
Justin
@WreckedAvent
Apr 05 2016 18:15
I'm allowed to be sore about angular 2, it's going to be an incursion on my professional life for at least a few years
Barney Carroll
@barneycarroll
Apr 05 2016 18:15
And if and when you get an explanation of "you're confusing APIs ABC with XYZ" you ask them what the thinking is behind it and they just get really angry, like "don't you realise how hard we worked to invent these APIs?"
It's a vanity project.
Pat Cavit
@tivac
Apr 05 2016 18:16
This is why I've been at ArenaNet for 7 years. I control a surprisingly large amount of my own destiny.
no one telling me to use stupid fucking bullshit
Barney Carroll
@barneycarroll
Apr 05 2016 18:16
The only way to get through to these poor maintainers is to show them it's trivial to write a load of indirect bollocks that distances the author from their concerns in arbitrary ways
Pat Cavit
@tivac
Apr 05 2016 18:16
I feel for ya'll, having to use a project you hate sucks
Justin
@WreckedAvent
Apr 05 2016 18:16
reminds me of the time I wasn't able to get a provider out of angular. Because of ... reasons ... I'm sure, you have to end all of your providers end with provider. so fine. I have a provider that ends in provider. But now when I want to actually use it, I need another provider at the end of it, even though it's called provider.
so... RouteServiceProviderProvider
Barney Carroll
@barneycarroll
Apr 05 2016 18:17
Haha
OOP achievement unlocked
Justin
@WreckedAvent
Apr 05 2016 18:17
at some point java came into my freaking javascript and called itself angular. grumbling
Barney Carroll
@barneycarroll
Apr 05 2016 18:18
"Oh shit this API's entire rationale is circular"
"Don't worry we'll just bake that circularity into the public method reference"
That way you can't put it back to the user
Justin
@WreckedAvent
Apr 05 2016 18:19
@tivac it's more than that. I work for a lot of companies that don't have particularly strong JS developers. Angular is pretty much one of the only responsible decisions to make when choosing a framework like that in that situation, since you can throw a stone and hit angular devs now.
Pat Cavit
@tivac
Apr 05 2016 18:20
Yeah, stories like yours are a big part of why I work fulltime somewhere with a relatively stable team of programmers I hired that all know JS
that's literally my biggest hiring criteria
Barney Carroll
@barneycarroll
Apr 05 2016 18:21
If I were to write an OOP framework it would definitely have a ServiceManagerDispatcher class. That will tie users up in cognitive feedback loops long enough for their project to fail catastrophically before asking me WTF I was thinking
Justin
@WreckedAvent
Apr 05 2016 18:21
mmm, dunno.
Barney Carroll
@barneycarroll
Apr 05 2016 18:22
And at that point they'll need to pretend they think it makes some degree of sense in order to salvage their professional reputation
Justin
@WreckedAvent
Apr 05 2016 18:22
ServiceManagerDispatcherFactoryBeanServiceImplementationFactoryProvider
that sounds much more reasonable to me
Barney Carroll
@barneycarroll
Apr 05 2016 18:23
The thing with throwing stones and hitting Angular developers…
I mean what is an Angular developer?
Somebody who really understands how Providers work internally?
How does that translate to project velocity?
What user stories does that address?
If an Ember dev is really good, they'll know how to solve all the Ember related problems we have
Leo Horie
@lhorie
Apr 05 2016 18:25
around here "Angular developer" is a slang for "pay me 20k more"
Justin
@WreckedAvent
Apr 05 2016 18:26
angular developer to me is someone who knows enough about angular to not use $scope unless absolutely necessary and only sticks to one of the stupid factory provider things instead of attempting to use all three
or four, or ten, however many are in 1.5 now
But the problem is if you look for angular developers, you get people who have only done angular
Who have no perspective of anything else
and it's a double-clawed-hammer-PHP situation
Leo Horie
@lhorie
Apr 05 2016 18:28
really? That kind of people exist?
Justin
@WreckedAvent
Apr 05 2016 18:28
which kind
Leo Horie
@lhorie
Apr 05 2016 18:29
Usually I find that angular devs are so-so devs that decided to pad their resume by trying to use it for their first time in some company random project without even evaluating it
kind = people who only have done angular
Barney Carroll
@barneycarroll
Apr 05 2016 18:29
The fundamental contradiction with the economy created by Ember and Angular is that they set out to make the bare basics of web app boilerplate easier to grok for people who had no stomach for the complexities of DOM / JS / HTTP etc
Justin
@WreckedAvent
Apr 05 2016 18:29
Angular was tremendously hot for a few years
So yes, for a little while at least it was perfectly easy to find people who had only touched angular
They didn't know javascript or HTML, they knew angular
Barney Carroll
@barneycarroll
Apr 05 2016 18:30
But then they started marketing themselves as ways of mastering ambitious web app development
Leo Horie
@lhorie
Apr 05 2016 18:30
wow, that's scary x_x @WreckedAvent
Justin
@WreckedAvent
Apr 05 2016 18:30
the kind of people who could make your app "webscale"
That's the danger with tremendously huge and opinionated libraries
Barney Carroll
@barneycarroll
Apr 05 2016 18:31
And that's when you enter bullshit territory
Justin
@WreckedAvent
Apr 05 2016 18:31
I do a lot of .NET stuff and there's a lot of people who have only done database stuff through Entity Framework (a popular opinionated DB ORM)
Barney Carroll
@barneycarroll
Apr 05 2016 18:31
They are incredibly useful for internal politics in large organisations that don't respect developers though
Justin
@WreckedAvent
Apr 05 2016 18:31
so a lot of .NET devs can't even conceptualize database transactions without thinking of it like objects
Barney Carroll
@barneycarroll
Apr 05 2016 18:32
And then you have 2 problems
Justin
@WreckedAvent
Apr 05 2016 18:32
but, otoh
Something like angular means people who don't otherwise work on JS can
since they don't need to know the DOM or HTML or anything like that.
They just need to know to stick something on $scope and then do {{wee}} and their stuff appears on the screen. Magic.
Barney Carroll
@barneycarroll
Apr 05 2016 18:33
The target audience was people who couldn't grok database interaction. In order to grow you need to say those same people now understand complex inter-environment transaction logic
Go back to point 1 and say hi to SQL if you see it
Justin
@WreckedAvent
Apr 05 2016 18:34
Hell, angular even has its own module system built right in so you don't even need to invite "javascript fatigue" in setting up a module builder
Just slap angular on it and organize all of your code through angular, job's a goodn'
Barney Carroll
@barneycarroll
Apr 05 2016 18:35
@WreckedAvent and that's great if you need to get values persisted to screen for a form-based application but don't get this or why select elements are inconsistent with their event model
But then you start saying that this is the only way to go if you want a complex web app
And the bottom falls out
Justin
@WreckedAvent
Apr 05 2016 18:36
so it's a love-hate relationship with me
I don't like almost anything about angular, but I sure do like non-JS folk being able to do stuff in JS without getting upset because angular does all of the heavy lifting
Barney Carroll
@barneycarroll
Apr 05 2016 18:36
Because the original problem was your target audience didn't have the attention span to look up long established but nevertheless complex at scale APIs when all they wanted to do was make this stupid form work
Justin
@WreckedAvent
Apr 05 2016 18:37
With typescript I don't even hear the griping about javascript being unsafe or too loose or anything, either
well, angular has always been an "MVP" framework
It comes with absolutely everything you need to make an MVP site out of the box
Barney Carroll
@barneycarroll
Apr 05 2016 18:38
And now you're having your cake and eating it by saying the same principles will allow you to make those people grok a whole slew of necessarily complicated interoperation concerns with a huge API surface
Only this time, you're writing all of that yourself, and it has to tie up with the original premise
Justin
@WreckedAvent
Apr 05 2016 18:38
and it has a wonderful 80/20 rule going on. You can get 80% of what you'd want for 20% of the effort ... until you want that last 20%
Barney Carroll
@barneycarroll
Apr 05 2016 18:38
Right
It's absolutely great for chucking out very simple crud
Leo Horie
@lhorie
Apr 05 2016 18:40
so... anyone think I'd get kik'ed if I called dibs on this? https://www.npmjs.com/package/angular3
Barney Carroll
@barneycarroll
Apr 05 2016 18:40
I have a friend from school who went on to do database and Python stuff, now runs his own software consultancy in a captive niche industry market
Pat Cavit
@tivac
Apr 05 2016 18:40
I personally think it'd be funny but look real bad, @lhorie
Barney Carroll
@barneycarroll
Apr 05 2016 18:41
He absolutely adored Angular and Bootstrap because all his "I just want a form and I don't want to have to deal with these ludicrous DOM / JS APIs"
Leo Horie
@lhorie
Apr 05 2016 18:42
@tivac yeah, it'd be as a joke, obviously
Barney Carroll
@barneycarroll
Apr 05 2016 18:42
But then when the pitches have sold people on the basis of getting to tractable crud interfaces, you have to deal with delivering complex UX
Leo Horie
@lhorie
Apr 05 2016 18:43
maybe I could do my own take on a "angular rewrite" and computer science the shit of it :)
Grant Miner
@llambda
Apr 05 2016 18:43
I like this parody framework idea lol
Barney Carroll
@barneycarroll
Apr 05 2016 18:43
He ended up asking me about this bizarre intermittent Chrome bug relating to tables
Justin
@WreckedAvent
Apr 05 2016 18:44
now now, the logic is whatever some unspecified joe sixpack would think the name is for
khades
@khades
Apr 05 2016 18:44
after angular1 i tried to start to write angular2/react app, mithril is MUCH MORE understandable
Barney Carroll
@barneycarroll
Apr 05 2016 18:44
I said I couldn't think of anything obvious, could he describe the scenario? He's writing a service transaction interface with a table displaying over 30,000 rows
Justin
@WreckedAvent
Apr 05 2016 18:44
So @lhorie , obviously you should make that package for doing angular calculations in 3d space
bootstrap and foundation are in the same boat as angular
khades
@khades
Apr 05 2016 18:45
is there any way to catch event of changing route?
Justin
@WreckedAvent
Apr 05 2016 18:45
Good for 80/20
Barney Carroll
@barneycarroll
Apr 05 2016 18:45
@lhorie don't forget to write your own half-arsed implementation of package management from the ground up. I don't think I could take Angular 3 seriously without something like that
khades
@khades
Apr 05 2016 18:46
@WreckedAvent only good thing in bootstrap is premade popovers\modals
Barney Carroll
@barneycarroll
Apr 05 2016 18:46
@WreckedAvent good for 20/80
Justin
@WreckedAvent
Apr 05 2016 18:46
how about 20/20
I mean
modal is just
Barney Carroll
@barneycarroll
Apr 05 2016 18:46
@WreckedAvent that's in hindsight right? ;P
Pat Cavit
@tivac
Apr 05 2016 18:46
@khades I think @barneycarroll has done some work around observing route changes
(yes, I'm trying to steer the conversation somewhere worthwhile)
Barney Carroll
@barneycarroll
Apr 05 2016 18:47
@khades @tivac yeah, what's the issue?
khades
@khades
Apr 05 2016 18:47
this route change observing is connected to me trying to write popover\tooltop component
Barney Carroll
@barneycarroll
Apr 05 2016 18:47
Aha
khades
@khades
Apr 05 2016 18:47
when my tooltip is active and i change route it has no event to force-close it
Barney Carroll
@barneycarroll
Apr 05 2016 18:48
Well if I were writing the app I'd have the tooltip be part of a component in the route
khades
@khades
Apr 05 2016 18:48
yes, fair enough
Barney Carroll
@barneycarroll
Apr 05 2016 18:48
When you change route, the tooltip component is no longer there, therefore it is removed
Justin
@WreckedAvent
Apr 05 2016 18:48
in angular 1 terms that'd be using something like UI router
khades
@khades
Apr 05 2016 18:48
@barneycarroll you're right
Barney Carroll
@barneycarroll
Apr 05 2016 18:49
But if you've done things differently we can still find a solution
khades
@khades
Apr 05 2016 18:49
@barneycarroll i am still trying to figure out what i really want from this tooltip component
Barney Carroll
@barneycarroll
Apr 05 2016 18:49
The thing with routes is that you should have very few things that persist outside of routes — certainly no UI
If you need UI to persist between routes, then it should be part of each route
Yeah modals are surprisingly tough
khades
@khades
Apr 05 2016 18:51
after tinkering with small css libs like purecss i will never return to bootstrap
but that forces me to write my own modals/popovers/alerts
Barney Carroll
@barneycarroll
Apr 05 2016 18:51
Unless you've got a layout that depends heavily on transforms my advice would be to instantiate tooltip components at the point at which they're triggered
Pat Cavit
@tivac
Apr 05 2016 18:52
purecss :+1: x :100:
khades
@khades
Apr 05 2016 18:52
but i still wish purecss was Sass based
previously i liked concise.css for that cause
Justin
@WreckedAvent
Apr 05 2016 18:52
poor stylus is over there with no native libs in it
khades
@khades
Apr 05 2016 18:52
but concise is not that great
Barney Carroll
@barneycarroll
Apr 05 2016 18:53
Isn't PostCSS the way to go these days?
@khades tell me about your tooltip difficulties
khades
@khades
Apr 05 2016 18:53
@barneycarroll i dont really know how should they work
Justin
@WreckedAvent
Apr 05 2016 18:53
hard to tell, there's so many opinions on how to organize css
PostCSS sits on top of whatever you're already doing with things like stylus/sass/less
Pat Cavit
@tivac
Apr 05 2016 18:54
We use a few small PostCSS plugins + CSS Modules (really modular-css but same idea)
Justin
@WreckedAvent
Apr 05 2016 18:55
@khades on a philosophical or technical level?
khades
@khades
Apr 05 2016 18:55
@WreckedAvent technical, someone likes tooltips as single component, someone likes tooltip as embeded component
Justin
@WreckedAvent
Apr 05 2016 18:55
@tivac just about every CSS convention I've heard of describes itself as modular
Pat Cavit
@tivac
Apr 05 2016 18:55
Yup, it's a terrible name
Barney Carroll
@barneycarroll
Apr 05 2016 18:56
@khades are you using ES6 or would you prefer it if I stick to ES5?
Pat Cavit
@tivac
Apr 05 2016 18:56
but it works great w/ mithril and means tiny CSS files that are guaranteed to never collide
khades
@khades
Apr 05 2016 18:56
@barneycarroll i tend to write in es5 style using functional collections/promises
even in nodejs
Barney Carroll
@barneycarroll
Apr 05 2016 18:57
Cool
Justin
@WreckedAvent
Apr 05 2016 18:57
I'm quite partial to just having mithril/other vdoms emit components like my-input and styling against that element selector
Usually most places I've been at have some kind of monster of at least two FE frameworks, with one they wrote the original product in and one they're really really trying to move next to, so it's nice to be able to have two frameworks emit similar html and have the css just work
the js-in-css people have never been able to quite articulate to me how to make things like themes work
khades
@khades
Apr 05 2016 18:58
@barneycarroll i did a mistake trying to invest some time in scala, so i know trick or two from pseudoFunctional-programming
Justin
@WreckedAvent
Apr 05 2016 18:59
scala's alright, just hideously complicated and involved
khades
@khades
Apr 05 2016 18:59
play is horrible nowadays
Justin
@WreckedAvent
Apr 05 2016 19:00
also I could really do without scala people talking about it like the second coming of jesus
khades
@khades
Apr 05 2016 19:00
i really liked rust much more
Justin
@WreckedAvent
Apr 05 2016 19:01
Anyway, for your mithril troubles you'll want something on your view which determines whether or not to show the popover
mithril has observables, you might find redux more suitable if you have a functional background
either way, some flag that says to show it or not
khades
@khades
Apr 05 2016 19:03
one of the way to do a tooltip - to move sinlge component's view to a needed element
the other - generate tooltip object for needed element
Justin
@WreckedAvent
Apr 05 2016 19:04
mithril allows you to pass arbitrary stuff to the component itself. The tooltip component could just be a very simple wrapper around whatever you pass to it that knows how to position itself
khades
@khades
Apr 05 2016 19:05
just figuring out that
there's really a need in premade popover/alert components
and modals
and i am not that great of a programmer
Justin
@WreckedAvent
Apr 05 2016 19:06

so when you consume it, you'd do something like:

m(tooltip, { content: m('p', 'I am some tooltip content'); })

then your component:

// ... 
view: function(ctrl, attrs) {
  return m('.tooltip', attrs.content); 
}
// ...
drastically simplified, but the idea is the same
khades
@khades
Apr 05 2016 19:07
there's no "onmousehover" action listener here
in 100% of cases tooltips are activated in some manner
Barney Carroll
@barneycarroll
Apr 05 2016 19:09
@khades
var tooltip = {
  view : function( ctrl, input ){
    return m( '.tooltip',
      !( input.trigger )
      ? ''
      : m( '.trigger', {
        onclick : function(){
          ctrl.on = true

          var box = this.getBoundingClientRect()

          ctrl.position = {
            left : box.right - box.left,
            top  : box.bottom - box.right
          }
        },
        input.trigger
      ),

      ( ctrl.on && input.content )
      ? ''
      : m( '.overlay', {
        onclick : function(){
          ctrl.on = false
        }
      },
        m{ '.tooltip', {
          style : {
            left : ctrl.left + 'px'
            top  : ctrl.top  + 'px'
          }
        },

        input.content
      )
    )
  }
}
khades
@khades
Apr 05 2016 19:10
input.trigger
wat
Justin
@WreckedAvent
Apr 05 2016 19:12
the second argument passed to the view function is the props you called the component with
@barneycarroll you have a { near the bottom instead of a ( after m
Barney Carroll
@barneycarroll
Apr 05 2016 19:14
Oh shit
Typing on a mobile soz
Justin
@WreckedAvent
Apr 05 2016 19:14
you typed that on a mobile? :worried:
:shipit:
Barney Carroll
@barneycarroll
Apr 05 2016 19:15
So trigger is whatever content you want to be clickable to reveal the tooltip
And it's position will determine where the tooltip content appears
Meanwhile content is whatever you want to appear when the tooltip is available
I mean 'on'
And that's all the API you need
You will need to style the overlay element such that it covers the screen
Both the overlay and the tooltip content should be absolutely positioned
khades
@khades
Apr 05 2016 19:18
ah
you create div over the element
and listen to its events instead
to be more precise, you create div to place element inside
Barney Carroll
@barneycarroll
Apr 05 2016 19:21
Yes exactly
khades
@khades
Apr 05 2016 19:21
really makes sense, yeah
Barney Carroll
@barneycarroll
Apr 05 2016 19:21
In order for the tooltip positioning to work you need fixed positioning anyway, so it ends up being a quick win
khades
@khades
Apr 05 2016 19:22
i thought i will incorporate something like tether.js
like bootstrap did
for tooltip positioning
Barney Carroll
@barneycarroll
Apr 05 2016 19:22
However if you need to display the tooltip according to external concerns, we can tweak the API to allow for that relatively easily by adding a new property to the input
Justin
@WreckedAvent
Apr 05 2016 19:23
yes, the wonderful thing about mithril and react components is they can be fairly unopinionated
Barney Carroll
@barneycarroll
Apr 05 2016 19:23
So the code in there determines the center of the trigger element on click and makes the tooltip display starting at the position
You can then use margins or transforms to offset that position according to arbitrary concerns without modifying the component much or at all
khades
@khades
Apr 05 2016 19:24
tether.js already have all the logic for positioning
also it moves tooltip automatically on scroll if it is not fit in viewable area
Barney Carroll
@barneycarroll
Apr 05 2016 19:25
@WreckedAvent the excellent thing with Mithril is you can pass in arbitrarily complex objects all over the place according to your own concerns
Fixed positioning kinda takes care of that
Alright going underground
Chat in a while
Justin
@WreckedAvent
Apr 05 2016 19:25
@khades the actual implementation can be suited to your particular needs
@barneycarroll was just offering an example implementation
khades
@khades
Apr 05 2016 19:26
ye
Barney Carroll
@barneycarroll
Apr 05 2016 19:26
// invocation
m( tooltip, {
  trigger : m( 'button', 'Click here to find out more' ),
  content : [
    m( 'h1', "It's actually a lot more complicated than that" ),
    m( 'p', 'jkz! lol ur alrite m8' )
  ]
} )
Justin
@WreckedAvent
Apr 05 2016 19:27
I'm concerned about @barneycarroll 's ability to write code on a mobile device
Barney Carroll
@barneycarroll
Apr 05 2016 19:27
I use Textastic on an iPhone 5
It's wonderful
khades
@khades
Apr 05 2016 19:28
i never could write code in phone
Barney Carroll
@barneycarroll
Apr 05 2016 19:29
Very tough ergonomics concerns for sure
But Textastic is really something else
khades
@khades
Apr 05 2016 19:29
and i dont like iphones so i cant try textastic
Barney Carroll
@barneycarroll
Apr 05 2016 19:29
Ah
Yeah
khades
@khades
Apr 05 2016 19:30
i had to setup pptp/l2tp once on iphone
Barney Carroll
@barneycarroll
Apr 05 2016 19:30
The contenders on Android were rubbish last time I had one 1 year ago
khades
@khades
Apr 05 2016 19:30
it didnt received routes no matter what i tried to do
Barney Carroll
@barneycarroll
Apr 05 2016 19:30
What do those anagrams mean?
khades
@khades
Apr 05 2016 19:30
that's VPN protocols
Justin
@WreckedAvent
Apr 05 2016 19:30
@barneycarroll most people are not possessed enough to write code on a mobile device. :smile:
Barney Carroll
@barneycarroll
Apr 05 2016 19:30
Oh god right
@WreckedAvent I've been without a personal computer for 5 months, it's kinda liberating
khades
@khades
Apr 05 2016 19:31
i am really picky about my phone anyway, i cant change my galaxy s4 mini to something else because it is so neat
Barney Carroll
@barneycarroll
Apr 05 2016 19:31
When I write code I need to think about it first
Justin
@WreckedAvent
Apr 05 2016 19:31
I have a 2-in-1 surfacebook thing, it goes with me wherever I go
Barney Carroll
@barneycarroll
Apr 05 2016 19:31
@WreckedAvent workstation contender?
Justin
@WreckedAvent
Apr 05 2016 19:32
it's my only device
err
Only dev device
Barney Carroll
@barneycarroll
Apr 05 2016 19:32
Interesting
Justin
@WreckedAvent
Apr 05 2016 19:32
BYOD for work and everything
khades
@khades
Apr 05 2016 19:32
probably i have too many pcs in my room
Barney Carroll
@barneycarroll
Apr 05 2016 19:32
I was following a blog about somebody who tried to run a dev business using only a tablet
They used a Terminal emulator and tunneled into everything so it was basically SSH + VIM with a touch keyboard
Justin
@WreckedAvent
Apr 05 2016 19:33
the funny thing is it runs better than the dreadful dell workstations people usually cram offices with
khades
@khades
Apr 05 2016 19:34
i have one fullsize pc, one zenbook, android phone, one atom-based PC for torrents, router with openwrt analog, and one android handheld
i use android stuff for connectbot for work sometimes
dont like my servers going down
Justin
@WreckedAvent
Apr 05 2016 19:34
going to be interesting when windows gets that native bash shell
khades
@khades
Apr 05 2016 19:35
@WreckedAvent for me the whole "shell" architecture is dictated not by shell interpreted itself, but by core apps
like grep/awk/vi
Justin
@WreckedAvent
Apr 05 2016 19:36
It'll download and run ubuntu binaries natively
That means grep/awk/etc
khades
@khades
Apr 05 2016 19:36
for package management i use chocolatey on windows
Justin
@WreckedAvent
Apr 05 2016 19:36
and apt-get :wink:
khades
@khades
Apr 05 2016 19:36
i dont like ubuntu
i am debian hardcore
and actually i have more linux pcs in my room than windows ones
the hardest stuff i encountered while working on windows is to set up putty/pageant/git/hg to cooperate properly
Justin
@WreckedAvent
Apr 05 2016 19:47
haven't used hg on windows
git works just fine, even through command line. Setting up ssh is a bit more effort
khades
@khades
Apr 05 2016 19:49
hg is easier to install
Justin
@WreckedAvent
Apr 05 2016 19:49
no one has articulated the value-add of hg to me past "it's an easier git"
khades
@khades
Apr 05 2016 19:49
git gives a lot of options like "install bash, apps like vi, add to context menu"
i still like HG more than git
Justin
@WreckedAvent
Apr 05 2016 19:50
well, it can install git bash, which is a bash-like shell for windows
One of the options is to add all of that to your cmd
so, quite nice of it to ask before it does that
Barney Carroll
@barneycarroll
Apr 05 2016 19:58
I prefer dealing with the git shell without it adding all that stuff to path
khades
@khades
Apr 05 2016 19:58
i just open powershell
and type git
Barney Carroll
@barneycarroll
Apr 05 2016 19:59
That way I can open up the git shell and pretend everything's OK
Justin
@WreckedAvent
Apr 05 2016 19:59
yes, powershell works just fine for most things
Barney Carroll
@barneycarroll
Apr 05 2016 19:59
Powershell is so resource intensive it's unreal
Justin
@WreckedAvent
Apr 05 2016 19:59
If you install cmdr or conemu you can even make it pretty
khades
@khades
Apr 05 2016 19:59
something like git commit -a -m "READ DIFF, NO TIME TO COMMENT THE COMMIT"; git push
Barney Carroll
@barneycarroll
Apr 05 2016 19:59
And the lack of simple operators like & && | > is just ceiling
*galling
I was using arch before my laptop died
khades
@khades
Apr 05 2016 20:01
but i want to play bf4 sometiems :<
this forces me to use windows
Barney Carroll
@barneycarroll
Apr 05 2016 20:01
Yeah well I do separation of concerns
;)
Justin
@WreckedAvent
Apr 05 2016 20:01
powershell decides to have all operators as english
not sure why, but whatever
well. almost all
There's still dot and pipe
Barney Carroll
@barneycarroll
Apr 05 2016 20:02
I have no desire to alt tab between my glossy video game indulgence and admin / programming
Plus remembering how much you've hacked your environment in Windows is a nightmare
khades
@khades
Apr 05 2016 20:03
i just reinstalled my win10
Justin
@WreckedAvent
Apr 05 2016 20:03
"hacked your environment"?
khades
@khades
Apr 05 2016 20:03
i am not trying to Hack it anymore
Barney Carroll
@barneycarroll
Apr 05 2016 20:04
Yeah just adding weird nix like stuff to make it behave
Justin
@WreckedAvent
Apr 05 2016 20:04
git bash is fine for people who are too used to *nix who are forced to use windows
but powershell is what people who are used to windows use
Barney Carroll
@barneycarroll
Apr 05 2016 20:05
With a lot of effort you can get yourself into a situation where you may as well be in nix 90% of the time
Justin
@WreckedAvent
Apr 05 2016 20:05
They said in the summer update they'll have ubuntu binaries running natively on windows
Barney Carroll
@barneycarroll
Apr 05 2016 20:07
But then when you hit those critical edge cases and try to draw insight from the community you end up trying to work out how and why your system behaves differently to the default… and it's just not work it
Yeah that'll be nice
Justin
@WreckedAvent
Apr 05 2016 20:07
it'll be interesting, at least
The devil is in the details.
I certainly won't complain about being able to run some web dev tools natively though
... or be able to use things like flow ...
khades
@khades
Apr 05 2016 20:08
all i need is git/putty/winscp/atom/nodejs/mongodb
and heidisql in some cases
Barney Carroll
@barneycarroll
Apr 05 2016 20:10
@khades you forgot hg ;)
Atom the text editor?
Justin
@WreckedAvent
Apr 05 2016 20:11
atom was still running like a pig for me last I tried it
Barney Carroll
@barneycarroll
Apr 05 2016 20:11
I don't get it personally
khades
@khades
Apr 05 2016 20:11
atom is ok
Justin
@WreckedAvent
Apr 05 2016 20:11
Artwood's law @barneycarroll
At some point we will have an operating system entirely in javascript
and the singularity will be complete
Barney Carroll
@barneycarroll
Apr 05 2016 20:12
Reading between the lines I surmise the appeal is part novelty — you can do everything using JS + DOM — and part faith in Github to provide a big community full of glitzy stuff
khades
@khades
Apr 05 2016 20:12
i use atom because it is properly set up as IDE for js
for free
Barney Carroll
@barneycarroll
Apr 05 2016 20:13
Put me in deep freeze and wake me up when you can upload my consciousness into a Javascript virtual machine
Justin
@WreckedAvent
Apr 05 2016 20:13
Most IDEs are free now?
Even visual studio is
khades
@khades
Apr 05 2016 20:13
ye, webstorm is free, yee
Barney Carroll
@barneycarroll
Apr 05 2016 20:13
I think @khades means the JS ergonomics config is free
khades
@khades
Apr 05 2016 20:13
also when comparing webstorm performance to a atom yeee
i will prefer lagging Idea product that keeps indexing everything on background
Justin
@WreckedAvent
Apr 05 2016 20:14
What about a yavascript virtual machine, @barneycarroll ?
Barney Carroll
@barneycarroll
Apr 05 2016 20:14
Where I work ATM everybody runs Sublime, but I'm the only one who can be bothered to install packages for eg syntax highlighting that works with any of our codebase
Oooh haven't seen that one
Justin
@WreckedAvent
Apr 05 2016 20:15
It's from the same guy who did the wat talk in a slightly more serious tone
Barney Carroll
@barneycarroll
Apr 05 2016 20:15
Yeah I'm a fan
Justin
@WreckedAvent
Apr 05 2016 20:15
between those two talks I've collected all of my favorite javascript wtfs
khades
@khades
Apr 05 2016 20:15
i have no money for sublime
and i am not eager to pirate stuff
Justin
@WreckedAvent
Apr 05 2016 20:16
Isn't sublime nagware?
khades
@khades
Apr 05 2016 20:16
i dont like nagwares either
Barney Carroll
@barneycarroll
Apr 05 2016 20:16
I don't have a problem paying for that
khades
@khades
Apr 05 2016 20:16
my mind is a mess
dont discuss it
Barney Carroll
@barneycarroll
Apr 05 2016 20:16
It's less than my hourly rate, I figure it's worth it
khades
@khades
Apr 05 2016 20:33
i wish i could get that money
in my dreams, in my dreams
Barney Carroll
@barneycarroll
Apr 05 2016 20:35
Where are you living @khades? If you don't mind my asking
khades
@khades
Apr 05 2016 20:35
in middle of siberia
Arthur Clemens
@ArthurClemens
Apr 05 2016 20:35
really?
khades
@khades
Apr 05 2016 20:35
they only required technoligies here are php and jquery/bootstrap
Barney Carroll
@barneycarroll
Apr 05 2016 20:35
Ah OK
khades
@khades
Apr 05 2016 20:36
and when i am trying to do something on upwork i end up making 10-15$ per hour
Barney Carroll
@barneycarroll
Apr 05 2016 20:36
Different tech economy — I live in London, one of the tiny singularities which are supposed to be indicators for the entire world, but in practice it's a crazy bubble
aucelum
@aucelum
Apr 05 2016 20:38
Rates are small for webdevs in my developing country as well. Remote work is a blessing
khades
@khades
Apr 05 2016 20:38
i end up writing a lot of code for free as hobby, instead of making money
Grant Miner
@llambda
Apr 05 2016 20:39
Not to toot my own horn, but I put the finishing touches on http://fleetspotter.com/ 1.0 real-time fleet tracking software. More real life software using Mithril!
Barney Carroll
@barneycarroll
Apr 05 2016 20:44
Where are you @aucelum?
aucelum
@aucelum
Apr 05 2016 20:45
@barneycarroll .cl
aucelum @aucelum lurks @llambda 's frontend code.
aucelum
@aucelum
Apr 05 2016 20:48
i like reading other people's code using mithril to see where they change the redraw strategy and under which circumstances they're forced to m.redraw(). Sometimes I'm uncomfortable with my own usage of redraws
khades
@khades
Apr 05 2016 20:49
Country How many Big Macs can you buy?
nice table :D
Grant Miner
@llambda
Apr 05 2016 20:51
US/West Europe/East Europe very interesting
Justin
@WreckedAvent
Apr 05 2016 20:53
the US part of it looks pretty accurate to me at least
khades
@khades
Apr 05 2016 20:54
all the bigmac stuff makes me want to eat
Justin
@WreckedAvent
Apr 05 2016 20:54
But it's kind of relative. The places where you have tech jobs in the US you also have very high standard of living/rent
Grant Miner
@llambda
Apr 05 2016 20:55
@WreckedAvent good point
khades
@khades
Apr 05 2016 20:55
ye
it is easily manageable to live here for 1k$
for month
Justin
@WreckedAvent
Apr 05 2016 20:56
meanwhile that's not even enough for my rent
khades
@khades
Apr 05 2016 20:56
1k$ is enough to buy a flat here in mortgage
1k$/month
flat itself costs 80k$
ok, i am really really hungry, i have to eat
Justin
@WreckedAvent
Apr 05 2016 21:00
The big mac index is pretty silly, but at least gives you a vague idea
aucelum
@aucelum
Apr 05 2016 21:02
Most developers prefer tabs to spaces :scream:
Justin
@WreckedAvent
Apr 05 2016 21:03
Well, @aucelum , if you like spaces, and everyone else likes tabs, the obvious answer is to compromise and use both. :wink:
aucelum
@aucelum
Apr 05 2016 22:18
Relevant: https://www.emacswiki.org/emacs/SmartTabs "tabs for indentation, spaces for alignment"
Barney Carroll
@barneycarroll
Apr 05 2016 22:24
I used to do that ^
The desired width of tabs is a display preference that can be changed by the reader / author individually without altering the code, and this is exactly what tabs are for
The whole thing is let down by VI
So now I just use spaces for everything
aucelum
@aucelum
Apr 05 2016 22:27
I liked the idea years ago. Difficult in implementation / across text editors / when collaborating. So...spaces it is
khades
@khades
Apr 05 2016 22:47
there's something like editorconfig