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
PleasingFungus
Oct 10, 2012
idiot asshole bitch who should fuck off

Shaggar posted:

altho that's some serious p-langer syntax so whatever it is probably cant even do transactions.

the style is unusual for the language, but I think it might actually be c++ syntax. don't know any other language that has both arrows and double-colon operators.

JewKiller 3000 posted:

he does it once in a while to make the other posts more believable

lol if you haven't realized shaggar is the best poster in yospos

Adbot
ADBOT LOVES YOU

tef
May 30, 2004

-> some l-system crap ->

Shaggar posted:

oh, you mean tests on the proxy consumer. right. my bad.

tef was right




i think i need to go and sit down

uG
Apr 23, 2003

by Ralp

PleasingFungus posted:

the style is unusual for the language, but I think it might actually be c++ syntax. don't know any other language that has both arrows and double-colon operators.

perl5

a cyberpunk goose
May 21, 2007

PleasingFungus posted:

the style is unusual for the language, but I think it might actually be c++ syntax. don't know any other language that has both arrows and double-colon operators.


lol if you haven't realized shaggar is the best poster in yospos

it was C++

i've seen some poo poo

a cyberpunk goose
May 21, 2007

Mido posted:

i've seen some poo poo

but enough about my posts

hubris.height
Jan 6, 2005

Pork Pro
https://github.com/joescodebox/simpleballs

Python3 Pygame implementation of 4 balls bouncing around

problems: needs to calculate when something is out of bounds immediately instead of on its turn to draw
when things get fast it looks lovely (more lovely)
vectors are implemented but collisions dont test the angle to determine where to reflect the objects to

in short, this is a little work on the side every now and then and it really has made me realize i'm a poo poo programmer and need to keep working at it

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

hubris.height posted:

in short, this is a little work on the side every now and then and it really has made me realize i'm a poo poo programmer and need to keep working at it

knowing is half the battle

stoutfish
Oct 8, 2012

by zen death robot
i'm too dumb to learn c++ right now so i'm going back to python, litearlly the worst grammer

MeruFM
Jul 27, 2010
i switched to C++ for a project because python event driven gui is hell on earth

now i know what doublecolonoscopy means

also friend class. why does this exist

MeruFM
Jul 27, 2010
i want to make an object oriented thingy for my resume
but what if i really just want all globals?

MeruFM
Jul 27, 2010
i've got no leg to stand-on since my preferred python has this implicitly and also has global

a cyberpunk goose
May 21, 2007

MeruFM posted:

i switched to C++ for a project because python event driven gui is hell on earth

now i know what doublecolonoscopy means

also friend class. why does this exist

friend has saved my rear end when i've found myself in some awful contexts where i need circular class relationships ( :negative: ) but want to retain access control otherwise

a cyberpunk goose
May 21, 2007

now if only i had real friends

a cyberpunk goose
May 21, 2007

code:
class SomeResourceThing: public ResourceBase
{
public:
   SomeResourceThing():ResourceBase(NULL) { }
   ~SomeResourceThing() { }
private:
   virtual void DoASpecialThing() { };

   friend class ResourceManager; // hail satan this is probably a singleton !!!!
}

void ResourceManager::Fart(boost::shared_ptr<ResourceBase*> itarget)
{
    itarget->DoAThing();
}

kill me

dont do this

Bloody
Mar 3, 2013

singletons own in extremely rare circumstances

Doc Block
Apr 15, 2003
Fun Shoe
Singletons Rule Everything Around Me

Socracheese
Oct 20, 2008

im coding c for the first time in a while for a class and its p cool that you get to be so explicit with ur bits and stuff but hoooo boy its a pain in the rear end to do stuff that would take 5 seconds in python

I started putting in a bunch of #define things to all the boilerplate stuff like for loops and traversing linked lists and then I realized I'm basically re-inventing lovely python

uG
Apr 23, 2003

by Ralp

Socracheese posted:

I started putting in a bunch of #define things to all the boilerplate stuff like for loops and traversing linked lists and then I realized I'm basically re-inventing every p-lang

uG
Apr 23, 2003

by Ralp
except Perl 6 thats why its not a piece of poo poo (or finished)

Doc Block
Apr 15, 2003
Fun Shoe

Socracheese posted:

I started putting in a bunch of #define things to all the boilerplate stuff like for loops and traversing linked lists and then I realized I'm basically re-inventing lovely python

because if there's one thing in c that's complicated and requires a lot of boilerplate code, it's for loops.

C code:

for(int i = 0; i < whatever; i++) {
        /* do something */
}

SO. MUCH. BOILERPLATE.

FamDav
Mar 29, 2008

Socracheese posted:

im coding c for the first time in a while for a class and its p cool that you get to be so explicit with ur bits and stuff but hoooo boy its a pain in the rear end to do stuff that would take 5 seconds in python

