|
cinci zoo sniper posted:re &&: oh, i see. what is the difference between logical and bitwise OR then? logical works on boolean values (and many languages will silently coerce ints to bools where 0 is false and anything else is true). it returns true or false (again, 1 or 0 respectively) bitwise works on the individual bits in a number. so 0b001100 || 0b111000 is just true i.e. 0b000001 but 0b001100 | 0b111000 compares each bit and you get back 0b111100. if you pretend that true is exactly 0b000001 and false is exactly 0b000000 then they give the same results. HOWEVER a big difference in reality is that logical OR also short-circuits, it won't evaluate its second arg (or perform any of its side effects) if the first is true (since true || _ is true)
|
# ? Oct 30, 2017 11:27 |
|
|
# ? Jun 8, 2024 18:10 |
gonadic io posted:logical works on boolean values (and many languages will silently coerce ints to bools where 0 is false and anything else is true). im not sure what did i expect from logical or short-circuiting behaviour
|
|
# ? Oct 30, 2017 12:16 |
|
cinci zoo sniper posted:im not sure what did i expect from logical or short-circuiting behaviour what do you mean sorry? || is basically the dual of && so everything said there applies here too.
|
# ? Oct 30, 2017 12:23 |
|
rjmccall posted:
|
# ? Oct 30, 2017 12:24 |
|
Fiedler posted:Array of size 8 assigned 9 values. I don't write C, please tell me that's a compile error and not a "lol guess I'll just overwrite the next byte in memory #yolo" scenario
|
# ? Oct 30, 2017 13:33 |
gonadic io posted:what do you mean sorry? || is basically the dual of && so everything said there applies here too. what im saying is that for some reason (e.g. im dumb) i did assume that logical or would in some place behave like logical and and drop whatever it is doing once it has fulfilled a certain condition (e.g. first false statement in "&&" chain). but then i wonder if there is any high level difference be between logicals, other than the length of evaluation chain i guess? also drat it's really annoying to talk about this from phone, i can't post examples
|
|
# ? Oct 30, 2017 13:36 |
|
First false value halts a && chain and first true value halts a || chain.
|
# ? Oct 30, 2017 13:40 |
gonadic io posted:First false value halts a && chain and first true value halts a || chain. yeah that makes sense if we exclude (semantically) things like Foo == Bar && inctement_baz() that i couldn't reconcile
|
|
# ? Oct 30, 2017 13:42 |
|
Increment_baz may well not get called in that code. It's what lets if (foo != null && foo.bar()) Work instead of throwing a null pointer exception when foo is null.
|
# ? Oct 30, 2017 13:53 |
|
NihilCredo posted:I don't write C, please tell me that's a compile error and not a "lol guess I'll just overwrite the next byte in memory #yolo" scenario well these days I think it segfaults instead, but I dunno if that just applies to when you exit application heap or if you can overwrite other parts of your application's heap without causing a segfault deffo not a compile time error though edit:https://ideone.com/3lZQxw not even a runtime error lol Condiv fucked around with this message at 14:30 on Oct 30, 2017 |
# ? Oct 30, 2017 14:12 |
gonadic io posted:Increment_baz may well not get called in that code. these function calls are really loving with my mind but the null pointer example is good, ty
|
|
# ? Oct 30, 2017 14:27 |
|
NihilCredo posted:I don't write C, please tell me that's a compile error and not a "lol guess I'll just overwrite the next byte in memory #yolo" scenario the extra initializers are just ignored. there's warning in every major compiler, and c++ fixes this to be a compiler error
|
# ? Oct 30, 2017 15:22 |
|
What is server side react.js, because https://twitter.com/NetflixUIE/status/923374215041912833
|
# ? Oct 30, 2017 15:58 |
|
Netflix must be making so much money to just throw it away on hardware to run slow rear end javascript
|
# ? Oct 30, 2017 15:59 |
|
lol if you ever have to touch javascript in your work-life at all
|
# ? Oct 30, 2017 16:05 |
|
Shaggar posted:Netflix must be making so much money to just throw it away on hardware to run slow rear end javascript Reminder the Ruby and PHP are still popular choices.
|
# ? Oct 30, 2017 16:11 |
|
php can probably be made pretty fast on the right runtime since its just a template language, but ruby and js probably would fight for worst performance title.
|
# ? Oct 30, 2017 16:13 |
|
Shaggar posted:php can probably be made pretty fast on the right runtime since its just a template language, but ruby and js probably would fight for worst performance title. nah, it's not even close https://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=node&lang2=yarv
|
# ? Oct 30, 2017 16:16 |
|
Just reviewing some typescript codecode:
|
# ? Oct 30, 2017 16:27 |
|
CRIP EATIN BREAD posted:lol if you ever have to touch javascript in your work-life at all I spent all Friday converting a single threaded webapp into a co-operatively scheduled app and binge watching Stranger Things 2. Just look at this masterpiece, JavaScript code:
JavaScript code:
MrMoo fucked around with this message at 16:43 on Oct 30, 2017 |
# ? Oct 30, 2017 16:28 |
|
why aren't you using async/await
|
# ? Oct 30, 2017 16:33 |
|
Only just starting to rollout Chrome 55+ to support it. I'm already lucky to be beyond 52 so I can call imageBitmap.close, 1GB/s garbage otherwise All the desktops are stuck on Chrome 46 to support Java and IDC's applet MarketQ.
MrMoo fucked around with this message at 16:41 on Oct 30, 2017 |
# ? Oct 30, 2017 16:39 |
|
actionjackson posted:Hello I'm a biostatistician and I don't know any "real" languages, just SAS and R. Am I confined to the #datascience thread or can I post in YOSPOS tyia greetings, almost all code in these langs is terrible
|
# ? Oct 30, 2017 16:46 |
|
Sapozhnik posted:why aren't you using async/await why is he using more than 2 spaces for indentation?
|
# ? Oct 30, 2017 16:48 |
|
CRIP EATIN BREAD posted:lol if you ever have to touch javascript in your work-life at all javascript is like the least bad thing I have to work with
|
# ? Oct 30, 2017 17:00 |
|
MrMoo posted:What is server side react.js, because honest answer: something like this from 2009 http://web.stanford.edu/~ouster/cgi-bin/papers/fiz.pdf the long and short of it is that a lot of how we approached mvc was kinda bunk, and applet like apis, or building a component tree and calling render() is much better for re-use than keeping your html, and your sql in different directories but javascript wasn't fast enough to do components client side at first, and trying to write your own dom api server side, on the other hand, is a total pain in the rear end. everyone gives up and concatenates strings or uses templates. your component library kinda has to be in javascript too, or you have to be able to compile your widget's logic down to javascript to do it. now react exists, and sure enough, it was built for doing more interactive components client side but components are great, here's enough of a dom in serverside javacript that you can render, and send the html over the wire. in some ways, we have always been doomed to reimplement X11 the shadow-dom stuff looks neat though
|
# ? Oct 30, 2017 17:05 |
|
tef posted:in some ways, we have always been doomed to reimplement X11 this is actually a great way to describe all this
|
# ? Oct 30, 2017 17:08 |
|
tef posted:but components are great, here's enough of a dom in serverside javacript that you can render, and send the html over the wire. Something like this is why I don't feel like a complete monster for having built a system that used a headless browser to render templates, then inline all images and strip all sensitive code / data to produce a single Fat HTML file fake edit: said fat HTML file was distributed by email and inline images were too big, I actually had them all so that they would be unzipped and displayed on page load i AM a monster
|
# ? Oct 30, 2017 17:17 |
|
tef posted:honest answer: something like this from 2009 what? no how the hell is react in any way like x11
|
# ? Oct 30, 2017 17:23 |
|
Sapozhnik posted:what? no idunno but it sounds smart
|
# ? Oct 30, 2017 17:26 |
|
MrMoo posted:Only just starting to rollout Chrome 55+ to support it. I'm already lucky to be beyond 52 so I can call imageBitmap.close, 1GB/s garbage otherwise All the desktops are stuck on Chrome 46 to support Java and IDC's applet MarketQ. why aren't you using babel
|
# ? Oct 30, 2017 17:27 |
|
Sapozhnik posted:why aren't you using babel babel's transpilation of async await requires a big ugly generator runtime for some reason.
|
# ? Oct 30, 2017 17:28 |
|
it also makes source map debugging unusable
|
# ? Oct 30, 2017 17:30 |
|
x11 is an async rpc protocol for bitmapped rendering that also provides an event stream x servers do not host any application logic display postscript i guess in some old incarnations runs imperative code on the renderer side of things but even then it's an immediate-mode rendering api. react is a tree of stateful thunks. there is a scene graph and there is absolutely client-side intelligence involved.
|
# ? Oct 30, 2017 17:32 |
|
react is pretty drat cool though. i might do a brief effortpost about it for non-js people because it has some very neat ideas in it that are fun to talk about
|
# ? Oct 30, 2017 17:35 |
|
gonadic io posted:there are no good programmers though. There's just so much poo poo to know that no one can know it all and there are a few basic orientations that people seem to take to that fact: "I know almost everything, I'm SOOO good!" Ah, this is cute in middle schoolers, mildly worrying in high schoolers, and a pain in the butt in coworkers. Nothing wrong with enjoying a feeling of having attained some significant knowledge but this type will sometimes want to take vengeance when a situation shows that they don't know something. And there are lots of things this person doesn't know because they are a human "I'm an expert in the following areas and technologies... and everything I don't know is not really worth learning." Just fine as a coworker as long as they never have to leave their lane or evaluate anyone else's stuff, so Not Fine Actually over a long enough timeline. Still too personally invested in Their Precious Skills "There's a bewildering amount of stuff out there; I know how to not gently caress up some of it in the following areas and learn as I go" the actually good philosophy IMO
|
# ? Oct 30, 2017 17:52 |
|
Sapozhnik posted:x11 is an async rpc protocol for bitmapped rendering that also provides an event stream i meant more about in terms of: x11 provides a simple api for interfaces: bitmaps, events we build widget sets atop to provide things over it, patching over the lack of things we don't have then we get things like xdri and substantial architectural changes that basically violate the whole design principle and some other goddam extension that i can't remember the name of what was previously a gui over a network became a janitor for local processes. anyway we had html, as a way of interacting with remote document collections we brought in forms, widgets, etc, but we hacked over it with css and javascript and now, although most of us have moved to widget sets, they're still built in terms of simpler components, but we also have localstorage and a litany of other extensions what was a document platform is now an application platform what was a sandbox is now something with desktop integraton (storage, notifications, etc) what i wanted to say was, 'wanting to impement NeWS and doomed to reimplement X11' but i felt i was being too obscure we always wanted the component system, it's just, that's far harder to adopt. too much to learn up front, too much to reimplement for compatibility. but we end up adopting the hack, and crufting on what we need , asking ourselves why this happened, despite maybe taking a decade to get the box model right but, i also meant that the whole 'things get pushed backwards and forwards between the display and the application as power/resource/latency changes between them;' meanwhile, we're re-inventing applets again. web assembly.
|
# ? Oct 30, 2017 17:53 |
|
web assembly is gonna be good cause u can write c# instead of javascript+html
|
# ? Oct 30, 2017 17:54 |
|
Shaggar posted:web assembly is gonna be good cause u can write c# instead of javascript+html typescript already exists for people who wish they were writing .net
|
# ? Oct 30, 2017 17:57 |
|
|
# ? Jun 8, 2024 18:10 |
|
typescript is inferior to c# and still involves javascript at some point
|
# ? Oct 30, 2017 17:57 |