New around here? Register your SA Forums Account here!

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.
 
  • Post
  • Reply
JawnV6
Jul 4, 2004

So hot ...

DuckConference posted:

is there some sort of tool or cheat sheet for doing like a reverse syntax lookup for c++?

as in “yes this sequence of names, colons, braces, and brackets is defining a something that inherits from something and something and the overrides something and then...”

something like https://cdecl.org ?

Adbot
ADBOT LOVES YOU

redleader
Aug 18, 2005

Engage according to operational parameters

CPColin posted:

We should start pretending that they're called "unit" tests because you work on them, together with the rest of the functionality, as a "unit".

noice

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

Doom Mathematic posted:

You're in luck! Parsing C++ source code is famously straightforward.

this is one cruel post

abraham linksys
Sep 6, 2010

:darksouls:
do people who hate the concept of javascript frameworks also write all of their web apps with no abstractions between them and a standard library http api or what

Ellie Crabcakes
Jan 31, 2008

Stop emailing my boyfriend Gay Crungus

They don't hate the concept, they hate the execution. It's like saying someone hates the concept of being fingered when it's pretty much just Freddy Kreuger and a velociraptor available to do the deed.

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.

Doom Mathematic posted:

You're in luck! Parsing C++ source code is famously straightforward.

:five:

Peeny Cheez posted:

They don't hate the concept, they hate the execution. It's like saying someone hates the concept of being fingered when it's pretty much just Freddy Kreuger and a velociraptor available to do the deed.

:ck5:

mystes
May 31, 2006

Nah this was too tasteless, sorry.

mystes fucked around with this message at 23:20 on Oct 19, 2018

TheFluff
Dec 13, 2006

FRIENDS, LISTEN TO ME
I AM A SEAGULL
OF WEALTH AND TASTE
writing any kind of moderately complex gui app is a pain in the rear end in pretty much any plang I can think of. javascript as a language is bad but you can't really blame it for the fact that managing a spaghetti mess of stateful garbage is just really obnoxious in general.

DELETE CASCADE
Oct 25, 2017

i haven't washed my penis since i jerked it to a phtotograph of george w. bush in 2003
it doesn't have to be stateful, you're just unwilling to reload the drat page, because you're building poo poo that shouldn't exist

mystes
May 31, 2006

DELETE CASCADE posted:

it doesn't have to be stateful, you're just unwilling to reload the drat page, because you're building poo poo that shouldn't exist
Isn't the whole reason that SPAs are so popular that it's much easier to be lazy and keep the state in the browser? At least SPAs are less horrible than that Seaside continuation bullshit that people keep reinventing.

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost
everyone is convinced everyone is gonna stay on the page for 4 hours when the empirics say 6 seconds and 3 of those seconds is loading the bigass spa

Main Paineframe
Oct 27, 2010

mystes posted:

Isn't the whole reason that SPAs are so popular that it's much easier to be lazy and keep the state in the browser? At least SPAs are less horrible than that Seaside continuation bullshit that people keep reinventing.

nah, it's just because they think it looks nicer

MrMoo
Sep 14, 2000

The main reason is zero-footprint and full functionality. Second place is probably the RAD and easy deployment.

State in the browser drastically simplifies the server side infrastructure and thus increases stability and performance.

Companies loving centralised certification management are a big hold back though for deployment of HTTPS-only features like service workers. Having to always work through a clunky F5 is a fluorescent monkey dance.

MrMoo fucked around with this message at 00:27 on Oct 20, 2018

Corla Plankun
May 8, 2007

improve the lives of everyone

TheFluff posted:

writing any kind of moderately complex gui app is a pain in the rear end in pretty much any plang I can think of. javascript as a language is bad but you can't really blame it for the fact that managing a spaghetti mess of stateful garbage is just really obnoxious in general.

i agree with this but i think everyone thinks their poo poo is "moderately complex" when actually almost nothing is

jira is literally just grouping and printing checklists but somehow that poo poo takes longer to load than my actual entire os does

H2Eau
Jun 2, 2010

DaTroof posted:

imo that's the #1 argument for using ci and writing unit tests first. more for the benefit of bureaucracy than the development process itself

if you tell management the feature works but you haven't written unit tests yet, they might tell you to skip it

if you tell them the build is broken, they'll panic and give it top priority

naive question, because I think I work at a place that is pretty good about this sort of stuff - is it normal at a lot of places for management to interfere and dictate how delivery teams get the work done?
where I work I'd be in the poo poo for not adequately testing, and i never get told directly what to do and how to do it

Corla Plankun
May 8, 2007

improve the lives of everyone
"oh dang is jira down--oh nvm its just inexplicably taking 45 seconds to load a list of four textboxes with 40px avatars abutted"
- me every single morning at my job

abraham linksys
Sep 6, 2010

:darksouls:
i remember asana and slack were two companies that were very publicly proud of having home rolled their own JS frameworks, and of course they both became monstrous and awful, and now they're both being/were rewritten in react, so that's cool

