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
tef
May 30, 2004

-> some l-system crap ->
OO is just a nicer way to have global variables but with a reduced scope

Adbot
ADBOT LOVES YOU

Flat Daddy
Dec 3, 2014

by Nyc_Tattoo

MALE SHOEGAZE posted:

react is dramatically better than every other js thing i've ever used and comically better than every frontend js framework

i dont even give a gently caress about shadowdoms or speed it's just really good at displaying things in the browser

really want to give relay/graphql a shot too

ive been working with angular for almost a year have an OK grasp i think. ive used react for a total of a couple days and it already makes way more sense. despite the small area covered by the library, i dont feel like im missing much. like so much of angular seems completely unnecessary to me

MALE SHOEGAZE posted:

elm is very cool but unlike react, there's almost no way i'm convincing anyone to start using it

there's a flux implementation/variation called Redux that turns FB flux into the Elm architecture pretty much. that + typescript (which supports JSX now) + an immutability library might get you kinda close.

AWWNAW
Dec 30, 2008

angular is overwrought bullshit

Vanadium
Jan 8, 2005

Yesterday morning they told me to make a tiny thing that sounded like it was just going to be turning a batch file into a program with some checkboxes that would then run the individual commands in the batch file depending on whether the checkbox was pressed.

Today I went home still not knowing why a setup.exe I was trying to start with CreateProcess didn't work right at all while it worked just fine if i doubleclicked on the batch file that invokes it.

:negative:

Soricidus
Oct 21, 2010
freedom-hating statist shill
I have a hand-rolled trie class in production somewhere, I'm sure I had a good reason for doing that

suffix
Jul 27, 2013

Wheeee!

Vanadium posted:

Yesterday morning they told me to make a tiny thing that sounded like it was just going to be turning a batch file into a program with some checkboxes that would then run the individual commands in the batch file depending on whether the checkbox was pressed.

Today I went home still not knowing why a setup.exe I was trying to start with CreateProcess didn't work right at all while it worked just fine if i doubleclicked on the batch file that invokes it.

:negative:

maybe setup.exe is a 16-bit executable? (or a batch file, lol)

gonadic io
Feb 16, 2011

>>=

Soricidus posted:

I have a hand-rolled trie class in production somewhere, I'm sure I had a good reason for doing that

I have one on my hdd, when I made a scrabble dictionary and a little bit of a scrabble board object before getting bored

pepito sanchez
Apr 3, 2004
I'm not mexican

gonadic io posted:

I know it wasn't your point but bear in mind that 1) this is a terrible implementation of quicksort (large amount of churn, and using the first element as the pivot gives it awful performance on mostly sorted lists) and 2) please dont write your own sorts people, jeez

i hope this isn't meant as advice. no self-made sorting algorithm is meant as production-wothy. learning algothims and data structures -- and gently caress it i'll throw math in there somewhere -- matters so you know why something already implemented doesn't behave the way you expected it to behave. sorting algorithms are bare babby steps. also poo poo algorithms in core libraries for popular languages have existed for years before being properly updated. java random made me. and i wasn't trying to implement some dual-pivot / 3-way partition quicksort ala java. gently caress dat. i was showing F# = cleaner, cooler code not too loving hard to understand. anyone including me could just search "F# quicksort implementation" online and get more efficient results but that was missing the point

GRRRRR!!!!!

in other news R is a piece of poo poo language and i still don't get why this is important to know, except i can read excel files and make tables make pretty pictures about plots. i guess the language is good because it focuses on the only thing it does?

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

tef posted:

OO is just a nicer way to have global variables but with a reduced scope

you are so loving jaded

but unfortunately not off the mark

Bloody
Mar 3, 2013

pepito sanchez posted:

i hope this isn't meant as advice. no self-made sorting algorithm is meant as production-wothy. learning algothims and data structures -- and gently caress it i'll throw math in there somewhere -- matters so you know why something already implemented doesn't behave the way you expected it to behave. sorting algorithms are bare babby steps. also poo poo algorithms in core libraries for popular languages have existed for years before being properly updated. java random made me. and i wasn't trying to implement some dual-pivot / 3-way partition quicksort ala java. gently caress dat. i was showing F# = cleaner, cooler code not too loving hard to understand. anyone including me could just search "F# quicksort implementation" online and get more efficient results but that was missing the point