I started putting in a bunch of #define things to all the boilerplate stuff like for loops and traversing linked lists and then I realized I'm basically re-inventing lovely python

if youre going to do that you might as well use something like cello and just go crazy with type classes.

a c preprocessor with additional syntax for type classes would be p cool, actually.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
someone just needs to make a ruby that compiles all the way down to whatever the lowest thing is welp cya

Nomnom Cookie
Aug 30, 2009



Singletons are so bad. I've had conversations with coworkers that basically ended with them saying "I just want one so I need a singleton"
...
:eng99:

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Doc Block posted:

because if there's one thing in c that's complicated and requires a lot of boilerplate code, it's for loops.

C code:
for(int i = 0; i < whatever; i++) {
        /* do something */
}
SO. MUCH. BOILERPLATE.

now iterate over elements in an array

that came from another function so you don't know the sizeof

a cyberpunk goose
May 21, 2007

Cocoa Crispies posted:

now iterate over elements in an array

that came from another function so you don't know the sizeof

code:
if (array[i] == '\0') break;
:getin:

Doc Block
Apr 15, 2003
Fun Shoe

Cocoa Crispies posted:

now iterate over elements in an array

that came from another function so you don't know the sizeof

that has nothing to do with him trying to eliminate the "boilerplate" of a for loop in C.

Stringent
Dec 22, 2004


image text goes here

Doc Block posted:

that has nothing to do with him trying to eliminate the "boilerplate" of a for loop in C.

it does if he's looping over an array he doesn't know the size of

FamDav
Mar 29, 2008
i think that's the function from which he got the array's problem though

ChiralCondensate
Nov 13, 2007

what is that man doing to his colour palette?
Grimey Drawer

MeruFM posted:

i switched to C++ for a project because python event driven gui is hell on earth

now i know what doublecolonoscopy means

also friend class. why does this exist

really? i kinda liked wxpython last time i used it

Doc Block
Apr 15, 2003
Fun Shoe

Stringent posted:

it does if he's looping over an array he doesn't know the size of

when did he mention traversing an array he doesn't know the size of? all he mentioned was using preprocessor defines on for loops and linked lists. he even said it turned out to be a dumb idea.

and
C code:
for(whatevertype *ptr = arrayptr; *ptr != NULL; ptr++) {
        /* whatever */
}
isn't any more code than any other for loop, and easily handles arrays of unknown size.

Nomnom Cookie
Aug 30, 2009



Doc Block posted:

when did he mention traversing an array he doesn't know the size of? all he mentioned was using preprocessor defines on for loops and linked lists. he even said it turned out to be a dumb idea.

and
C code:
for(whatevertype *ptr = arrayptr; *ptr != NULL; ptr++) {
        /* whatever */
}
isn't any more code than any other for loop, and easily handles arrays of unknown size.

ya u document how the caller indicates the size/end of the array and after that it's on them if u try to scroll past the end of memory

Mr SuperAwesome
Apr 6, 2011

im from the bad post police, and i'm afraid i have bad news
this is why when anyone says "oh yeah you can do useful poo poo in c" they are wrong and dumb and enjoy pain and all this stupid poo poo to make C behave like a normal language

Mr SuperAwesome
Apr 6, 2011

im from the bad post police, and i'm afraid i have bad news
like C works great when you create a load of structures so you can use dot notation and stuff and basically make it like a normal language, apart from everything being really linuxy and stupid and lets stick some control characters all over the place to read and write poo poo thats a good idea.

and all this reinventing the wheel to use list/etc style structures in a sensible way


gently caress c basically

a nest of hornets
Nov 17, 2012

by Ralp

Mido posted:

use singletons everywhere


everywhere

NOTinuyasha
Oct 17, 2006

 
The Great Twist

Mido posted:

use singletons everywhere


everywhere

Do this

PleasingFungus
Oct 10, 2012
idiot asshole bitch who should fuck off

Mr SuperAwesome posted:

like C works great when you create a load of structures so you can use dot notation and stuff and basically make it like a normal language, apart from everything being really linuxy and stupid and lets stick some control characters all over the place to read and write poo poo thats a good idea.

and all this reinventing the wheel to use list/etc style structures in a sensible way


gently caress c basically

c is portable assembly

set your expectations accordingly

Bloody
Mar 3, 2013

Cocoa Crispies posted:

now iterate over elements in an array

that came from another function so you don't know the sizeof

#include <vector>

a cyberpunk goose
May 21, 2007

code:
for ( std::list<Type>::iterator i = myList.begin() ; i != myList.end() ; i++ )

Zlodo
Nov 25, 2006
you surely meant

for( auto& thing : myList )

Adbot
ADBOT LOVES YOU

uG
Apr 23, 2003

by Ralp
surely c++ is the same as c

oh wait its std::poo poo

  • Locked thread