github also did this with atom (though tbf i think they actually rewrote the main editor in react and then once again back to vanilla js because of perf issues, but, yknow, don't build a loving text editor core in a framework that isn't specifically optimized for that) and going all in on turbolinks of all fuckin things for the main site

abraham linksys fucked around with this message at 00:42 on Oct 20, 2018

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.

abraham linksys posted:

i remember asana and slack were two companies that were very publicly proud of having home rolled their own JS frameworks, and of course they both became monstrous and awful, and now they're both being/were rewritten in react, so that's cool

github also did this with atom (though tbf i think they actually rewrote the main editor in react and then once again back to vanilla js because of perf issues, but, yknow, don't build a loving text editor core in a framework that isn't specifically optimized for that) and going all in on turbolinks of all fuckin things for the main site

Honest question coming from a place of pure ignorance: what's wrong with turbolinks? Sounds like a reasonable compromise between a "one HTTP request per view" back-end and a "walks like an SPA, quacks like an SPA" frontend

abraham linksys
Sep 6, 2010

:darksouls:

prisoner of waffles posted:

Honest question coming from a place of pure ignorance: what's wrong with turbolinks? Sounds like a reasonable compromise between a "one HTTP request per view" back-end and a "walks like an SPA, quacks like an SPA" frontend

this analogy is a bit of a stretch, but turbolinks is kinda like the css cascade in one of those things that works out very well for the people who put a lot of time and thought into working with it, and terribly for the other 90% of people

basically: the kind of javascript code people usually want to write for server-rendered, "stateless" (or, more accurately, "short-lived") pages tends to be very "throw some event listeners down and forget about it," whereas turbolinks breaks this idea on a pretty fundamental level

i'm far from a rails expert, but my understanding is that the traditional turbolinks experience is "everything works totally fine until suddenly you transition pages and get a completely baffling javascript error caused by stale state." this article covers some of the issues, and their workaround is a significantly different way of writing your frontend code, which... is fine, except the whole selling point of turbolinks was to not have to write your frontend code differently

