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
KoRMaK
Jul 31, 2012



lol I just took a report that used to run 40+ minutes down to ~2mins

I made the original report
i made the optimized report

I am a bad programmer not really, mgmt just didnt point me towards spending time optimizing

Adbot
ADBOT LOVES YOU

leftist heap
Feb 28, 2013

Fun Shoe

KoRMaK posted:

lol I just took a report that used to run 40+ minutes down to ~2mins

I made the original report
i made the optimized report

I am a bad programmer not really, mgmt just didnt point me towards spending time optimizing

what technology?

what was the problem?

Shaggar
Apr 26, 2006

Malcolm XML posted:

c# has operator overloading homeboy

gross

oh no blimp issue
Feb 23, 2011

i cant think of a reason to use operator overloading unless i was making a maths library or something

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

functors, smart pointers, int-vs-float math, drop-in checked arrays

oh no blimp issue
Feb 23, 2011

beyond the obvious things theyre already used for

comedyblissoption
Mar 15, 2006

optional typing in a dynamically typed language for reasons beyond performance is an absurdity and the product of a deviant mind

MononcQc
May 29, 2007

yes, and tests that are not there to seed the JIT into being fast earlier are also useless obviously.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

comedyblissoption posted:

optional typing in a dynamically typed language for reasons beyond performance is an absurdity and the product of a deviant mind

type specialization is good enough these days that you don't use typing for speed in most cases. you use it to tell the compiler and runtime that there are some invariants that you're going to depend on and could it please scream if they're violated. you have to be fast on untyped code anyway, after all. (and in fact optional typing can make it harder to be fast, because you have to check types more eagerly than you might with a strong JIT.)

Awia posted:

beyond the obvious things theyre already used for

smart pointers weren't a trivially obvious application, IMO, but if you want something nobody has thought of then I'm going to have trouble coming up with one

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
what token should i use for my very quick and lovely bespoke html templating thing for crystal

comedyblissoption
Mar 15, 2006

Subjunctive posted:

type specialization is good enough these days that you don't use typing for speed in most cases. you use it to tell the compiler and runtime that there are some invariants that you're going to depend on and could it please scream if they're violated.
my main point is that it's baffling to see the value in enforcing invariants but then forego them almost everywhere

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

your point didn't sound like that at all, but lots of programming models have features that are more useful in some parts of a program than another. you don't write everything in assembly, but you might for the core loop. you would want to put a parser handling untrusted content in a sandbox, but probably not worth it for your command-line argument handling. I might choose to type my API boundaries but not inside (perhaps for better perf internally!), for example, just like I might write extensive docs for that API and not for the internals. or I might choose to use types in all of my code, but still employ others' libraries whose authors prefer untyped code. or just migrate gradually, as we've done with hack to substantial success.

VikingofRock
Aug 24, 2008




Awia posted:

beyond the obvious things theyre already used for

I mean writing a functor is a great example of operator overloading being useful to pretty much everyone (you want to overload operator()). Also writing a class which represents a grid of some sort (you want to overload operator[]). Also implementing an iterator (you want to overload operator++ and operator*, and maybe more depending on the type of iterator). Also implementing some type of custom math thing is not really *that* uncommon--I've did it earlier this year when I implemented a "data point with gaussian errors" class.

Basically operator overloading rocks, and just because some people will abuse it doesn't mean it shouldn't exist in a language.

leftist heap
Feb 28, 2013

Fun Shoe

VikingofRock posted:


Basically operator overloading rocks, and just because some people will abuse it doesn't mean it shouldn't exist in a language.

wrong and wrong

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

operator overloading means that user types can participate fully in the language semantics, alongside builtin types

most code won't need it, but the code that needs it will really benefit from it (like volatile in C, perhaps)

VikingofRock
Aug 24, 2008




rrrrrrrrrrrt posted:

wrong and wrong

I mean people will abuse literally anything you put in a language. I'm pretty sure you could figure out a way to abuse brainfuck and that only has eight possible operations. Also, there's nothing stopping you from doing whatever you want in a function called add(), so why is doing whatever you want in a function called operator+() any different?

JewKiller 3000
Nov 28, 2006

by Lowtax

comedyblissoption posted:

my main point is that it's baffling to see the value in enforcing invariants but then forego them almost everywhere

it happens because they only saw the value in enforcing invariants after they had already accumulated a codebase where they are foregone almost everywhere, and now they want to go back and patch things over rather than rewrite everything in a sane language

Bloody
Mar 3, 2013

