Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Sapozhnik
Jan 2, 2005

Nap Ghost
Russian cursing is very... modular

Adbot
ADBOT LOVES YOU

Sapozhnik
Jan 2, 2005

Nap Ghost
the idiomatic way to solve this problem in c++ would be to not use c++ because querying a bunch of heterogeneous databases and then assembling text records that summarize the results is one of the worst uses of c++ i can think of

Sapozhnik
Jan 2, 2005

Nap Ghost
trying to second-guess the type of the object like that is a code smell

if you have two different kinds of thing passing through your function that both quack in the same way then you shouldn't have to care about whether you're dealing with a duck or a goose.

if you do have two fundamentally different things passing through your function where the difference between them matters then why are they both passing through that function? your abstraction is broken, fix it.

Sapozhnik
Jan 2, 2005

Nap Ghost

meatpotato posted:

Correct, C has no exceptions. However, you can use setjmp and longjmp to roll your own exceptions in C... but like everything C, you've gotta remember to handle all the details of deallocating resources yourself

I've never done it myself but some older coworkers did it in the 80s

https://www.youtube.com/watch?v=dOV5WXISM24

Sapozhnik
Jan 2, 2005

Nap Ghost
tbf modern console controllers could stand to have a few more buttons on the back grip like the ones that the steam controller has

Sapozhnik
Jan 2, 2005

Nap Ghost

JewKiller 3000 posted:

c++ can std::suck my std::dick

Sapozhnik
Jan 2, 2005

Nap Ghost
https://www.biostars.org/p/62023/ - A Farewell To Bioinformatics

Sapozhnik
Jan 2, 2005

Nap Ghost
curl does not support the die url scheme

Sapozhnik
Jan 2, 2005

Nap Ghost

tef posted:

The hardest pair of programming problems is naming things, cache invalidation, and off-by-one errors

Sapozhnik
Jan 2, 2005

Nap Ghost
shitposting into an ide is a pretty decent summary of what i do all day

Sapozhnik
Jan 2, 2005

Nap Ghost
*farts tentatively*

Sapozhnik
Jan 2, 2005

Nap Ghost
2MB is a lot for a 2D-only game console, dang.

Also I like the architecture that is just called "RISC"

Sapozhnik
Jan 2, 2005

Nap Ghost
the microsoft thread is currently undergoing some Philadelphia Experiment poo poo

Sapozhnik
Jan 2, 2005

Nap Ghost
I wouldn't call it the "best poo poo ever" tbh but if you use Facebook's stack of bullshit then it's alright. Flow seems like the better choice if you're going to be dealing with React though.

My beef with Redux is that it doesn't seem to factorize very well at all so you end up making GBS threads out a bunch of boilerplate. I did try in earnest to deduplicate some of that stuff (CRUD actions for an API collection) and the cure was worse than the disease so I gave up and just boilerplated that poo poo instead.

I wrote a neat REST server library for Java 8 which I'm decently proud of that I'm going to open source soon; already got approval from my boss.

Sapozhnik
Jan 2, 2005

Nap Ghost
:psyduck:

da h*ck does your parents' website do that can't be solved with a plain simple python server-side app talking to sqlite

assuming it isn't a totally static website that couldn't just be generated from like jekyll or hexo

Sapozhnik
Jan 2, 2005

Nap Ghost
I'm still very tepid on Redux. I use it, but only for things that need to interact with Sagas. Pretty much I use it to hold mapped responses to GET requests, but then I'll have view components that sort and paginate and display those data sets, and that side of things is handled in local state within higher-order components.

Didn't even know "Flux Standard Actions" was a thing either, will look into it. I tried coming up with my own solution to this sort of problem but because I'm dumb and bad I abandoned it.

Sapozhnik
Jan 2, 2005

Nap Ghost
https://forums.somethingawful.com/showthread.php?threadid=3648105&userid=72615&perpage=40&pagenumber=8

the ghost posts are still there

Sapozhnik
Jan 2, 2005

Nap Ghost
that it did, keep screaming into the void i guess

(seriously lol this poo poo is never going to get fixed just euthanize the threads that have database cancer and start again)

Sapozhnik
Jan 2, 2005

Nap Ghost
so, what, every thread there's a spooky X-post-long hole after every 25 posts, for different values of X in each thread?

how the gently caress does this even happen :psyduck:

Sapozhnik
Jan 2, 2005

Nap Ghost
TIL that

Java code:
class GenericSomething<T extends Foo & Bar> {
	// ...
}
was a thing you could do in Java. The leftmost thing in the chain of ampersands must be the only class though (naturally...)

that would have been good to know before I went and twisted myself into pretzels trying to get some generics to work the way I wanted them to.

Sapozhnik fucked around with this message at 20:54 on Oct 7, 2017

Sapozhnik
Jan 2, 2005

Nap Ghost
cool now port the build to meson and groan at how much time you could have saved

Sapozhnik
Jan 2, 2005

Nap Ghost
Still undecided on typescript vs flow for this reactjs side-project. I rather wish this rift didn't exist tbh

