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
Soricidus
Oct 21, 2010
freedom-hating statist shill

USSMICHELLEBACHMAN posted:

aka normal programmers and female programmers
  /
:mrapig:

Soricidus fucked around with this message at 10:22 on May 8, 2014

Adbot
ADBOT LOVES YOU

Valeyard
Mar 30, 2012


Grimey Drawer
ok so that exam was today and lol

a question asking me how occulus rift worked, and the two main reasons why vr headsets cause motion sickness

one asking me to talk about the pro/con of the think aloud technique for ui design

another asking why a bubblechart was good/bad, another asking what "generalised selection technique" is w.r.t. data analysis

it was pretty different from the mock paper

Bloody
Mar 3, 2013

best way to program is in c. any time you need a higher-level language feature implement it in the preprocessor. tada, now you have exactly the suffering you deserve.

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

Valeyard posted:

ok so that exam was today and lol

a question asking me how occulus rift worked, and the two main reasons why vr headsets cause motion sickness


MeruFM
Jul 27, 2010
the human interface barriers of VR is huge
even huger than a tv that doesn't make you sick which was pretty huge

but the hugest is no one wants to put a box on their face

Doc Block
Apr 15, 2003
Fun Shoe
not true.
i had your mom's box on my face last night, had a p good time.

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band
is it wrong that i get frustrated and angry when functions are called without parentheses? i keep losing track of where the arguments are :maddowns:

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

prefect posted:

is it wrong that i get frustrated and angry when functions are called without parentheses? i keep losing track of where the arguments are :maddowns:

paging alsod

gonadic io
Feb 16, 2011

>>=

prefect posted:

is it wrong that i get frustrated and angry when functions are called without parentheses? i keep losing track of where the arguments are :maddowns:

ur wrong

