|
HappyHippo posted:how easy is it to switch a javascript project over to typescript? depends on how big it is and how much you want it it's probably a lot easier now that typescript lets you include js files, so you can piecemeal convert everything. probably still a lot of stuff that will show warnings or errors at first. the good news is that generally typescript will transpile stuff anyway so if you can deal with errors being logged during transpilation at first while you straighten them out it may not be so bad. also make sure you don't have any lame rear end js dependencies that don't have a .d.ts file written for it or you'll have to start making one yourself.
|
# ? Mar 17, 2016 00:23 |
|
|
# ? May 11, 2024 10:36 |
|
HappyHippo posted:how easy is it to switch a javascript project over to typescript? rename all js files to ts, include a tsconfig.json file, and you should be good to start start adding types. anywhere you either need an external type you can find it on definitelytyped, declare it as any, or write a wrapper interface. then keep going.
|
# ? Mar 17, 2016 01:39 |
|
transpiler is such a goofy loving word it's ok to just call it a compiler. that's what the typescript team calls it.
|
# ? Mar 17, 2016 02:00 |
|
fleshweasel posted:transpiler is such a goofy loving word oh do they? yeah I don't really get why people have been using transpiler for a while instead of compiler, especially now that ~~WEBASSEMBLY~~ is hitting the shores
|
# ? Mar 17, 2016 03:30 |
|
i'm trying to turn a conversation of "what should we name this thing in a public api?" to "why are we adding this to a public api? we're 2 quarters away from even possessing the necessary knowledge to define what it is." is this correct bikeshedding?
|
# ? Mar 17, 2016 03:34 |
|
piratepilates posted:oh do they? yeah I don't really get why people have been using transpiler for a while instead of compiler, especially now that ~~WEBASSEMBLY~~ is hitting the shores a compiler is a program that takes code in one language as input and outputs code in a different language
|
# ? Mar 17, 2016 03:38 |
|
my transpiler is leaking
|
# ? Mar 17, 2016 05:09 |
|
has anybody said buttpiler yet
|
# ? Mar 17, 2016 05:39 |
|
Illusive gently caress Man posted:i'm trying to turn a conversation of "what should we name this thing in a public api?" to "why are we adding this to a public api? we're 2 quarters away from even possessing the necessary knowledge to define what it is." is this correct bikeshedding? are multiple words in your API path CamelCase, mixedCase, or_underscored? this is an important question that should be answered before you worry about what your API does or does not do or fail to do. same re json/xml and capitalization of the json/xml terms. that's a good 3-5 meetings you could have right there.
|
# ? Mar 17, 2016 05:46 |
|
hackbunny posted:I can't use sql, orms have spoiled me. validation hooks and change notifications are the things I miss the most when I'm using bare SQL, and schema migration is a pain JewKiller 3000 posted:i don't speak orm so maybe i'm wrong, but it sounds like you're talking about check constraints and triggers? hackbunny posted:kinda, except outside of the database, written in a sensible programming language and actually debuggable umm ok well a "validation hook" sounds like it lets you ensure that an invalid value is never written to the database. why do you want this check to occur outside of the database? a "change notification" sounds like something you want to happen when a modification to the database occurs. why don't you think the database is capable of triggering this for you? you know you can have the trigger call a function written in a normal programming language (not sql), right? in conclusion: JewKiller 3000 posted:hmm, i need to query the database, so instead of using the sql language that was designed specifically for the purpose, i think i'll make 50 java classes and then eat my own poo poo
|
# ? Mar 17, 2016 06:53 |
|
leper khan posted:are multiple words in your API path CamelCase, mixedCase, or_underscored? this is an important question that should be answered before you worry about what your API does or does not do or fail to do. same re json/xml and capitalization of the json/xml terms. that's a good 3-5 meetings you could have right there. everything is consistent case unfortunately. now im arguing toilet (which is the thing we can't fully define yet) should be an optional property of turd rather than a parent on the resource url. not all turd users need a toilet, and it dilutes the meaning of toilet. it just makes sense!!!!! imagine youre checking out turd API v1, and the first thing you're required to do is create a toilet. you've never heard of toilets, and after reading the docs, it turns out you don't care. doesn't that sound like a bad design? toilets exist because some customers wont use our turd API unless their turds are in toilets, but a lot of customers wont care, or don't want to pay for toilets. IMO, turds should be allowed to exist outside a toilet when users don't need toilets. but enough about my posting
|
# ? Mar 17, 2016 11:23 |
|
A better way imho is to let everyone write a spec indiviually and compare contrast them. This ways you can suss out any inherent beliefs that would otherwise be a loving nightmare to do face to face. however if you dont know wtf youre building then you might as well piss in the wind forever
|
# ? Mar 17, 2016 13:48 |
|
piratepilates posted:oh do they? yeah I don't really get why people have been using transpiler for a while instead of compiler, especially now that ~~WEBASSEMBLY~~ is hitting the shores anything involving js isn't "real" programming, but compilers are real programming, therefore js people aren't allowed to use the word compiler
|
# ? Mar 17, 2016 16:02 |
|
thanks for the replies guys. one other thing, how is the debugging in the browser? my understanding is that the js code looks mostly the same (just with the annotations removed) so its not that difficult?
|
# ? Mar 17, 2016 16:09 |
|
Plorkyeran posted:anything involving js isn't "real" programming, but compilers are real programming, therefore js people aren't allowed to use the word compiler what if they wrote a C compiler in js? i'm sure someone has been dumb enough to do it
|
# ? Mar 17, 2016 16:28 |
|
HappyHippo posted:thanks for the replies guys. one other thing, how is the debugging in the browser? my understanding is that the js code looks mostly the same (just with the annotations removed) so its not that difficult? Typescript debugging is fine since it's so similar to JavaScript. Even if you turn off source maps it's pretty easy to see what code in the compiled version is which in the original TS version. EXCEPT for some stuff like generators and async/await which gets turned in to an odd looking state machine block, but that's also pretty easy to read one you realise what they're doing. You can go to the babeljs site and play around with their online transpiling playground (TS has one too actually) and see how similar the final js code is and how things are getting compiled to ES5 compliant JavaScript.
|
# ? Mar 17, 2016 16:44 |
|
HappyHippo posted:how easy is it to switch a javascript project over to typescript? well technically plain JavaScript is valid typescript afaik
|
# ? Mar 17, 2016 17:01 |
|
so uh what's the proper way to do a feature branch in git that depends on master and another unmerged branch? I created a new branch from master then merged the other branch then started working. when I submitted the branch as a pull request the reviewer told me to use stashing and I'm thinking like how the heck do I use git stash for this???
|
# ? Mar 17, 2016 17:06 |
|
Ludwig van Halen posted:so uh what's the proper way to do a feature branch in git that depends on master and another unmerged branch? I know one person who might have an idea how stashing would work with your feature branch, should probably ask him
|
# ? Mar 17, 2016 17:10 |
|
piratepilates posted:I know one person who might have an idea how stashing would work with your feature branch, should probably ask him
|
# ? Mar 17, 2016 17:12 |
|
leper khan posted:what if they wrote a C compiler in js? i'm sure someone has been dumb enough to do it it would be a "toy compiler"
|
# ? Mar 17, 2016 17:18 |
|
Illusive gently caress Man posted:everything is consistent case unfortunately. As long as turds will never require a toilet then having a property on turd with a reference to the containing toilet is correct. However if turds have a hidden default toilet then that counts as being required. Don't hide that kind of implementation detail.
|
# ? Mar 17, 2016 18:48 |
|
LeftistMuslimObama posted:ok, so with wpf, the basic way to dynamically populate lists, trees, etc is just to bind them to a collection, then have that collection throw off the right events when they change? that feels too god damned easy. like, can i seriously filter my list of items by a particular metadata by just clearing the collection my listview is bound to and then repopulating the collection using a query against my sqlite database on that metadata? this can't be real, it feels too sane. i have to be missing something. that's generally how data binding systems work WPF here just follows in the footsteps of Apple's Cocoa Bindings and its predecessor, the NeXT EOInterface framework
|
# ? Mar 18, 2016 02:44 |
|
LeftistMuslimObama posted:my poor tortured mind can't accept that there's not some kind of minefield hiding behind this simple premise there are minefields for sure for example, people sometimes try to just use objects that have been bound to on threads other than the main/UI thread; different bindings systems deal with this differently, but in virtually none actually "just work" (and it's not even entirely clear what that would necessarily mean)
|
# ? Mar 18, 2016 02:46 |
|
eschaton posted:there are minefields for sure javascript solves this in the best way (actually i'm only half kidding)
|
# ? Mar 18, 2016 02:55 |
|
eschaton posted:that's generally how data binding systems work what this experience is teaching me is that i need to get out as soon as i dont owe for the tuition anymore and my insurance has paid for all the procedures i need. good thing im writing something to put on my github
|
# ? Mar 18, 2016 04:39 |
|
LeftistMuslimObama posted:what this experience is teaching me is that i need to get out as soon as i dont owe for the tuition anymore and my insurance has paid for all the procedures i need. good thing im writing something to put on my github so you were fine with mumps?
|
# ? Mar 18, 2016 07:02 |
|
eschaton posted:there are minefields for sure yeah, core data objects on ios for example. if you hit a fault (some part of the object wasn't retrieved from the database and must be queried), you'll be blocked while the query runs on the managed object context's thread. I try not to use locks anywhere (the lock is evil! the lock shoots sleeps, and makes new deadlocks to poison the App with a plague of crashes, as it once was), but iirc I managed to hit a deadlock anyway. I had to write a proxy around NSFetchedResultsController (the class that's used to bind data queries to UI tables/lists), which converted all managed objects into POOCOs to move data to the main thread I find that the worst part by far when you write multi-threaded code is not synchronization (although lock-free synchronization can be a bitch and a half), but startup/teardown. you end up putting queues everywhere and generating lots of spurious events to stave off the risk of data loss, desynchronization, or endless waits. I really should try erlang or distributed programming in general
|
# ? Mar 18, 2016 10:07 |
|
speaking of teardown, holy poo poo how the hell did I manage to conceive of and write this:C++ code:
C++ code:
also note this apparent no-op which is actually very important: C++ code:
also of note the use of a condition variable to broadcast changes in state (I don't remember what this is for, honestly). so to sum up in the same function we have examples of lockless and lock-free synchronization, a state machine, a promise/future, and a careful dance to preserve integrity that I would document if I had the formal knowledge (and the time) to do it, and if this wasn't a one man project. it was a lot of work to write, but it's been extremely dependable, and it's well designed enough that I can use it as if it was a stable third party API hackbunny fucked around with this message at 10:35 on Mar 18, 2016 |
# ? Mar 18, 2016 10:31 |
|
turds, toilets, butts, boners. i love programming chat on yospos
|
# ? Mar 18, 2016 11:14 |
|
FamDav posted:so you were fine with mumps? ya. at least mumps is weird and esoteric, which can be fun. being shackled to 20-year-old versions of vb or to a c# client that refuses to use any of the tools that actually make c# good sucks rear end.
|
# ? Mar 18, 2016 17:10 |
|
terrible programmer status: wasted about 3 days on this loving problemcode:
code:
i mean sure i have a work around but christ that was annoying
|
# ? Mar 18, 2016 21:31 |
|
hackbunny posted:yeah, core data objects on ios for example. if you hit a fault (some part of the object wasn't retrieved from the database and must be queried), you'll be blocked while the query runs on the managed object context's thread. I try not to use locks anywhere (the lock is evil! the lock shoots sleeps, and makes new deadlocks to poison the App with a plague of crashes, as it once was), but iirc I managed to hit a deadlock anyway. I had to write a proxy around NSFetchedResultsController (the class that's used to bind data queries to UI tables/lists), which converted all managed objects into POOCOs to move data to the main thread since I actually helped create Core Data, I have to suggest that a proxy around NSFetchedResultsController is probably the wrong way to go about this use a parent-child NSManagedObjectContext hierarchy, with the parent context configured for private queue concurrency and the child configured for main queue concurrency and use that for the FRC then when you need to fetch, do an object-IDs-only fetch against the parent context, and when it's done make the FRC do its fetch the first fetch will populate the coordinator's row cache, and only realizing the objects in the main queue context will actually happen for the FRC's fetch Core Data is designed to work very well in multithreaded code, as long as you don't fight the framework's opinionated concurrency design (which everyone does at first because it's not designed like they might otherwise be used to)
|
# ? Mar 19, 2016 01:41 |
|
hackbunny posted:speaking of teardown, holy poo poo how the hell did I manage to conceive of and write this: i've never used the language but i hate how objective-c looks
|
# ? Mar 19, 2016 01:49 |
|
quote:performBlockAndWait:^{ yeah i'd be :^{ too
|
# ? Mar 19, 2016 03:00 |
|
Blinkz0rz posted:i've never used the language but i hate how objective-c looks everyone hates it at first, but you get used to it pretty quickly at least now that there's array literals and subscript syntax. i never did get used to NSArray *array = [NSArray arrayWithObjects:foo, bar, baz, nil]; [array objectAtIndex:2]; dictionaries were even worse because you specified the values before the keys
|
# ? Mar 19, 2016 03:21 |
|
ive been loving around in scala for a week and it seems ok. what's going to bite me in the rear end?
|
# ? Mar 19, 2016 04:33 |
|
uncurable mlady posted:ive been loving around in scala for a week and it seems ok. what's going to bite me in the rear end? implicits
|
# ? Mar 19, 2016 08:32 |
|
eschaton posted:since I actually helped create Core Data, I have to suggest that a proxy around NSFetchedResultsController is probably the wrong way to go about this it's too late and I'm not going back to change it at this point eschaton posted:use a parent-child NSManagedObjectContext hierarchy, with the parent context configured for private queue concurrency and the child configured for main queue concurrency and use that for the FRC ok I didn't know about parent-child contexts. yeah this would have saved me a lot of trouble lol. like I said, it's too late to change it, it works and it works great so the proxy is staying. it has several desirable properties too, like completely uncoupling data from the database, so I can reliably close it (closing the database is something that core data isn't too hot about, as far as I can remember) I really have to learn to read documentation rather than hammer at the code until it behaves, but it bores me so much, especially when my scenario isn't addressed directly and I have to extrapolate and experiment. it's especially disheartening when it's something with so many moving parts
|
# ? Mar 19, 2016 12:10 |
|
|
# ? May 11, 2024 10:36 |
|
Plorkyeran posted:everyone hates it at first, but you get used to it pretty quickly I don't think I'd be very comfortable entrusting my data to an rray
|
# ? Mar 19, 2016 12:35 |