GRRRRR!!!!!

in other news R is a piece of poo poo language and i still don't get why this is important to know, except i can read excel files and make tables make pretty pictures about plots. i guess the language is good because it focuses on the only thing it does?

i know at least a couple nerds that are aroused by ggplot2

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

pepito sanchez posted:

and i wasn't trying to implement some dual-pivot / 3-way partition quicksort ala java. gently caress dat. i was showing F# = cleaner, cooler code not too loving hard to understand. anyone including me could just search "F# quicksort implementation" online and get more efficient results but that was missing the point

Actually the point is that functional languages make it really easy to write a bad sorting algorithm that looks kind of like quicksort but isn't. Similar to when people try to write a prime sieve.

Quicksort is an in-place sorting algorithm, if it's not in-place it's not actually quicksort.

sarehu
Apr 20, 2007

(call/cc call/cc)

gonadic io posted:

2) please dont write your own sorts people, jeez

Good advice if you want to be a beta cuckold orbiter.

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

sarehu posted:

Good advice if you want to be a beta cuckold orbiter.

good advice if you want to be a graduate assistant

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

Bloody posted:

I don't know what any of that means so ok

extension methods in C# are pretty much exactly the same thing as categories in Objective-C, except with confusing syntax

in ObjC you use very similar syntax to add a category to a class as you do to define a class in the first place, so adding categories is completely natural

in C# though you have to write an extension method as function that takes this as a parameter and so on, even though at the call site it looks like an instance method

like I can add a category on the system NSSound class like this

code:

// NSSound_ButtNoises.h
#import <AppKit/AppKit.h>

@interface NSSound (ButtNoises)
+ (instancetype)fart;
- (BOOL)playSeveralTimes:(NSUInteger)count;
@end

// NSSound_ButtNoises.m
#import "NSSound_ButtNoises.h"

@implementation NSSound (ButtNoises)
+ (instancetype)fart {
    return [self soundNamed:@"fart.wav"];
}

- (BOOL)playSeveralTimes:(NSUInteger)count {
    BOOL played = NO;
    for (NSUInteger i; i < count; i++) {
        played = [self play];
        if (played == NO) break;
    }
    return played;
}
@end

and I can use the methods it adds just like any other NSSound methods

code:

NSSound *fart = [NSSound fart];
[fart playSeveralTimes:219];

AWWNAW
Dec 30, 2008

eschaton posted:

extension methods in C# are pretty much exactly the same thing as categories in Objective-C, except with confusing syntax

in ObjC you use very similar syntax to add a category to a class as you do to define a class in the first place, so adding categories is completely natural

in C# though you have to write an extension method as function that takes this as a parameter and so on, even though at the call site it looks like an instance method

like I can add a category on the system NSSound class like this

code:
// NSSound_ButtNoises.h
#import <AppKit/AppKit.h>

@interface NSSound (ButtNoises)
+ (instancetype)fart;
- (BOOL)playSeveralTimes:(NSUInteger)count;
@end

// NSSound_ButtNoises.m
#import "NSSound_ButtNoises.h"

@implementation NSSound (ButtNoises)
+ (instancetype)fart {
    return [self soundNamed:@"fart.wav"];
}

- (BOOL)playSeveralTimes:(NSUInteger)count {
    BOOL played = NO;
    for (NSUInteger i; i < count; i++) {
        played = [self play];
        if (played == NO) break;
    }
    return played;
}
@end
and I can use the methods it adds just like any other NSSound methods

code:
NSSound *fart = [NSSound fart];
[fart playSeveralTimes:219];

um this syntax looks quite mo complex than C# extension methods

AWWNAW
Dec 30, 2008

the extension method is just a static method on a static class with an extra "this" in front of the first argument

gonadic io
Feb 16, 2011

>>=

Jabor posted:

Actually the point is that functional languages make it really easy to write a bad sorting algorithm that looks kind of like quicksort but isn't. Similar to when people try to write a prime sieve.