what does multiplying an iterator do and why it that an obvious good case for operator overloading

JewKiller 3000
Nov 28, 2006

by Lowtax

Bloody posted:

what does multiplying an iterator do and why it that an obvious good case for operator overloading

it's not multiplication, it's unary * for pointer dereference, because the iterator is like a pointer you see, because we're c programmers and all we know how to do is increment a pointer in a loop to traverse an array

Bloody
Mar 3, 2013

lol

VikingofRock
Aug 24, 2008




I'm pretty sure an iterator is literally worthless if you can't dereference it (or use operator-> or whatever).

JewKiller 3000
Nov 28, 2006

by Lowtax
http://docs.oracle.com/javase/7/docs/api/java/util/Iterator.html literally worthless

brap
Aug 23, 2004

Grimey Drawer
lol also overloading the dereference operator for a reference type..that's hosed up dude

brap
Aug 23, 2004

Grimey Drawer
operators are basically good. they make code more readable when used correctly. overloading operators when it makes sense like + for Points or Vectors or whatever is fine.

bobbilljim
May 29, 2013

this christmas feels like the very first christmas to me
:shittydog::shittydog::shittydog:

Notorious b.s.d. posted:

what jvm is that ?

it's called "phoneme " and it was made by oracle themselves. or sun.. i forget how that works

VikingofRock
Aug 24, 2008





Isn't next() is doing the same thing as dereferencing it?

Catalyst-proof
May 11, 2011

better waste some time with you

Janitor Prime posted:

Why does everyone forget Perl :( it's much better than bash

:barf:

Arcsech
Aug 5, 2008

Janitor Prime posted:

Why does everyone forget Perl :( it's much better than bash

"it's better than bash" is not a high bar

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

Arcsech posted:

"it's better than bash" is not a high bar

well yeah but my point is that why would you ever choose bash, even poo poo old *nix have perl

Catalyst-proof
May 11, 2011

better waste some time with you

Janitor Prime posted:

well yeah but my point is that why would you ever choose bash, even poo poo old *nix have perl

why would you ever choose perl

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

horse mans posted:

why would you ever choose perl

because it's a practical language for extraction and reporting

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY
c terrible mathematician s: doing a stock prediction thing for interview homework

either the market they've picked these (anonymous) stocks from is very efficient or i am not very good at ML

compuserved
Mar 20, 2006

Nap Ghost

VikingofRock posted:

Are there any plotting libraries as good as matplotlib in languages besides Python?

ggplot2 is a great R plotting library

KoRMaK
Jul 31, 2012



rrrrrrrrrrrt posted:

what technology?

what was the problem?
ruby on rails

The main loop was n^3 or whatever (a loop, inside a loop, inside a loop)

I decided to flatten it by indexing and caching all the relevant data that was cuasing the second and third loop and just refer to that index. I was instantiaing objects too many times

comedyblissoption
Mar 15, 2006

JewKiller 3000 posted:

it happens because they only saw the value in enforcing invariants after they had already accumulated a codebase where they are foregone almost everywhere, and now they want to go back and patch things over rather than rewrite everything in a sane language
yeah but there's some people of the opinion that they like the idea of optional typing because they can start a new project with it and add the typing later when they feel they need it. again, this is absurd

optional typing makes a lot of sense for existing codebases

abigserve
Sep 13, 2009

this is a better avatar than what I had before

horse mans posted:

why would you ever choose perl

serious question what's wrong with perl all of a sudden

darthbob88
Oct 13, 2011

YOSPOS

abigserve posted:

serious question what's wrong with perl all of a sudden

Apart from the fact that it's executable line noise, because counter-argument, Haskell's infix operators.

OldAlias
Nov 2, 2013

abigserve posted:

serious question what's wrong with perl all of a sudden

it has a bad reputation. the main spots you'd go for perl knowledge are old as gently caress - design wise + if you aren't paying attention you're going to get advice from 15 years ago where people seemed to tolerate horseshit. perl is good at certain things and has been bludgeoned into other roles like any other plang. idk CPAN is at least sane to use.

leftist heap
Feb 28, 2013

Fun Shoe

darthbob88 posted:

Apart from the fact that it's executable line noise, because counter-argument, Haskell's infix operators.

lol, lens defense incoming!!

Adbot
ADBOT LOVES YOU

jony neuemonic
Nov 13, 2009

abigserve posted:

serious question what's wrong with perl all of a sudden

lots of things, but it still makes a fine glue lang so who cares. just don't write your application in it.

  • Locked thread