|
javascript is for dom manipulation, not servers
|
# ? Aug 13, 2013 21:23 |
|
|
# ? Jun 11, 2024 02:41 |
|
"the future of programming" & "node.js" two things that should never be in the same sentence. but if you ARE doing jscript stuff, coffeescript is pretty neat. i mean it's literally just shorthand that a second program takes and goes *beep boop boop beep* and turns your shorthand into regular pain-in-the-rear end javascript i mean really, which is easier code:
code:
|
# ? Aug 13, 2013 21:25 |
|
i barely GNU her! posted:so exactly what is the point of coffeescript again yea it's got some syntatic similarities to ruby there's a handful of functional differences, too (list comprehensions, splats, classes) but not anything significant. some people find it more enjoyable to write, and i don't have trouble debugging what comes out of it, so i don't have any issues with it Posting Principle posted:javascript is for dom manipulation, not servers actually javascript runs on a variety of platforms and is used for various tasks, including servers, build tools, and command-line scripts! e: lawdy people on this website get mad about programming languages
|
# ? Aug 13, 2013 21:25 |
|
semantic white text is the future of programming
|
# ? Aug 13, 2013 21:26 |
|
are braces really a pain in the rear end to write though
|
# ? Aug 13, 2013 21:28 |
|
QPZIL posted:"the future of programming" & "node.js" i agree with this as long as you don't think the future of programming includes python, perl, ruby, java, c, or basically anything that exists outside of bret victor's mind also haskell feels a bit space-agey, so that's acceptable. and david nolen still blows my mind whenever he posts a clojure(script) snippet, so that's probably included somewhere in the future too btw one random note: anyone who starts talking about languages as being "academic" or "practical" are dumb. i mean poo poo jane street makes a billion dollars using loving ocaml; someone could build a business off haskell if they really wanted to
|
# ? Aug 13, 2013 21:29 |
|
can I ask you about your bespoke JavaScript web framework of the week
|
# ? Aug 13, 2013 21:30 |
|
jooky posted:can I ask you about your bespoke JavaScript web framework of the week i actually started on a fakepost about facebook's react framework but i don't think i could pretend to like the concept of inline psuedo-XML in javascript (really the only two frameworks i ever use are ember and angular and they've both been around for years and people are building startups just fine off of them so w/e)
|
# ? Aug 13, 2013 21:32 |
|
oh god are we talking about node.js' concurrency model right now? things I get caremad about.
|
# ? Aug 13, 2013 22:07 |
|
QPZIL posted:i mean really, which is easier is this a trick question? it's the first one. there are no braces in the second one. there's no keyword that tells you what it is. it's unreadable. i mean i guess it's a function definition, since i assume that's the coffeescript equivalent, but there are no braces. how do you know when the function is over?
|
# ? Aug 13, 2013 22:13 |
|
i missed you tbc
|
# ? Aug 13, 2013 22:15 |
|
Tiny Bug Child posted:there are no braces. how do you know when the function is over? QPZIL posted:semantic white text is the future of programming
|
# ? Aug 13, 2013 22:16 |
|
it's good that coffeescript can be directly interpreted into js. that way when your boss finds out you wrote something in a fake language they'll be able to turn it into some really ugly javascript after you get fired
|
# ? Aug 13, 2013 22:22 |
|
QPZIL posted:"the future of programming" & "node.js" the first one is better except for the incorrect opening bracket placement
|
# ? Aug 13, 2013 22:23 |
|
QPZIL posted:semantic white text is the future of programming i still can't believe there are people who can take languages with semantic whitespace seriously
|
# ? Aug 13, 2013 22:24 |
|
Shaggar posted:the first one is better except for the incorrect opening bracket placement yes. it needs a space between the () and the {
|
# ? Aug 13, 2013 22:24 |
|
Tiny Bug Child posted:i still can't believe there are people who can take languages with semantic whitespace seriously no one takes them seriously.
|
# ? Aug 13, 2013 22:24 |
|
MononcQc posted:oh god are we talking about node.js' concurrency model right now? things I get caremad about. ooh if you have an opinion on this i'd like to hear it because you're one of the few programmers who, unlike me, knows what the gently caress they're talking about in particular i'm curious if there's any deficiencies in node's callback-based concurrency that can't be massaged over with generators or promises
|
# ? Aug 13, 2013 22:25 |
|
Tiny Bug Child posted:yes. it needs a space between the () and the { Tiny Bug Child posted:is this a trick question? it's the first one. there are no braces in the second one. there's no keyword that tells you what it is. it's unreadable. i mean i guess it's a function definition, since i assume that's the coffeescript equivalent, but there are no braces. how do you know when the function is over? Shaggar posted:the first one is better except for the incorrect opening bracket placement anyone who holds strong opinions about these things must have an incredibly boring loving job if you don't encounter anything more interesting in your programming career i feel bad for you
|
# ? Aug 13, 2013 22:27 |
|
the only way to fix node's deficiencies is with italian bread. to mop up the callback soup
|
# ? Aug 13, 2013 22:27 |
|
Otto Skorzeny posted:the only way to fix node's deficiencies is with italian bread. brb creating github.com/italian-bread.js.git because the world doesnt have enough promises libraries
|
# ? Aug 13, 2013 22:28 |
|
MononcQc posted:oh god are we talking about node.js' concurrency model right now? things I get caremad about. node.js has a concurrency model? I thought it was strictly a single threaded event loop, and if you wanted concurrency you had to do multiple processes.
|
# ? Aug 13, 2013 22:40 |
|
abraham linksys posted:also people are still angry about coffeescript When this list reaches 0 entries coffeescript will stop being a joke: https://github.com/satyr/coco/wiki/wtfcs I pity the people who have to use it, check out some old versions of that page.
|
# ? Aug 13, 2013 23:09 |
|
I read on Chrome Status we're getting something like this:code:
|
# ? Aug 14, 2013 00:23 |
|
MrMoo posted:I read on Chrome Status we're getting something like this: yea JavaScript code:
JavaScript code:
|
# ? Aug 14, 2013 00:31 |
|
i always wondered if there's a nice shorthand for lambda x: x.foo or e => e.foo or whatever, or is it just not worth the trouble
|
# ? Aug 14, 2013 00:35 |
|
yaoi prophet posted:i always wondered if there's a nice shorthand for lambda x: x.foo or e => e.foo or whatever, or is it just not worth the trouble I use a little academic language where that's (.foo) and it's pretty nice can look a little weird though sometimes when you're writing map((.foo), whatever)
|
# ? Aug 14, 2013 00:53 |
|
yaoi prophet posted:i always wondered if there's a nice shorthand for lambda x: x.foo or e => e.foo or whatever, or is it just not worth the trouble How terrible is this: Python code:
|
# ? Aug 14, 2013 00:59 |
|
very did you even try to run it code:
|
# ? Aug 14, 2013 01:05 |
|
perfect opportunity to introduce pre:butts (thing) ⇒ { // stuff }
|
# ? Aug 14, 2013 01:08 |
|
Zaxxon posted:node.js has a concurrency model? I thought it was strictly a single threaded event loop, and if you wanted concurrency you had to do multiple processes. Concurrency and parallelism aren't the same thing. Concurrency is the ability to design and having multiple distinct tasks run and complete over overlapping time periods. For example, when your OS would run multiple programs (say notepad.exe and a browser) on a single core. Parallelism is running multiple tasks at the same time. You can have both at the same time, say with Erlang, Go, Rust, Clojure, or Scala, when different actors/threads/processes/routines run on different cores. You can have concurrency without parallelism when a program in one of the languages above runs on a single core, too. You can have parallelism without concurrency: any execution that your hardware executes in parallel to speed things up without you knowing about it, stuff you send over a GPU, and so on. Callback-based code is a concurrency model, one of the most primitive ones, where the user manually breaks up computations into individual functions or routines, to be called on some events. abraham linksys posted:ooh if you have an opinion on this i'd like to hear it because you're one of the few programmers who, unlike me, knows what the gently caress they're talking about Promises help. They're one of the other concurrency tools that are nicer than callbacks. The general problem I have with callback/event loops as a concurrency construct for a server application like node.js is that they're antique pieces of crap compared to nicer techniques available today. I posted a long rant on this before, but here it is again in condensed form. 1. Callback-based code is cooperative, thus risky for a server-side app because any bad dev can make a rarely-called CPU-intensive task block extremely common and simple requests. 2. Coordinating multiple callbacks on to a single point sucks. You need some equivalent to a counter that's used to know how many callbacks are left to run: code:
code:
Most models that are somewhat modern will let you wait on another component, do things somewhat asynchronously if you want to, and so on. Lua coroutines and Go goroutines can be examples of that. 3. Callback-based concurrency with event loops is generally far less readable than any other alternative giving similar results: it's hard to follow, debug, trace, etc. The only reason it's acceptable is that it's somewhat trivial to add that model to a code base or language that doesn't support it. 4. Node.js does not support anything really parallel, but even if it had it, callbacks would still be unreadable code compared to other alternatives. 5. I don't like the idea of using the same language in the front-end and the back-end if they're not made specifically for that. You know how to use a knife, so you bring a knife to a modern war fought with guns, tanks, and missiles while shouting "at least I can use the same tools when I eat and when I fight! I save so much time!" I welcome javascript on the server the way I welcome Java applets in my browser. 6. Event matrix explosion. For example, if you're implementing state machines, you get a bunch of events and a bunch states where they can be used in. This gives you an event-state matrix a bit as follows (for a phone): The blue items are events and states we care about directly. The red ones are transitional states that each should have 1 input (begin state -> end state). An O means we accept the event. A dash means we queue it up for later (too busy to handle). A D means we deny it. An X means it shouldn't be allowed in the first place. Using a good language to program a state machine in, you can care only about the blue overlay box, the Ds and the Os. It's trivial to implement ways to block the rest or make it not happen. Either because you can interact with the FSM directly (or blocking, or explicitly controlling the flow of events), or because it has constructs to deal with such messages (selective receiving, dedicated channels, etc.) Using callback-based code, you do not control what (event, state) combination you will get, and while some are not gonna happen, many of them are possible through annoying combinations. You need to prepare code to handle that explicitly in the least pleasant way possible. Given how much of a program can be seen as a state machine (whether formal or not), the general state of an event-loop with callback program is a nightmare to handle compared to the rest of stuff. I'm sure I can think of more, but this is longer than I intended already.
|
# ? Aug 14, 2013 01:18 |
|
Zombywuf posted:When this list reaches 0 entries coffeescript will stop being a joke: https://github.com/satyr/coco/wiki/wtfcs that whole page is just a list of "don't hold it like that" tier problems yeah it doesn't nest comprehensions correctly the fix is don't nest comprehensions you rear end, humans can't understand that either
|
# ? Aug 14, 2013 01:22 |
|
yaoi prophet posted:i always wondered if there's a nice shorthand for lambda x: x.foo or e => e.foo or whatever, or is it just not worth the trouble import operator operator.namegetter("foo")
|
# ? Aug 14, 2013 01:24 |
|
abraham linksys posted:lawdy people on this website get mad about programming languages hi
|
# ? Aug 14, 2013 01:32 |
|
crazypenguin posted:I use a little academic language where that's (.foo) and it's pretty nice this is what i've wanted /forever/ i mean in python you can pass around methods as functions so uh, (.foo) (+) etc would be lovely. i mean seriously sorted(foo, key=(.butt))
|
# ? Aug 14, 2013 01:34 |
|
tef posted:this is what i've wanted /forever/ Control.lens >
|
# ? Aug 14, 2013 01:38 |
|
Suspicious Dish posted:import operator :some sort of vomiting emoticon:
|
# ? Aug 14, 2013 01:39 |
|
yaoi prophet posted:i always wondered if there's a nice shorthand for lambda x: x.foo or e => e.foo or whatever, or is it just not worth the trouble scala has _.foo
|
# ? Aug 14, 2013 01:46 |
|
Malcolm XML posted:Control.lens that's exactly what i was thinking of when i made that post
|
# ? Aug 14, 2013 01:47 |
|
|
# ? Jun 11, 2024 02:41 |
|
tef posted::some sort of vomiting emoticon: python is the purest form of code poetry
|
# ? Aug 14, 2013 01:48 |