|
I know some people who write modern idiomatic C++ and it is a terrifying sight to behold
|
![]() |
|
![]()
|
# ¿ Oct 3, 2023 08:28 |
|
this miserable pile of angle brackets and colons allegedly wraps a c function that uses setjmp/longjmp for error handling (lol libjpeg) such that it throws c++ exceptions instead and im not sure if it’s terrible or awesome maybe “awful” in the olde English sense is the word I’m looking for
|
![]() |
|
Slurps Mad Rips posted:This is actually pretty neat. setjmp/longjmp error handling in stuff like lua means you need to compile these C libraries as C++ just so destructors run and that's a nightmare. That said, this code is deffo c++11/c++14. result_of_t was deprecated in c++17 and removed for c++20. it's a few years old yeah. still, c++ generics just look like ![]() e: the same guy has also written a good deal of video dsp code that uses c++ templates in combination with assembler intrinsics and there's just something vaguely unsettling about that to me TheFluff fucked around with this message at 15:23 on Aug 16, 2018 |
![]() |
|
https://twitter.com/felixrieseberg/status/1032642127178547201 gary bernhardt's The Birth and Death of Javascript was intended and received as a joke, but it was actually incredibly on-point and deeply prophetic. this is the future now. dehumanize yourself and face to javascript
|
![]() |
|
laptops are the loving worst. if you work with computers your employer should at the very least have the god damned decency to provide you with a workstation - a real computer that can actually use its cpu without thermal throttling after thirty seconds, and that you can actually repair, not one of these small plastic toys urging you to bring work with you wherever you go. for too long we have accepted the mountain coming to muhammad as natural. physically leaving your desk should be equivalent to mentally leaving work behind. bringing your loving laptop with you is dysfunctional as gently caress.
|
![]() |
|
ban laptops
|
![]() |
|
or at least impose heavy tax penalties on them, gently caress
|
![]() |
|
Luigi Thirty posted:you write one template function in C++ and suddenly your whole world is internal compiler errors when it breaks ascended brain: uses C++ templates for generics galaxy brain: code:
|
![]() |
|
the first programming thing i learned was regular expressions. i was 9 or 10 years old at the time - my dad taught me. to this day i maintain that it really wasn't a bad place to start thinking abstractly about a single symbol being a representation of some other set of symbols. i didn't learn anything about state machines until over a decade later though.
|
![]() |
|
proponents of vim/emacs will claim that learning them properly lets you edit that much faster by learning keyboard shortcuts for everything and that anyone who wants to be good at touching computers should spend time to learn proper tools for it. these people also tend to be very mad about things like tab order in forms in various applications, etc. there also tends to be a strong overlap between these and people who complain about modern computers being slow. and sure, they have a point. if you learn an unintuitive keyboard interface well, you can get very fast at doing whatever it is designed to do. however, very few people actually want to spend a lot of time imprinting shortcuts for a very specific editor (probably with a very specific config too) into muscle memory, not even people who spend most of their work time with a single tool. in user interfaces, flexibility and intuitiveness has turned out to be far more important than how efficient you can get at using the interface if you spend a lot of time training with it.
|
![]() |
|
if you defend vim/emacs you are in the same boat as noted dead rear end in a top hat erik naggum, who in 1997 wrotequote:what makes _me_ sad is the focus on "most folks" and "Joe Sixpack".
|
![]() |
|
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.
|
![]() |
|
https://json-schema.org/
|
![]() |
|
cinci zoo sniper posted:i know about it. the real world adoption rate is 0, as far as i am concerned i provided schema files for an api we provided to an outside contractor but i don't think they used those i used it in our own tests though
|
![]() |
|
if you want a more expressive type system for your serialization format, just use protobufs. of course, it's not as portable, but that's the price you pay for complexity. in both xml and json you soon land in having to serialize almost everything as a string anyway.
|
![]() |
|
prisoner of waffles posted:hoo doggy temporal/system-versioned tables are extremely cool and good. I've only used them in production in MSSQL tho (where they come builtin these days), but the functionality is so loving useful and saves you a ton of time and manual wrangling if you have almost any kind of slowly-changing dimension or need for auditing or whatever. best thing is, you can just add it to an existing table and blammo, now you have change tracking for very little cost, while to any regular user the table appears and works exactly like it always did before. TheFluff fucked around with this message at 21:39 on Nov 1, 2018 |
![]() |
|
CRIP EATIN BREAD posted:Just keep in mind that jOOQ is NOT an ORM. It simply creates some implementations of a "Table" class that allows you to write SQL in typesafe manner. sqlalchemy for python also uses this philosophy, and it is good. watching django turn my elegant delete() on a queryset into a SELECT followed by an UPDATE to enforce an ON DELETE SET NULL constraint (why? the constraint is in the database! mind your own drat business and let postgres do its job!) finally followed by a DELETE makes me depressed. how on earth are you supposed to write transaction safe code with this kind of circus going on?! TheFluff fucked around with this message at 00:00 on Nov 2, 2018 |
![]() |
|
i have Opinions about sql
|
![]() |
|
Finster Dexter posted:What did you do with a postgres table before sql support? relational databases as a concept predate sql (of course - you don't write a dsl for querying databases if you don't have any databases to query), and the original postgres research project predates the sql standard as far as I know.
|
![]() |
|
re: julia, this is from 2014 but it's not encouraging
|
![]() |
|
https://twitter.com/garybernhardt/status/600783770925420546
|
![]() |
|
the empty freetext search box is the original sin of computer user interface design. such a simple and seemingly innocent thing, and yet it is a constant reminder of the monumental hubris of techbros. the foundation of human knowledge is not the nerd virtue of being able to remember endless bits of pointless trivia, but rather systematic classification. organizing and cataloging information is a skill as old as writing itself, and here we are supposed to ignore all advances in the field since the dawn of time and instead blindly hope we remember the incantation necessary to coax some idiot scoring algorithm into coughing up a somewhat related result. it is fundamentally anti-intellectual. death to freetext search, all hail archival science.
|
![]() |
|
Captain Foo posted:ok vannevar seriously though if anyone hasn't read As We May Think yet you should, it is good
|
![]() |
|
the search box is bad because it hampers association when a good search tool should encourage and exploit it is what vannevar bush would have said, and he would have been right
|
![]() |
|
ComradeCosmobot posted:as opposed to remembering the special incantation needed to remember where something is classified yospos is not the place to post nuanced takes but if i were in a charitable mood i guess i might concede that the problem is really more like having a freetext search as the only significant tool you can approach your index with
|
![]() |
|
gonadic io posted:stuff like slack now has free text field and the ability to set a bunch of parameters. it's not like i understand the core problem here well but that seems like a nice middle ground well, not really. if a search box lets you search for e.g. records in a given date range then that's very good but it's not the kind of free text box i'm harping about. free text search is a very blunt tool, or perhaps more aptly put, a way too sharp tool. it sorta works if you know exactly what you're looking for and can come up with sufficiently distinct keywords. it's almost useless for exploring a topic, finding related records, or cross referencing in general. again, it doesn't encourage association. one of the most heinous examples i can think of is spotify. their free text search is almost completely useless, of course, but what really pisses me off is that they have shittons of metadata that they do their best to stop you from exploring, because they want to show you their own "top recommendations" or whatever the gently caress the big record companies want you to listen to. perhaps it is more symptom than disease, though. it's a very common programmer thing to not really think about record classification or metadata and just shovel user input into unstructured text fields - if you're lucky you get both creation and update timestamps (but almost never previous versions), and then a free text search is really the only way to approach your dataset (you can't even speak of an index). a humble tagging system is a very powerful search tool, but only if the metadata is carefully curated and maintained - ask any librarian. really, computer nerds ought to talk more to librarians and archivists.
|
![]() |
|
why do people not use interactive debuggers? literally my first instinct when i'm asking myself "hey hold on what's going on here" is to launch a debugger on it. meanwhile when i'm pairing with my coworkers they, like, start running tests and adding print() statements to poo poo, and when i ask them "hey can you run it in a debugger" they go "uuuuh, haven't really gotten around to setting that up...". even really experienced people who are definitely better programmers than me do it. weirds me the gently caress out.
|
![]() |
|
efficient engineering teams are all alike; each dysfunctional team is dysfunctional in its own way. thanks all for you're posting on the human condition.
|
![]() |
|
bob dobbs is dead posted:they are all alike inasmuch they dont exist and even if they did exist they would not be worth telling stories about, was what ol' Tolstoy was trying to say
|
![]() |
|
there were many things that drove people to make everything a webapp but one of them is that native apps are only really native on one platform. writing good crossplatform gui apps that actually look and feel native on the supported platforms is a pain in the rear end. javascript is bad but so is wxwidgets.
|
![]() |
|
Powerful Two-Hander posted:sql server has a pivot function that can maybe be used for this to shift your rowset to columns so that an in() will work but I'll be damned if I know how to use it SQL code:
either way OP said he wanted an actual join so this doesn't even do what i think he wants. if you only want columns from one of the tables though (that is, you're using the join only to check for existence in the related table), then you should usually use a semi-join instead (usually written as WHERE EXISTS (subquery goes here)). it's easier for the planner to optimize, it doesn't duplicate, and it's usually easier to write if you have a complex join condition. TheFluff fucked around with this message at 14:32 on Nov 28, 2018 |
![]() |
|
i've seen a table with a TEXT column containing a string with comma separated ID's for related records. the application would load the record, deserialize the id's into a list and do a select from the related table where id in(![]()
|
![]() |
|
"it made sense at the time", i'll cry when justice finally finds me and drags me to the unesco tribunal for terrible programmers to answer for my crimes. when the new york times covers it they'll write something about the banality of evil, probably.
|
![]() |
|
Finster Dexter posted:Exciting headlines on hacker news today for the Go community (not to be confused with Go!) https://twitter.com/daemon404/status/1068195329890295808
|
![]() |
|
Kevin Mitnick P.E. posted:"template metaprogramming is worth it to avoid a 16-byte overheard wrapping an int into an EpollFd" C++ code:
|
![]() |
|
bob dobbs is dead posted:did you just tell me to gently caress myself parental advisory: explicit constructors
|
![]() |
|
AggressivelyStupid posted:what the goddamn gently caress source it's from a class (in c++ a struct is a class but with all members default public) representing an endian-independent unsigned 48-bit integer. the template voodoo is there to select the correct constructor depending on the machine's native byte order, so if you pass it a native uint64 it'll do the right thing automatically without having to branch at runtime. the constexpr thing tells the compiler this code can be evaluated at compile time, so you can use this 48-bit int where a constant expression that is known at compile time is required. it also does this while being a "POD", plain old datatype, binary compatible with C interfaces. i think. i'm not actually good at this, i just know people who expose me to this while claiming it has legitimate uses in video processing. i need to share the pain, sometimes. TheFluff fucked around with this message at 03:42 on Dec 3, 2018 |
![]() |
|
Soricidus posted:are there many computers left whose native byte order isn’t little endian? no, but arm can at least in theory be run as either endianness. not sure if anyone actually does that tho.
|
![]() |
|
my current job has all kinds of mildly terrible programming but one thing that absolutely owns is that when you make a PR you can click a button and it will spin up a full test env running that branch with a full test db and everything for you. when the branch is merged or the PR closed it automatically kills the test env. very needs suiting.
|
![]() |
|
![]()
|
# ¿ Oct 3, 2023 08:28 |
|
incredibly hot take: realtime systems exist
|
![]() |