Flow:
- Written by a bunch of guys who love javascript so much they wrote a type checker for it in ocaml.
- poo poo performance under windows. Supposedly.
- The main IDE is Atom. What the gently caress even is Atom. How do I do anything beyond notepad.exe's capabilities with this goddamn bullshit.
- Yeah you can kind of use it from VSCode but the integration is third-party and really crappy and you have to rip out half of VSCode to make it work so wtf is the point.
- I erroneously wrote "import type * as types from 'whatever'" and this sent it into a crash loop. One crash loop per CPU core, as a matter of fact.
- There are already two incompatible versions in wide use.
- Facebook's whole dev tooling landscape in general is really vertically integrated and keeps wanting to drag in other poo poo of theirs.
+ Works with create-react-app out of the box (misnomer: this is a canned build system for react projects with sane defaults).
+ Facebook is stuck with this poo poo so they have to keep React and Immutable and all their other crap sort-of working with it.
+ Supposedly a stronger type system, and was in fact developed in response to perceived weaknesses in the design and objectives of TS.

TypeScript:
- Not a first-party solution: poo poo will break and I have to hope that people will be entertained by the process of fixing it.
- Don't know the details but the type system has impedance mismatches with Redux and Immutable.js. See above.
- Supposedly has a weaker type system than Flow.
+ I can edit it from VSCode and VSCode doesn't make me want to punch somebody
+ Has first-party support from redux-saga.
+ Has wider first-party support in general. Like there's a Protobuf library that emits TypeScript stubs, no such luck for Flow.

Honestly my main problem with Flow is that I really hate Atom from what little I've seen of it.

Sapozhnik
Jan 2, 2005

Nap Ghost

Notorious b.s.d. posted:

how long is it gonna take y'all to learn emacs is the one true path

elisp is poo poo and vimscript is double dog hypershit. atom is unironically a potentially better editor than both emacs and vim because it's built on top of javascript. yes, javascript is bad, but enough developers are stuck in this loveless marriage that the developer community is forced to somehow make javascript itself work.

modern editors are a text entry widget bolted on to a programming language, in much the same way that an A10 is an enormous gun that somebody mounted a plane onto. the choice of underlying language is crucial.

Sapozhnik
Jan 2, 2005

Nap Ghost

mystes posted:

(They also have a pointless different fork of Ocaml that appears to exist purely due to bikeshedding and NIH syndrome.)

jfc lol




oh, something else:

typescript files have a .ts extension instead of .js, as you'd expect
flow files have a // @flow line instead

reeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee

Sapozhnik
Jan 2, 2005

Nap Ghost

fleshweasel posted:

I wouldn't use languages invented by facebook unless I worked for facebook. they don't give a poo poo about the anyone's use case outside the company whereas microsoft does. the maintainers of @types are also pretty good at keeping definitions up to date when new versions of major libraries come out.

typescript is not about being a formally sound type checker. they carefully choose to allow certain gaps in order to function with the reality of how people write js code and their expectations in practice.

fwiw, you can very easily get by in react without an immutable data structures library simply by using the spread syntax to for instance add a [newElement, ...originalList] or { newKey: newValue, ...originalObject}. I'm optimistic that the recent "mapped types" feature (e.g. a keyof MyType meta-type which is basically a set of strings) has enabled a much better experience with immutable.js though, and if you try it, please let us know your experience.

who's "us", are you a member of the dev team?

and i do use spread syntax often in my react code yeah. though i'm still fairly new at this new-fangled modern javascript thing. tbh i don't actually use immutablejs much, i made a memoizing version of the redux-saga call() effect that uses an immutable map keyed by immutable lists to maintain its cache and that's about it.

i guess i'll stick with typescript and deal with the integration warts then. i'm just wary about interacting with a library developed by Group A via a condom written by Group B because 10/10 times that's a recipe for pain. whether that's "stubbed toe" pain or "dental abscess" pain remains to be seen.

Sapozhnik
Jan 2, 2005

Nap Ghost
still paralyzed by indecision lol

i've done a complete and utter 180 on the file extension thing in the space of like 2hrs because there's a whole bunch of poo poo like jsx or es2015 or type annotations that you can mix and match into your toolchain and you're not going to stick all those things into the file extension

flow is also strictly just a type checker. there is a completely separate babel plugin that just strips out all the type annotations without checking them. and you slot that in amongst all the other babel plugins that implement jsx, transpile es2017 down to es5, do the css import magic, etc etc. this feels very right on a fundamental level.

typescript is a transpiler, and you then feed its output into another transpiler (babel). ts has a lot of overlap with what babel does but babel is a lot more powerful. this seems strictly worse than the way that flow does its thing and it bugs the crap out of me.

e: oh and i got it to compile and something went wrong at runtime but it spit out a backtrace showing the typescript-transpiled code instead of my typescript code. naaaa gently caress this, flow it is. i'll hold my nose and deal with atom i guess. urgh.

Sapozhnik fucked around with this message at 01:32 on Oct 9, 2017

Sapozhnik
Jan 2, 2005

Nap Ghost
let's see what the fortune cookie says

Adbot
ADBOT LOVES YOU

Sapozhnik
Jan 2, 2005

Nap Ghost
apparently nothing because these posts are getting blackholed now

here, i decided to be the change i wanted to see in the world:

https://forums.somethingawful.com/showthread.php?threadid=3836929

  • Locked thread