Quicksort is an in-place sorting algorithm, if it's not in-place it's not actually quicksort.

Singly linked lists being ubiquitous is easily the biggest potential gotcha in functional langs (or at least ones that aren't lazy). It seems fine at first, makes things much easier. Then a few months down the line in one case out of hundreds they're absolutely not okay.

JewKiller 3000
Nov 28, 2006

by Lowtax
and in that one case you use an array instead. what's the bfd

KidDynamite
Feb 11, 2005

I don't learn poo poo at work that I don't teach myself. No one looks at my work to actually review it. manager just has me demo it and as long as it works and progress has been made he's happy, but that may turn out to be because he's leaving in 2 weeks. I do get my poo poo done and working compared to the guy doing the android version (that want to make n fragments for n users rather than 1 fragment for n users). I'm bad but I want to get better but me and dumb android guy aren't going to learn poo poo from each other and out manager is leaving and the guy taking over is an unknown variable

Kill All Cops
Apr 11, 2007


Pacheco de Chocobo



Hell Gem
im on a project where i have a tech lead so it's been ok, but this week he's been working on another project and these between yesterday and today i have been lazy as fuckkk

sounds like you might wanna quit your job and work for a cool company that can at least occasionally do code reviews

gonadic io
Feb 16, 2011

>>=

JewKiller 3000 posted:

and in that one case you use an array instead. what's the bfd

I do. Gotchas in langs have easy solutions once you know what the problem is. That doesn't change the fact that it's nonobvious that there's a problem in the first place.

jony ive aces
Jun 14, 2012

designer of the lomarf car


Buglord

AWWNAW posted:

um this syntax looks quite mo complex than C# extension methods
it looks like a diff file

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

lol, we had 4 ios developers and 4 anroid developers and one of my coworkers recently said that since anroid is bad, we should have a 2:1 ratio of anroid to ios devs. well this week 2 of our ios devs quit, thats some real monkeys paw poo poo

NihilCredo
Jun 6, 2011

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

gonadic io posted:

I do. Gotchas in langs have easy solutions once you know what the problem is. That doesn't change the fact that it's nonobvious that there's a problem in the first place.

"is slow" isn't a gotcha, is only rarely a problem, and it is easy to figure out when it is.

defaulting to the safest and most versatile but least efficient data structure is the correct design choice.

make it work, then make it right, then make it fast.

Workaday Wizard
Oct 23, 2009

by Pragmatica

fart simpson posted:

lol, we had 4 ios developers and 4 anroid developers and one of my coworkers recently said that since anroid is bad, we should have a 2:1 ratio of anroid to ios devs. well this week 2 of our ios devs quit, thats some real monkeys paw poo poo

drat

Valeyard
Mar 30, 2012


Grimey Drawer
"""""""""""""""" optional events """"""""""""""""

KidDynamite
Feb 11, 2005

Lady Galaga posted:

im on a project where i have a tech lead so it's been ok, but this week he's been working on another project and these between yesterday and today i have been lazy as fuckkk

sounds like you might wanna quit your job and work for a cool company that can at least occasionally do code reviews

i'm going to start sending my resume out after I finish applying to grad school. just got back from pto to find out the manager leaving stuff and that kind of shifted me into high gear.

Vanadium
Jan 8, 2005

Vanadium posted:

Yesterday morning they told me to make a tiny thing that sounded like it was just going to be turning a batch file into a program with some checkboxes that would then run the individual commands in the batch file depending on whether the checkbox was pressed.

Today I went home still not knowing why a setup.exe I was trying to start with CreateProcess didn't work right at all while it worked just fine if i doubleclicked on the batch file that invokes it.

:negative:

Ha ha I figured it out, the problem was that the exe spawned more processes and those processes wouldn't do their thing and go away until I CloseHandle'd their parent/my child.

No idea why or how.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

oh. neat. my job title no longer says associate but my salary does not increase from "hilariously low". my level of care for this job just went into the toilet and it wasn't very high before.

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

AWWNAW posted:

um this syntax looks quite mo complex than C# extension methods

AWWNAW posted:

the extension method is just a static method on a static class with an extra "this" in front of the first argument

we aren't comparing objc class/method definition syntax to c# syntax here. of course objc's syntax looks "quite more complex" if you aren't used to it

conceptually, objc's way of solving this problem is simpler. in c# you have to define a separate class with a new name and a bunch of special methods (why are they static? you're trying to write instance methods) in order to get this result. you also simply can't add class extension methods at all.

