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



pram posted:

ruby is poo poo

yea people say that but idgi


also, much like your posts

Adbot
ADBOT LOVES YOU

Doc Block
Apr 15, 2003
Fun Shoe

KoRMaK posted:

With ruby (and any language that has hash like params) it doesn't have to be in order.

IT seems like obj-c forced you to used hashes, but they also had to be in order.


I didn't spend a lot of time with it, it seemed overly difficult. I might be missing something that makes it truely great

what do you mean by hashes? the arguments aren't passed in as a "hash" aka associative array aka dictionary.

it's not the equivalent of
unzip(piss=steve, poo poo=bill)

the argument "names" are actually part of the method name, which is one of the reasons they're passed in order. see my previous post.

and Objective-C uses the same calling convention as C, so that's the other reason arguments have to be in order.

Doc Block fucked around with this message at 06:25 on Oct 25, 2015

pram
Jun 10, 2001

KoRMaK posted:

yea people say that but idgi


also, much like your posts

https://benchmarksgame.alioth.debian.org/u32/compare.php?lang=yarv&lang2=java
https://benchmarksgame.alioth.debian.org/u32/compare.php?lang=yarv&lang2=gcc

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?

Ludwig van Halen posted:

code:

struct fart
{
    int volume;
    long smell;
}

void release_gas(struct fart);

replace that with

code:

extern void fart *fart_new();
extern void fart *fart_free();
static class fart_class = { .super = NULL; .new = fart_new; .free = fart_feee };
typedef struct {
    void *isa;
    int volume;
    long smell;
} fart;

extern void fart_release_gas(fart *self);

and support inheritance via the isa pointer and you basically have objects

I implemented an object system in PostScript once that was basically this where objects were dictionaries with an isa (class) slot and methods were added to the class dictionary with an methoddef word you'd use instead of def

so you could say something like

code:

/fart /object <<
  /volume
  /smell
>> classdef

/fart /releasegas { % stack: fart => ---
% body of method here
} methoddef

/silentbutdeadly { % stack: --- => ---
  /fart new % push a new fart
  0 /volume set
  100 /smell set
  /releasegas send
} def

and you could just fart away with all the subclasses you wanted

I basically reimplemented the NeWS OO-PostScript system that Gosling created at Sun but using PostScript Level 2

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?

Feisty-Cadaver posted:

is it some sort of bullshit HFT financial garage xfer system that provides no value to anyone ever in the history of the universe but makes your bank millions of dollars a year?

Dessert Rose posted:

no it helps humans communicate with each other

Desert Rose literally works on something we make fun of on the reg

e: which isn't to say I don't… :shrug:

eschaton fucked around with this message at 06:48 on Oct 25, 2015

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?

KoRMaK posted:

With ruby (and any language that has hash like params) it doesn't have to be in order.

IT seems like obj-c forced you to used hashes, but they also had to be in order.


I didn't spend a lot of time with it, it seemed overly difficult. I might be missing something that makes it truely great

what you're missing is that ObjC just splits the method name up, it isn't a hash

and what makes it great is that it means I can look at 20 year old code and understand its intent instantly

as long as it doesn't predate OpenStep anyway, what the gently caress was Will Parkhurst thinking designing methods like -[View draw::] instead of -[NSView drawRect:]

(though at least -[View draw::] took an NXRect array & count instead of a single NSRect representing the goddamn union of all rectangles that needed to be redrawn, something Apple didn't fix until 10.2.8+Safari)

pram
Jun 10, 2001
eschaton talking about ancient implementation minutiae owns ..

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?

pram posted:

eschaton talking about ancient implementation minutiae owns ..

ty

I knew there was a reason my brain was crammed full of it

other than figuring out what's keeping my Mac IIx from booting, I mean

maniacdevnull
Apr 18, 2007

FOUR CUBIC FRAMES
DISPROVES SOFT G GOD
YOU ARE EDUCATED STUPID

eschaton posted:

ty

I knew there was a reason my brain was crammed full of it

other than figuring out what's keeping my Mac IIx from booting, I mean

It's poo poo, hth

Doc Block
Apr 15, 2003
Fun Shoe
doesn't eschaton work at Apple?

Doc Block
Apr 15, 2003
Fun Shoe
and yeah, one of the great things about objective c is how self-documenting the code is.

whereas swift seems to be a lot more write-only.

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

eschaton posted:

Desert Rose literally works on something we make fun of on the reg

e: which isn't to say I don't… :shrug:

yeah it isn't like we don't make fun of it constantly while working on it

I mean at least I work on something big enough for yospos to know enough about to make fun of :shobon:

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Doc Block posted:

and yeah, one of the great things about objective c is how self-documenting the code is.

whereas swift seems to be a lot more write-only.

aw, really? sorry to hear that, i thought we were doing alright. anything in particular you find hard to read?

KoRMaK
Jul 31, 2012



eschaton posted:

what you're missing is that ObjC just splits the method name up, it isn't a hash

and what makes it great is that it means I can look at 20 year old code and understand its intent instantly

as long as it doesn't predate OpenStep anyway, what the gently caress was Will Parkhurst thinking designing methods like -[View draw::] instead of -[NSView drawRect:]

(though at least -[View draw::] took an NXRect array & count instead of a single NSRect representing the goddamn union of all rectangles that needed to be redrawn, something Apple didn't fix until 10.2.8+Safari)

This seems cool, but what the hell is with the : and :: seperator poo poo in methods.


And the dash, and the square brackets! Whats with them? Does objc turn them into an operator?

sarehu
Apr 20, 2007

(call/cc call/cc)
The brackets box the argument list (and the callee unboxes it).

Doc Block
Apr 15, 2003
Fun Shoe

KoRMaK posted:

This seems cool, but what the hell is with the : and :: seperator poo poo in methods.


And the dash, and the square brackets! Whats with them? Does objc turn them into an operator?

The - before a method declares it to be an instance method, whereas a + in front of it declares it to be a class method:
Objective-C code:
// this is a class method declaration
+(instancetype)objectWithParam1:(int)someValue andParam2:(int)otherValue;
// this is an instance method declaration
-(instancetype)initWithParam1:(int)someValue andParam2:(int)otherValue;
Now, when you call one of those, like
Objective-C code:
SomeClass *thing = [SomeClass objectWithParam1:555 andParam2:8675309];
The parameters aren't passed in as a dictionary (aka hash), they just get passed in according to the platform's regular old C ABI (either via the stack or specific CPU registers). The parameter "names" are actually part of the method name, so to the compiler the method name is +gimmeANewObjectWithParam1:andParam2:. You can see this for yourself by putting this at the top of some Objective-C method:
Objective-C code:
NSLog(@"Hello, my name is %s", __FUNCTION__);
The square brackets are just a different way of indicating a method call. It probably has its roots in the earliest Objective-C "compilers" really just being fancy C preprocessors (like the earliest C++ compilers were). Unlike other programming languages, Objective-C doesn't try to make some equivalency between calling a method and functions in mathematics (or whatever), so you get [target methodName] instead of target.methodName() like in C++ and other languages.

The nice thing about the square brackets is that it gives you a visual and mental reminder that you aren't making a direct function call, but are instead passing a message. One of the things I dislike about Swift (sorry rjmccall) is that it tries to go back to using parenthesis even for Swift/Objective-C message passing, so (using the previous Objective-C init method) you get weird stuff like
Objective-C code:
let thing = ClassName(param1: 555, andParam2:8675309)
(of course, Swift is now apparently trying to minimize the use of message passing and just doing straight function calls, but whatever)

Doc Block fucked around with this message at 08:26 on Oct 26, 2015

Doc Block
Apr 15, 2003
Fun Shoe

rjmccall posted:

aw, really? sorry to hear that, i thought we were doing alright. anything in particular you find hard to read?

my exposure to it has been pretty limited (i've been putting off learning it). since that means I can't really make a fair assessment, i'll just say a lot of the syntax seems really unnatural to me. types on the right, "let" means const, etc. Of course, I used to say the same thing about objective-c and its square brackets, so whatever v:shobon:v

i do, however, have a religious objection to operator overloading. :colbert: in my experience operator overloading leads to a lot of write-only code, regardless of the language.

Doc Block fucked around with this message at 08:44 on Oct 26, 2015

echinopsis
Apr 13, 2004

by Fluffdaddy
obj c might be the hardest to look at language I've ever seen

FamDav
Mar 29, 2008

Doc Block posted:

my exposure to it has been pretty limited (i've been putting off learning it). since that means I can't really make a fair assessment, i'll just say a lot of the syntax seems really unnatural to me. types on the right, "let" means const, etc. Of course, I used to say the same thing about objective-c and its square brackets, so whatever v:shobon:v

i do, however, have a religious objection to operator overloading. :colbert: in my experience operator overloading leads to a lot of write-only code, regardless of the language.

types on the right is nice for you (and people who have no opinion) because you get to say what something is called and then what it is. also hopefully you skip the goppity goop that c and c++ where they have types go to the left and the right of the name. its also yields a simpler parser implementation/unambiguous grammar in these situations which means its simpler, probably faster, and probably easier for somebody else to come along and write a tool around the language.

everybody is playing around with how you declare variables these days. it feels like everybody is down with var being a mutable variable, but then you have your choice of let in rust and swift, val in scala, and nothing but := in golang.

Valeyard
Mar 30, 2012


Grimey Drawer
If your job is slinging out c++ then tell us what game company you work for

echinopsis
Apr 13, 2004

by Fluffdaddy
rodtronics might hire you


as an unpaid intern

Valeyard
Mar 30, 2012


Grimey Drawer

echinopsis posted:

rodtronics might hire you


as an unpaid intern

How goes the blueprinting anyway, are you thinking of branching out to the full shebang now?

echinopsis
Apr 13, 2004

by Fluffdaddy
honestly can't see the point. there has only been one thing I've wanted to achieve with them which I couldn't, which was to change the mass of an object on the fly. maybe it's doable now they've had like 5 point releases since then anyway

I doubt I'd gain much speed given the scope of the games I'm starting and never finishing either

plus while blueprints do make some poo poo a bit tedious and slower to set up id say almost everything else is way faster


let's say I have an actor object and it's job is to display text. another actor can spawn this text actor and so when you add the spawn node all the variables in the blueprint that I have set to "expose on spawn" are right there. in this example te only variable is the text


but then I decide I want to add a size variable

add the node for text size. poo poo like that is easy coz you drag a lead off the text component and it brings up a list of only the nodes that will work. start typing size and select the size one . there is now a float input box but if I drag a lead off I can select "promote to variable" and it makes the variable there and then, linked it. on the variable properties which are right there is "expose on spawn"
so I click, then hit compile which takes about a second and then

if I go back to the other actor, already (it usually does this without you asking) it's already added that variable for size so you can now spawn te text actor and specifiy it's size

beig able to expose all the relevant variables I want at the start of creating an object makes life so easy. no need to rmemever what to specificy, it's all there

just a example of how I find it so quick to add fictionally and never get syntax errors etc

and all blueprints are set generally to fail quietly .

echinopsis
Apr 13, 2004

by Fluffdaddy
a lot of that poo poo probably doesnt make sense but in general I just love how quickly it is for me to add an idea that I have. or want to change something.

tbf I haven't been able to compare it to actually coding the same functionality but time and time again I read about how quickly and easy it is to add poo poo with blueprints

it seems the ulimtate workflow is have the coders code up the main game poo poo and also blueprint interfaces to what they are coding, and then artists and other designers can use those new interfaces (I am not using that word in a true object orientated way, actual object interfaces are different) to add whatever in, adjust it and it works

and coz you dont really compile, i mean you do but it just happens very quickly an bang running. errors on compile are easy to deal with

and yeah the blueprints fail silently, as in, if you cast to an class but the cast fails, well, the things after than that would have relied on that cast object just dont work. i mean its a hassle at times to find the problem but it means the player doesnt notice a bad thing


i tried to make a gif cam of me doing some poo poo but I think its going to be too big


and other poo poo like, reference checking. i have a new mesh I want in place of old one? delete old one and point references at new one. it all happens automatically. rename a variable? done everywhere just like that

i guess intellisense does some of that stuff for you i wouldnt really know but having the blueprints UI give me the entire list of potential functions on an object right away means i can get to wrk and dont have to waste my time remembering anything etc

echinopsis fucked around with this message at 10:55 on Oct 26, 2015

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

echinopsis posted:

obj c might be the hardest to look at language I've ever seen

it's not that bad, once you look at it for a bit.

Doc Block
Apr 15, 2003
Fun Shoe
yeah, I hated it at first, but now I like it a lot

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

always love that point in learning a language where you see an operator like -> or (_,_,_) and get to fumble around on google trying to describe it to find out what it's even called

echinopsis
Apr 13, 2004

by Fluffdaddy

carry on then posted:

always love that point in learning a language where you see an operator like -> or (_,_,_) and get to fumble around on google trying to describe it to find out what it's even called

(.)(.)

pram
Jun 10, 2001
one of my favorite javascript features is !! and !!!

pram
Jun 10, 2001
if (!!!!!!!imGay)

pepito sanchez
Apr 3, 2004
I'm not mexican

i didn't even know this existed until now

maniacdevnull
Apr 18, 2007

FOUR CUBIC FRAMES
DISPROVES SOFT G GOD
YOU ARE EDUCATED STUPID

x equals y
x really equals y
no, seriously, x truly really does equal x

pram
Jun 10, 2001

pepito sanchez posted:

i didn't even know this existed until now

yeah i use it all the time

pram
Jun 10, 2001
in fact the more exclamation marks, the more idiomatic the javascript

pepito sanchez
Apr 3, 2004
I'm not mexican
can i do !!!========= for no reason and fun because i think i almost made the jsfiddle site crash

Doc Block
Apr 15, 2003
Fun Shoe
what do all those exclamation marks do in JS?

pram
Jun 10, 2001
type conversion to boolean. ! turns object into bool (NOT) and !! negates it (NOT NOT) so for a conditional you can check any object like a true bool if (!!fart)

how it evaluates to false or true depends on the object. more than !! just negates it again (NOT NOT NOT) etc

KoRMaK
Jul 31, 2012



!!!whatever


Helps me out when whatever can be a bool or nil.

Baxate
Feb 1, 2011

err... does nil not evaluate as false or something?

Adbot
ADBOT LOVES YOU

Doc Block
Apr 15, 2003
Fun Shoe
So, basically, it's just the regular old NOT operator, but because -~=JavaScript Programmers=~- they use it multiple times in a row so it's True Bool Comparison(tm) or something?

  • Locked thread