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
NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

Shaggar posted:

but why store it as the serialized xml? normalize that poo poo

usually yes, but once in a while you can't normalize it and a serialized object column is the next best option. the alternatives are so much worse

normalized data in atomic columns > serialized object column > entity-attribute-value table > half-assed homemade string concatenation and conversion mess > unspeakable horror that most closely resembles a stack-based Polish calculator for logic rules in the form of indexed sql rows

NihilCredo fucked around with this message at 17:26 on Oct 11, 2017

Adbot
ADBOT LOVES YOU

Notorious b.s.d.
Jan 25, 2003

by Reene

Shaggar posted:

why would you store serialized data in your database at all?

sometimes you are gonna be storing full xml documents, and there are three places you can do that

  1. the filesystem

  2. an awful nosql/object store

  3. a real database

storing them in the database has the advantage that now in addition to simple search/retrieval, you can also reference xml data from regular old queries that primarily access fully normalised data

it's not an ideal situation but it beats the hell out of the other two options

Flat Daddy
Dec 3, 2014

by Nyc_Tattoo

MononcQc posted:

I'd be down for a new generation of web browsers that are all about static sites with no JS and very limited design capabilities. Bring back document-based web.

good use of SPA - being able to manipulate and maintain page state while also loading new data. like to keep scroll position or user input. e.g. the web app for myfitnesspal would be better with more SPA features. there are forms that include paginated lists I might want to flip through for reference. but if I do I'll lose what I've entered so far in the form on the page.

bad use of SPA - everything else on the web

Flat Daddy
Dec 3, 2014

by Nyc_Tattoo
you jcan make a non sucky SPA where the users cant tell its a SPA. so you just get the pure advantages of partial page updates, async form validation, getting to use react for both partial & full page updates & server side rendering with shared code (rather than some janky combo of jquery and a server side template lang), etc.

ajax was supposed to (and still can) make the web a more responsive ui. its just that spa frameworks dont come out of the box forcing you to do the right thing, so """web""" """"""developers"""""""" half rear end things like handling of all possible async states, proper url routing that doesnt break nav controls and linking, not making dynamic forms janky, etc. you have to come up with all this stuff on your own.
web devs just seem more concerned with coming up with 1000 libraries to not have to type as much (stylus, jade, pug, coffeescript)

Flat Daddy fucked around with this message at 18:00 on Oct 11, 2017

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
i forked left-pad because i needed another parameter so now we pull the new left-pad from a local repo here

jony neuemonic
Nov 13, 2009

Flat Daddy posted:

its just that spa frameworks dont come out of the box forcing you to do the right thing, so """web""" """"""developers"""""""" half rear end things like handling of all possible async states, proper url routing that doesnt break nav controls and linking, not making dynamic forms janky, etc. you have to come up with all this stuff on your own.
web devs just seem more concerned with coming up with 1000 libraries to not have to type as much (stylus, jade, pug, coffeescript)

"batteries included" is ember's entire reason for existing and it's a shame it's not more popular.

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost

jony neuemonic posted:

"batteries included" is ember's entire reason for existing and it's a shame it's not more popular.

does it still have the problem where if you go 2 inches out of the happy path everything goes to hell

e: serious question. last time i worked with that poo poo was in 2014

jony neuemonic
Nov 13, 2009

bob dobbs is dead posted:

does it still have the problem where if you go 2 inches out of the happy path everything goes to hell

e: serious question. last time i worked with that poo poo was in 2014

i haven't done anything complicated enough to go off the happy path tbh, but i suspect it's probably still not a great idea.

LordSaturn
Aug 12, 2007

sadly unfunny

quiggy posted:

i get that it's valid c but it's loving obnoxious that g++ won't even throw a warning for that one. i had a construct like this:

code:
for (const char* cp = str; *cp != '\0'; ++cp) { }
which is a perfectly valid way of iterating through a c-string right up until you gently caress up and forget to dereference cp in the ending conditional and the whole thing blows up

ah, my old nemesis

code:
void shutdownCallback( bool* processKillMe )
{
   // please don't, I need to do some hardware stuff
   startDoingHardwareStuff();
   processKillMe = FALSE;
}

quiggy
Aug 7, 2010

[in Russian] Oof.


LordSaturn posted:

ah, my old nemesis

code:
void shutdownCallback( bool* processKillMe )
{
   // please don't, I need to do some hardware stuff
   startDoingHardwareStuff();
   processKillMe = FALSE;
}

:rip:

VikingofRock
Aug 24, 2008




quiggy posted:

i get that it's valid c but it's loving obnoxious that g++ won't even throw a warning for that one. i had a construct like this:

code:
for (const char* cp = str; *cp != '\0'; ++cp) { }
which is a perfectly valid way of iterating through a c-string right up until you gently caress up and forget to dereference cp in the ending conditional and the whole thing blows up

My g++ (7.2.0) will actually throw a hard error there:

C++ code:
#include <iostream>

int main() {
    int * p = 0;
    std::cout << (p == '\0') << std::endl;
}
pre:
$ g++ test.cpp -o test
test.cpp: In function 'int main()':
test.cpp:5:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
     std::cout << (p == '\0') << std::endl;

quiggy
Aug 7, 2010

[in Russian] Oof.


VikingofRock posted:

My g++ (7.2.0) will actually throw a hard error there:

C++ code:
#include <iostream>

int main() {
    int * p = 0;
    std::cout << (p == '\0') << std::endl;
}
pre:
$ g++ test.cpp -o test
test.cpp: In function 'int main()':
test.cpp:5:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
     std::cout << (p == '\0') << std::endl;

well mine doesn't, so there :colbert:

redleader
Aug 18, 2005

Engage according to operational parameters
knockoutjs debugging guide:
does it have enough parentheses? add more parentheses
does it have too many parentheses? remove some parentheses

parentheses

akadajet
Sep 14, 2003

it's 2017, why are you using knockoutjs?

VikingofRock
Aug 24, 2008




quiggy posted:

well mine doesn't, so there :colbert:

update your software OP

More seriously, does -Wconversion catch that on your g++? I would imagine it should, but I could see '\0' implicitly being given a pointer type to begin with and thus not being "converted".

quiggy
Aug 7, 2010

[in Russian] Oof.


VikingofRock posted:

update your software OP

More seriously, does -Wconversion catch that on your g++? I would imagine it should, but I could see '\0' implicitly being given a pointer type to begin with and thus not being "converted".

ah, here we go

code:
$ g++ -std=c++03 test.cpp
$ g++ -std=c++11 test.cpp
test.cpp:5:21: error: comparison between pointer and integer ('int *' and 'int')
    std::cout << (p == '\0') << std::endl;
                  ~ ^  ~~~~
1 error generated.
my c++03 hellworld strikes again

VikingofRock
Aug 24, 2008




quiggy posted:

ah, here we go

code:
$ g++ -std=c++03 test.cpp
$ g++ -std=c++11 test.cpp
test.cpp:5:21: error: comparison between pointer and integer ('int *' and 'int')
    std::cout << (p == '\0') << std::endl;
                  ~ ^  ~~~~
1 error generated.
my c++03 hellworld strikes again

goondolences

I'm always shocked at how much C++11 improved things. I haven't looked into C++17 much yet, but hopefully it is a similar leap in quality.

HoboMan
Nov 4, 2010

lol at the php-level gcc settings of Wall and Wextra

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
on clang don’t forget -Weverything!

(don’t use -Weverything)

JewKiller 3000
Nov 28, 2006

by Lowtax
gcc -Wall -Wextra -pedantic --yes-i-want-all-the-warnings --if-its-a-warning-then-loving-enable-it -o horseshit garbage.c

Shaggar
Apr 26, 2006

akadajet posted:

it's 2017, why are you using knockoutjs?

knockoutjs is the least bad client side rendering library

brap
Aug 23, 2004

Grimey Drawer
knockoutjs is much worse than react+typescript but it's alright for small stuff. although I'd like to know if anyone is doing knockout without having to embed unchecked javascript code into html attributes because that's the only way I've really seen it done.

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
imagine being a javascript graybeard.

who will be the RMS of web front end bullshit?

VikingofRock
Aug 24, 2008




JewKiller 3000 posted:

gcc -Wall -Wextra -pedantic --yes-i-want-all-the-warnings --if-its-a-warning-then-loving-enable-it -o horseshit garbage.c

More like

gcc -Wall -Wextra -pedantic --yes-i-want-all-the-warnings --if-its-a-warning-then-loving-enable-it --okay-actually-i-do-not-care-about-implicit-padding --nor-do-i-care-about-iso-c-compatibility --nor-double-promotion --nor-y2k-formatting --and-strict-overflow=5-is-completely-ridiculous-for-most-use-cases -o horseshit garbage.c

VikingofRock fucked around with this message at 00:56 on Oct 12, 2017

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

VikingofRock posted:

goondolences

I'm always shocked at how much C++11 improved things. I haven't looked into C++17 much yet, but hopefully it is a similar leap in quality.