in objc you just define a new interface for the exact class you are trying to add methods to, with a category name in parens (and you use this to define private methods, too) and then you define methods like normal. they just show up on instances and the class object when you include the header.

swift's method involves you defining the extension with the keyword "extension" but is also conceptually simpler

another thing you can't do with c# extension methods that you can with at least swift's (idk about objc) is declare protocol (interface) conformance. in c# if you want .net's List class to implement whatever bespoke artisanal sequence interface you came up with, you have to subclass List and use that subclass everywhere. in swift you just use a class extension and then magically all instances of that type conform to the protocol

Vanadium
Jan 8, 2005

Luigi Thirty posted:

oh. neat. my job title no longer says associate but my salary does not increase from "hilariously low". my level of care for this job just went into the toilet and it wasn't very high before.

I can't wait to find out what I'll get paid for this month, maybe I'll join you in the toilet

leftist heap
Feb 28, 2013

Fun Shoe

fart simpson posted:

lol, we had 4 ios developers and 4 anroid developers and one of my coworkers recently said that since anroid is bad, we should have a 2:1 ratio of anroid to ios devs. well this week 2 of our ios devs quit, thats some real monkeys paw poo poo

lmao

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Vanadium posted:

I can't wait to find out what I'll get paid for this month, maybe I'll join you in the toilet

heh

i got an out of the blue text from someone I used to CJ with, he's now the QA manager at a local software company and said they were looking for .net programmers and he can get me past their screeners. starting to look appealing now that I know I'm going to be making an insultingly low amount for a 2-hour commute until the end of time

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
i have a feeling i might have to start doing interviews soon

rly nervous about that

Valeyard
Mar 30, 2012


Grimey Drawer

MALE SHOEGAZE posted:

i have a feeling i might have to start doing interviews soon

rly nervous about that

Luigi Thirty posted:

oh. neat. my job title no longer says associate but my salary does not increase from "hilariously low". my level of care for this job just went into the toilet and it wasn't very high before.

:smith:

piratepilates
Mar 28, 2004

So I will learn to live with it. Because I can live with it. I can live with it.



MALE SHOEGAZE posted:

i have a feeling i might have to start doing interviews soon

rly nervous about that

how come

fritz
Jul 26, 2003

i dont know any actual facts about optimizing java code and the jit and how they interact, and we're not set up for easy profiling, but can i assume that doing

code:
int[] data = new int[BIG_NUMBER];
inside a tight loop is probably not a thing that will be optimized away?

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
wish your posts could be optimized away

sarehu
Apr 20, 2007

(call/cc call/cc)

fritz posted:

i dont know any actual facts about optimizing java code and the jit and how they interact, and we're not set up for easy profiling, but can i assume that doing

code:
int[] data = new int[BIG_NUMBER];
inside a tight loop is probably not a thing that will be optimized away?

Is data then not used at all? Why wouldn't it be? What would the size of the number have to do with it?

Adbot
ADBOT LOVES YOU

fritz
Jul 26, 2003

sarehu posted:

Is data then not used at all? Why wouldn't it be? What would the size of the number have to do with it?

it's used, yeah, like:
code:
{ 
int[] data = new int[BIG_NUMBER];
// call a jni function to fill data
// do stuff with data
}
and the size is a constant.

im coming to this from a c/c++ mindset and if i saw a
code:
 
{
   int* data = new int[BIG_NUMBER];
   memset(data, 0, sizeof(int)*BIG_NUMBER);	
   /// stuff
   delete[] data;
}
in a time-critical section of code i would start thinking along the lines of 'hey maybe we can hoist the allocation out and only do it once'

but (a) idk if the jit is smart enough to do that sort of thing and (b) see earlier comment re: not being set up for profiling

fritz fucked around with this message at 21:31 on Sep 17, 2015

  • Locked thread