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.
 
  • Post
  • Reply
ultrafilter
Aug 23, 2007

It's okay if you have any questions.


xkcd today:

Adbot
ADBOT LOVES YOU

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


https://twitter.com/mattblaze/status/1034844783691190272

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Anybody who can do data science can learn SQL.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


You can store the CSVs from a given run, which makes reproducing/debugging significantly easier. If you're going to talk to the database directly, you'll need some way to recreate the state of the database at the time a model was run to reproduce the run.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


https://twitter.com/emilymhorsman/status/1037499651925127168

C++. My God.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


C++ is a coding horror.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Yeah, that looks like an attempt at template metaprogramming. Cool stuff if you can get it to work, but the official recommendation is to delete all your code and start over if there are any errors, so good luck actually using it.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


fritz posted:

Why would anybody do this to themselves :

code:
template<typename T>
class B: public C<B<T>,T,0> {
  // blah
}

class A: public B<A>{
  // blah
};


:iiam:

Loop unrolling is a legitimate use case for template metaprogramming. Everything else I've seen just feels like someone showing off how smart they are. Yeah, it's kinda cool that you can get the compiler to print an error message for every prime number less than some value, but who really cares?

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


OK, but explain the template parameters to B now.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Absurd Alhazred posted:

What's a language with good generics?

Haskell.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Are the powers that be open to process improvements and at least a little bit sane? If not, save your energy.

If so, you need to have some concept of a released version of a library. Instead of building against source, you build against the copy in some location that has versions of libraries that have been through a release process. And then you put all of the tests you want into the release process.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


LOOK I AM A TURTLE posted:

Haskell's generic programming features are basically perfect. My only complaint is the lack of some sort of variadic type parameter support for tuples. Haskell libraries always seem to end up with a series of functions/types called foo2, foo3, foo4, one for each tuple size. Look at this nonsense: https://hackage.haskell.org/package/lens-4.17/docs/Control-Lens-Tuple.html.

If you have nineteen elements in a tuple you should probably be using a record type. Maybe two.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Presto posted:

All right, but why doesn't it just say "The things you passed to std::find are not compatible"?

That is what it's saying.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Athas posted:

When you see code checking for NaNs, it is usually either really clever code or really stupid code.

Sounds like somebody's never written a quadratic program solver....

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


We settled on a standard style at work. I'm not wild about it, but I like having a style much better than I like having every file having a mix of styles, some of which might not be found anywhere else.

If you're using git, you can set up the formatter to run as a pre-commit hook, so you can write whatever you want and it goes in as the correct format.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


If your goal is to have your name cursed extra hard, then it's a great idea.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Joda posted:

Someone in my scrum team actually defended calling external web APIs inside of not only a database transaction, but a performance critical transaction.

Like in a "we should profile this and see if it's actually a problem" way, or an "obviously this is completely fine and there's something wrong with you if don't see that" way?

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Jazerus posted:

there's a certain type of company that would hire you on the spot if you made 4 classes to solve fizzbuzz

well, 5 might be better

Why stop at 5?

ultrafilter
Aug 23, 2007

It's okay if you have any questions.



This. Haskell is a perfectly good beginner's language, but the vast majority of tutorials and introductions are garbage. HFPP is not, and it's the right place to start.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


It sounds like at least a few of the Elm issues would be resolved if web assembly takes off and you can bypass Javascript. Is that a fair assessment?

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


double post

ultrafilter fucked around with this message at 01:03 on Jan 30, 2019

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


https://twitter.com/mattblaze/status/1034844783691190272

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Trying to understand the inner workings of anything Microsoft made in the 90s is a bad idea.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


RPATDO_LAMD posted:

IIRC C++ has so many syntax ambiguities that in mathematical terms the language is "undecidable".

I think C++ is decidable but hard to parse if you disallow templates. The problem is that templates are Turing complete, and that means that determining whether a given program is valid can require you to solve the halting problem.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


It's not that templates allow you to perform arbitrary computations; it's that they allow you to perform arbitrary computations *at compile time*. At some point someone implemented a piece of code that took an int n and produced error messages listing out all of the primes less than n, but I'm having trouble tracking that down.

ultrafilter fucked around with this message at 17:35 on Mar 16, 2019

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Volte posted:

Jesus, I didn't know that template instantiation happens during parsing. That is absolutely bizarre behaviour.

That's why the body of a template function has to be visible everywhere that it's called, and why templates are a very bad idea if you care about binary size.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


I think I heard that for C++17 or C++20 the standards committee gave up on telling vendors what they should add and just started picking out new features that the vendors had already added.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


The margin of error on a sample of 100 is 5%. With an observed probability of 93%, we can be pretty confident that the true proportion is over 80%.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


You say that, but lerzfijglpFiji-j is apparently Perl in moderation, and that's not fine.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Jeb Bush 2012 posted:

elon musk at the top and ajit pai at the bottom is very revealing

It's almost like these people have no idea how things actually work!

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Munkeymon posted:

Packing multiple declarations on to one line could save hundreds of byte of precious disk space on a large codebase!

That was probably a legit concern back in the day, along with fewer keystrokes to transcribe the program from the magazine or book

I'm not sure if any C programs were written on punch cards, but the language was probably designed with that use case in mind.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.



At one point, there was an obfuscated Perl contest.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Yeah, I couldn't help but be reminded of this the first time I saw that.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Today I learned that the IBM C++ linker only allocates 64k for its TOC unless you specify -bbigtoc on the command line. That's not a thing I should have to think about.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


If you compute the length of a list in Haskell you're probably doing something wrong.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


I'm sure someone will get fired over this.

Not anyone who actually deserves it, mind you, but someone will be for sure.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Write tests. Not too many. Mostly integration.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Something I've been thinking about lately is metamorphic testing, which involves looking at how the output of a function/program changes when the input changes. In a lot of cases it's much easier to reason about what those changes should be like than to figure out what the output should be for a given input.

I have a program that takes in a bunch of (x, y) coordinates and fits a curve to them. For various reasons, I can't use anything off the shelf, and as a result there really isn't any gold standard for what the answer should be. However, I know for a fact that if I go from (x, y) to (x, y + 1) that the output curve should move up by one as well. That's a very simple example (and the actual tests would be a bit more complicated), but I think it at least hints at how useful this is for the problems that I'm working with.

ultrafilter fucked around with this message at 19:03 on Jun 3, 2019

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


redleader posted:

tldr: software is hell, testing won't help, hail Satan.

Hail Satan.

Adbot
ADBOT LOVES YOU

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Floating point is hell, testing won't help, hail Satan.

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