not as big but a huge usability improvement. template parameter deduction has been finally extended to classes, poo poo like make_tuple or make_pair is no longer necessary. tuple expansion is native, no longer a library function. you could already map variadic template argument lists, now you can also reduce with any binary operator. the stl finally has long overdue essentials like optional, any, variant, string_view, gcd/lcm and the filesystem library. parallelized variants of algorithms

Slurps Mad Rips
Jan 25, 2009

Bwaltow!

Sapozhnik posted:

some wunderkind on the c++ committee thought that "ptr == 0" looked more aesthetically pleasing than "ptr == NULL"

then everybody else belatedly realized that this person is a loving moron so now there's a built in type called nullptr_t or something

except that the == 0 thing still works and of course '\0' is equivalent to 0

c++ is such a trash fire

lol, no they didnt. its because int* x = NULL doesn't work when you #define NULL (void*)0 in C++, but does in C because you can assign any void* implicitly in C and in C++ you need to explicitly cast it.

Main Paineframe
Oct 27, 2010

akadajet posted:

IE11 is super out of date wrt web standards and you know it.

the enterprise doesn't give a poo poo about web standards, though. they want to continue to run their dumb Java 6 applets and ActiveX garbage until the CTO dies of old age, and they're used to just telling clients not to use other browsers

also there are a bunch of weird edge cases that Edge doesn't handle properly, and reporting bugs to MS is an order of magnitude more difficult than with the other major browsers

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av
I wonder why it took them so long to come up with nullptr. if you wrote a smart pointer class and you wanted to make NULL assignable to it, guess how you had to do it?
C++ code:
fart_ptr& operator=(int) { // ayeeep
    reset();
    return *this;
}
except now you can assign any int to it, variable or constant, zero or not :bravo:

VikingofRock
Aug 24, 2008




hackbunny posted:

not as big but a huge usability improvement. template parameter deduction has been finally extended to classes, poo poo like make_tuple or make_pair is no longer necessary. tuple expansion is native, no longer a library function. you could already map variadic template argument lists, now you can also reduce with any binary operator. the stl finally has long overdue essentials like optional, any, variant, string_view, gcd/lcm and the filesystem library. parallelized variants of algorithms

Sounds pretty good to me! Very cool.

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av
whereas nullptr is a singleton, and you can explicitly match for its unique type. what took them so long? they already used very similar singletons for the non-throwing new operator and tag based dispatch

MononcQc
May 29, 2007

CRIP EATIN BREAD posted:

imagine being a javascript graybeard.

who will be the RMS of web front end bullshit?

in JS land, you're a graybeard for using a 2 years old framework

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

CRIP EATIN BREAD posted:

imagine being a javascript graybeard.

who will be the RMS of web front end bullshit?

not a graybeard, a graystache

(probably waxed)

Glorgnole
Oct 23, 2012

i am once again rebuilding opencv from source because i forgot to include the path to the 3rd-party modules last time 2 months ago, whoops!

VikingofRock
Aug 24, 2008




Okay I'm reading through the C++17 changes and a bunch of these are very neat. My favorite so far (that hackbunny didn't mention) is attributes, which I had previously only run into in Rust. Being able to mark intentional switch-statement fallthrough as [[fallthrough]] (to suppress warnings when this is intentional) and being able to mark functions as [[nodiscard]] (to ensure that their return is used) are excellent.

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av
standard attribute syntax isn't new, c++11 already had [[noreturn]]

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av
oh right! another new c++17 feature is if constexpr, basically type-safe #ifdef. previously only achievable with gross template contortions

VikingofRock
Aug 24, 2008




hackbunny posted:

standard attribute syntax isn't new, c++11 already had [[noreturn]]

Huh, somehow I had missed that.

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av
and __has_include is now standard in the preprocessor! here's the full list: http://en.cppreference.com/w/cpp/compiler_support

jony neuemonic
Nov 13, 2009

long as we're dorking out on c++ what are people's thoughts on vcpkg? i set it up last night to grab sdl and catch, seems to do what it says on the tin well enough.

Adbot
ADBOT LOVES YOU

Slurps Mad Rips
Jan 25, 2009

Bwaltow!

jony neuemonic posted:

long as we're dorking out on c++ what are people's thoughts on vcpkg? i set it up last night to grab sdl and catch, seems to do what it says on the tin well enough.

it's fine, I guess, if you're only using msvc

hackbunny posted:

whereas nullptr is a singleton, and you can explicitly match for its unique type. what took them so long? they already used very similar singletons for the non-throwing new operator and tag based dispatch

hell if know. remember it was standardized before 9/11 and also when FRIENDS was in its 4th season. it was a different time.

Slurps Mad Rips fucked around with this message at 02:05 on Oct 12, 2017

  • Locked thread