(i feel the same way about functions with parens, they just get in the way. you'll get used to it p quickly if you do any work in non c-langs)

gonadic io
Feb 16, 2011

>>=
i mean you're already used to it with arithmetic, are you telling me you'd really rather that have a million parens and commas everywhere when you don't need them?

Shaggar
Apr 26, 2006

prefect posted:

is it wrong that i get frustrated and angry when functions are called without parentheses? i keep losing track of where the arguments are :maddowns:

no. method calls should always have parentheses

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

Shaggar posted:

no. method calls should always have parentheses

yes, but what about functions? :smuggo:

Valeyard
Mar 30, 2012


Grimey Drawer

Shaggar posted:

no. method calls should always have parentheses

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Shaggar posted:

no. method calls should always have parentheses

sure i'll give you method calls, but function calls don't need them

Bloody
Mar 3, 2013

parens reduce ambiguity you should always at least have the option of using them.

gonadic io
Feb 16, 2011

>>=

Bloody posted:

parens reduce ambiguity you should always at least have the option of using them.

absolutely, reducing ambiguity is the sole purpose of parens

double sulk
Jul 2, 2010

no parentheses on method calls without parameters is the loving worst aspect of "proper" ruby code

Shaggar
Apr 26, 2006

MeramJert posted:

sure i'll give you method calls, but function calls don't need them

yes they should if they are called the same way

double sulk
Jul 2, 2010

double sulk posted:

using ruby is the loving worst aspect of ruby

Nomnom Cookie
Aug 30, 2009



AlsoD posted:

absolutely, reducing ambiguity is the sole purpose of parens

also grouping. so ig uses parens haves 2 purposes

Notorious b.s.d.
Jan 25, 2003

by Reene
if your function calls dont have side effects they dont need to be distinguished from values :smug:

Bloody
Mar 3, 2013

if they dont have side effects then why bother

gonadic io
Feb 16, 2011

>>=

Bloody posted:

if they dont have side effects then why bother

b/c functions sometimes also return a value

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Shaggar posted:

yes they should if they are called the same way

and what if you don't have methods

MononcQc
May 29, 2007

Currying also reduces the need for parens.

In strict languages I tend to still prefer them to properly delimit everything, and argument-free parens-free calls are the worst thing.

gonadic io
Feb 16, 2011

>>=

MononcQc posted:

argument-free parens-free calls are the worst thing.

these sound hilarious, like an elder god or something

don't say its name!!! if you merely say its name bad things will happen!

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

are those like properties in python?

qntm
Jun 17, 2009

AlsoD posted:

these sound hilarious, like an elder god or something

don't say its name!!! if you merely say its name bad things will happen!

under some forgotten sunken continent, perl stirs

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

MeramJert posted:

sure i'll give you method calls, but function calls don't need them

there's a difference? :downs:

MononcQc
May 29, 2007

MeramJert posted:

are those like properties in python?

They're like properties in python (given you can do the __get and __set dance) except imagine that all methods that take no argument (other than self) in python are now properties also. object.prop == object.prop() in terms of what it does or gives.

Also functions so that if you do 'x = f', it isn't obvious if 'f' represents the variable 'f' or the function call 'f' (equivalent to 'f()').

Bloody
Mar 3, 2013

what if i dont want to assign a function call but instead want to assign a pointer to that function

actually i dont think this is a question

whatever

Bloody
Mar 3, 2013

heres a question: why should i ever give a single gently caress about functional programming and/or how is it relevant to things i give a single gently caress aobut

gonadic io
Feb 16, 2011

>>=

Bloody posted:

heres a question: why should i ever give a single gently caress about functional programming and/or how is it relevant to things i give a single gently caress aobut

in C-langs what FP stuff does is to mean so that you don't have to write your own for-loops every single time i.e. writing (assuming a non-empty array)

code:
gcds :: [Int] -> Int
gcds = foldr1 gcd
instead of something like

code:
public int gcds (int[] numbers) {
    int gcd_all = numbers[0];
    for (int num : numbers) {
        gcd_all = gcd (gcd_all, num);
    }
    return gcd_all;
}
the former example is:
- clearer (no control flow operatings cluttering things up)
- less error prone (less chance of a fat-fingered type)
- microscopically more efficient (the java does gcd(numbers[0],numbers[0]) and if you want to stop this you have to write your own bounds which makes it even worse for the above two points)


Java8 and LINQ both turn this into a 1-liner by using laziness/first-class functions i.e. functional programming

Shaggar
Apr 26, 2006

AlsoD posted:

in C-langs what FP stuff does is to mean so that you don't have to write your own for-loops every single time i.e. writing (assuming a non-empty array)

code:
gcds :: [Int] -> Int
gcds = foldr1 gcd
instead of something like

code:
public int gcds (int[] numbers) {
    int gcd_all = numbers[0];
    for (int num : numbers) {
        gcd_all = gcd (gcd_all, num);
    }
    return gcd_all;
}
the former example is:
- clearer (no control flow operatings cluttering things up)
- less error prone (less chance of a fat-fingered type)
- microscopically more efficient (the java does gcd(numbers[0],numbers[0]) and if you want to stop this you have to write your own bounds which makes it even worse for the above two points)


Java8 and LINQ both turn this into a 1-liner by using laziness/first-class functions i.e. functional programming

actually the first example doesn't make any sense because of garbage syntax.

Shaggar
Apr 26, 2006
what does "folder1 gcd" mean?

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison
gently caress i hate javascript

Corla Plankun
May 8, 2007

improve the lives of everyone

Bloody posted:

heres a question: why should i ever give a single gently caress about functional programming and/or how is it relevant to things i give a single gently caress aobut

if you learn how to recognize at a glance you can use this power to skip over lovely answers on stack overflown

gonadic io
Feb 16, 2011

>>=

Shaggar posted:

what does "folder1 gcd" mean?

foldr1 is Aggregate in C# and reduce in Java except that it uses the first element of the array as the initial value.

this avoids needing to explicitly remove it from the stream like this:

code:
public int gcds (int[] numbers) {
    return numbers.stream().skip(1).reduce(
        numbers[0],
        gcd);
}
(I think, I haven't really done java in years)

or just ignoring that premature optimisation like:

code:
public int gcds (int[] numbers) {
    return numbers.stream().reduce(numbers[0], gcd);
}

gonadic io fucked around with this message at 20:22 on May 9, 2014

gonadic io
Feb 16, 2011

>>=
oh yeah as a bonus the haskell one even short-circuits once you reach a gcd of 1 (depending on how you define gcd)

if you think that this could be a problem due to your gcd function's side effects being executed an unknown number of times then oh ho ho the problem isn't with fold/reduce/aggregate

Adbot
ADBOT LOVES YOU

gonadic io
Feb 16, 2011

>>=
and this isn't even getting started on how stuff like immutable data, option types and declared side-effect free code is becoming more and more common in most langs

  • Locked thread