and i mean, everyone here who has used the github web interface, especially prior to like 2016 or so, has encountered the common bugs with turbolinks and PJAX-style solutions, where things don't load correctly and don't have error states (because turbolinks means you're not supposed to have to think about it!), or you hit back mid-navigation and the page gets in a hosed up state, etc. these are totally issues in other SPA architectures, but turbolinks seems unique in not giving you the tools to reason about it

i am still sort of interested in pjax-style solutions, but you just need a lot more stuff to make it robust. hell, even turbolinks now has a "sister framework" (launched less than a year ago!) called stimulus that's supposed to be a framework for working with server-rendered html, which is a fantastic idea for turbolinks/pjax, but one that you had to roll yourself until now, and... thus, more jquery spaghetti was born, and in addition to being bad code from the outside was harder to debug because of the pjax stuff happening, and ugh

(currently ripping turbolinks out of our admin panel due to some long-standing bugs we uncovered after i added production frontend error reporting on my 3rd day at work, egh)

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.
Yeahhh, "pretend that this not-at-all a pageloar behaves the same as a pageloar" seems like a recipe for making lots of poo poo break

akadajet
Sep 14, 2003

cjs: trying to convince web developers they shouldn't send 10-20 megs of json documents to the web browser and then build a full text index off of that instead of implementing server side search.

AggressivelyStupid
Jan 9, 2012

akadajet posted:

cjs: trying to convince web developers they shouldn't send 10-20 megs of json documents to the web browser and then build a full text index off of that instead of implementing server side search.

jesus loving christ

akadajet
Sep 14, 2003

AggressivelyStupid posted:

jesus loving christ

i wish i were exaggerating :(

AggressivelyStupid
Jan 9, 2012

I had a fit when we delivered a 4-5mb js bundle at my first job, got it down under a mb but goddamn

akadajet
Sep 14, 2003

AggressivelyStupid posted:

I had a fit when we delivered a 4-5mb js bundle at my first job, got it down under a mb but goddamn

It's like people don't realize that 3g internet is still a thing, and this is an app that needs to work in those conditions.

Main Paineframe
Oct 27, 2010
reminds me of the time i was told to see what i could do to improve the performance of a web frontend because everyone thought the javascript was taking too long to load and display stuff

after i examined it to see what was going on, i responded that i wasn't going to bust my rear end cutting a few ms off the javascript when the server was taking literally ten full seconds to respond to requests

akadajet
Sep 14, 2003

Main Paineframe posted:

reminds me of the time i was told to see what i could do to improve the performance of a web frontend because everyone thought the javascript was taking too long to load and display stuff

after i examined it to see what was going on, i responded that i wasn't going to bust my rear end cutting a few ms off the javascript when the server was taking literally ten full seconds to respond to requests

I wish the call to pull down this data only took 10 seconds. It's nuts.

Ellie Crabcakes
Jan 31, 2008

Stop emailing my boyfriend Gay Crungus

akadajet posted:

cjs: trying to convince web developers they shouldn't send 10-20 megs of json documents to the web browser and then build a full text index off of that instead of implementing server side search.
make their deaths and move to Belize.

Arcsech
Aug 5, 2008

akadajet posted:

cjs: trying to convince web developers they shouldn't send 10-20 megs of json documents to the web browser and then build a full text index off of that instead of implementing server side search.

i dare you to suggest using a transpiler on lucene and sending that down to the client to build the index

akadajet
Sep 14, 2003

Arcsech posted:

i dare you to suggest using a transpiler on lucene and sending that down to the client to build the index

lol no. it's its own thing

but they did try this first
https://lunrjs.com/

Arcsech
Aug 5, 2008

akadajet posted:

lol no. it's its own thing

but they did try this first
https://lunrjs.com/

lol i found that googling to see if someone had already done that right after i posted

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





people write SPAs in complicated frameworks because users want mobile app like features, complexity and performance in the browser. if you're writing your blog in react you're probably overengineering it but if you're trying to deliver something like gmail or asana or even something fairly simple like youtube you quickly reach a place where the complexity of managing a specific client's state becomes way more tractable with something like react than with something like rails + turbolinks

Space Whale
Nov 6, 2014

Luigi Thirty posted:

they tried using all of azure but find->replace on every racial slur would have taken until the heat death of the universe

holy necro reply but:

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

I've seen some incredible programming to stop people from using dirty words.
And I have seen it in the name of a talking banana.

Space Whale
Nov 6, 2014
So I think my boss is too "paranoid of security" to let me do security audits
:q:

"Kali is DANGEROUS man!!!"

Yes I will literally launch loving skynet,

Space Whale
Nov 6, 2014
I also somehow on my own frankenstein's monster'd a website together except it's two 'branches' that diverged some 2 years ago. And it's an ancient ASP.NET and jQuery as gently caress monster mash of a web app.

Fuckin Spooky.

Also it's going to become customer facing when it really wasn't before except in minimal ways and there's basically no manpower to do security audits or even get security requirements :psyduck:

Did I mention this is aviation related?

HoboMan
Nov 4, 2010

i just want to loving make stuff, not spend literal days debugging my dang toolchain

VikingofRock
Aug 24, 2008




So I generally think boost libraries (with some notable exceptions) are pretty usable, if a little over-engineered and quirky. But boost::filesystem in contrast seems really under-engineered and full of surprises. For example, I'm trying to write a function which copies a few directories recursively. It seems like the copy itself should be as simple as:

C++ code:
fs::copy(source, destination);
But that runs into this wild segfault. Okay though, that seems like it might be apple's fault, so we won't hold it against boost::filesystem. And there's a workaround:

C++ code:
fs::copy(source, destination, ec);
if (ec) {
    throw std::runtime_error(std::string("Error copying ")
    + source.native() + " to "
    + destination.native() + ": "
    + ec.message());
}
Except that doesn't do what you think it does. When copying directories (like source and destination), boost::filesystem doesn't actually recursively copy the directory (like you would expect), but instead just creates a new directory at the destination with the same attributes as the source directory.

...Fine, we can work around that again.

C++ code:
for (auto& entry: fs::recursive_directory_iterator(source)) {
    auto relative_dest = entry
        .path()
        .lexically_relative(source)
        .lexically_normal();
    auto absolute_dest = destination / relative_dest;
    fs::copy(entry.path(), absolute_dest, ec);
    if (ec) {
        throw std::runtime_error(std::string("Error copying ")
        + source.native() + " to "
        + destination.native() + ": "
        + ec.message());
    }
}
Why make such a simple function so complicated?

(and no, I can't use std::filesystem from c++17, since it's been an uphill struggle making sure that I can count on c++11 being present on all the machines I want to run this on)

Main Paineframe
Oct 27, 2010

Space Whale posted:

I also somehow on my own frankenstein's monster'd a website together except it's two 'branches' that diverged some 2 years ago. And it's an ancient ASP.NET and jQuery as gently caress monster mash of a web app.

Fuckin Spooky.

Also it's going to become customer facing when it really wasn't before except in minimal ways and there's basically no manpower to do security audits or even get security requirements :psyduck:

Did I mention this is aviation related?

high-five, garbage aviation-related software buddy

hopefully you'll get lucky and it'll take the customers a couple years to realize there's no security

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

VikingofRock posted:


(and no, I can't use std::filesystem from c++17, since it's been an uphill struggle making sure that I can count on c++11 being present on all the machines I want to run this on)

also i'm pretty sure cpp17 std::filesystem is just boost::filesystem



i think this behavior is kind of correct though? i guess my go to comparison is python: the copy operation (and unlink operation) are in os, but copying or removing trees are in shutil - and they have a couple different variants for surprising behavior like symlinks or attributes (or xattrs in the case of OSX). it's a filesystem library, not a shell library.

Phobeste fucked around with this message at 15:06 on Oct 20, 2018

Adbot
ADBOT LOVES YOU

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.
If a boost library could provide a "perfect granular control of everything" API but also a "common use cases, do what I mean" API, there's an abnormally good chance they'll leave the latter as an exercise for the library consumer

e: blah blah blah burden of trying to be header-only

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply