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.
 
  • Post
  • Reply
the bsd boys
Aug 8, 2011
Probation
Can't post for 349 days!
snype

Adbot
ADBOT LOVES YOU

Sapozhnik
Jan 2, 2005

Nap Ghost
while i normally don't care for c++, writing "robust"ish C code does my head in because it invariably boils down to

code:
int whatever(...)
{
    int err;

    if (err = thing1(...)) {
        goto thing1_fail;
    }

    if (err = thing2(...)) {
        goto thing2_fail;
    }

    if (err = thing3(...)) {
        goto thing3_fail;
    }

    if (err = thing4(...)) {
        goto thing4_fail;
    }

    return 0;

thing4_fail:
    unwind_thing3(...);

thing3_fail:
    unwind_thing2(...);

thing2_fail:
    unwind_thing1(...);

thing1_fail:
    return err;
}
ad infinitum as opposed to just

code:
thing1(...);
thing2(...);
thing3(...);
it gets particularly fun when there's any sort of actual non-error-related flow control involved

on the other hand wrapping everything in transactional raii wrappers is its own special flavour of merry hell and probably actually comes out to more LoC on balance so idk

this is why i try to write my poo poo in a managed language where possible

Sapozhnik fucked around with this message at 15:03 on Dec 14, 2013

Zombywuf
Mar 29, 2008

Mr Dog posted:

on the other hand wrapping everything in transactional raii wrappers is its own special flavour of merry hell and probably actually comes out to more LoC on balance so idk

You can do something like
C++ code:
auto handle1 = std::unique_ptr<int, unwind_thing1_if_err>(thing1(...));
which is reasonably concise.

SavageMessiah
Jan 28, 2009

Emotionally drained and spookified

Toilet Rascal

Zombywuf posted:

You can do something like
C++ code:
auto handle1 = std::unique_ptr<int, unwind_thing1_if_err>(thing1(...));
which is reasonably concise.

I had to use a c api from c++11 recently and used that
it was pretty sweet

Max Facetime
Apr 18, 2009

SavageMessiah posted:

I had to use a c api from c++11 recently and used that
it was pretty sweet

i'm not instantly familiar with the syntax, but doesn't that leave an unused handle1 variable in scope? which then gets removed as part of whitespace and code formatting and other automatic clean ups while going into your source control if you've set it up right?

Vanadium
Jan 8, 2005

Max Facetime posted:

i'm not instantly familiar with the syntax, but doesn't that leave an unused handle1 variable in scope? which then gets removed as part of whitespace and code formatting and other automatic clean ups while going into your source control if you've set it up right?

handle1 is usually not unused since you probably want to cancel the unwinding on the non-error return path manually, but in this case you should probably just fix your "clean ups" if they break idiomatic C++ code.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
yosproject: complete the c++ grandmaster challenge but do it entirely with bash/coreutils/sed

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band
should the thread title be updated? i'm pretty sure ruby and javascript are both more hipstery than python these days

double sulk
Jul 2, 2010

ruby isn't hipster any more

Brave GNU World
Nov 1, 2013

by Cyrano4747
it should be node.js

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...
if microsoft supports it is it really hipster enough though?

Notorious b.s.d.
Jan 25, 2003

by Reene

Dessert Rose posted:

if microsoft supports it is it really hipster enough though?

when microsoft starts supporting it, it is dying

see: php

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

Notorious b.s.d. posted:

when microsoft starts supporting it, it is dying

see: php

so it's on the way to becoming hipster, got it

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
I taught a kid some javascript doing a substitution cipher and I guess she really liked it. today she showed me like this 200 lines code to make the ultimate cipher made of other ciphers and you type "lol" and it becomes a buncha tamil characters or some poo poo.

Notorious b.s.d.
Jan 25, 2003

by Reene

Dessert Rose posted:

so it's on the way to becoming hipster, got it

only if its on windows

Luigi Thirty
Apr 30, 2006

Emergency confection port.

On 12/16/2013 07:30 PM, Rowan Collins wrote:

> The core functions which follow neither rule include C-style
> abbreviations like "strptime" which couldn't be automatically swapped to
> either format, and complete anomalies like "nl2br". If you named those
> functions as part of a consistent style, you would probably also follow
> stronger naming conventions than Rasmus did when he named
> "htmlspecialchars".

Well, there were other factors in play there. htmlspecialchars was a
very early function. Back when PHP had less than 100 functions and the
function hashing mechanism was strlen(). In order to get a nice hash
distribution of function names across the various function name lengths
names were picked specifically to make them fit into a specific length
bucket. This was circa late 1994 when PHP was a tool just for my own
personal use and I wasn't too worried about not being able to remember
the few function names.

-Rasmus

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror


:swoon: nordic dreamboat and god-tier sperg-riler

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
eevee 4 hours ago | link
Conversely, I wonder how much time/money has been spent porting away from PHP, or working on stuff like hiphop?

I don't have an estimate, but it's an interesting question if you're going to argue in terms of economic impact.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
hip-hop programming language

SavageMessiah
Jan 28, 2009

Emotionally drained and spookified

Toilet Rascal

Luigi Thirty posted:

Back when PHP had less than 100 functions and the
function hashing mechanism was strlen(). In order to get a nice hash
distribution of function names across the various function name lengths
names were picked specifically to make them fit into a specific length
bucket.

rasssssmmuuuuusssss

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug
"composition vs. inheritance" is basically preferring higher normal forms but in oo languages instead of sql

Sapozhnik
Jan 2, 2005

Nap Ghost
composition vs inheritance is wishy-woshy informal bullshit that stems from the fact that oo is arbitrary garbage

just give me function overloading (i.e. not methods) with dynamic dispatch idgaf about all the other poo poo

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

Symbolic Butt posted:

I taught a kid some javascript doing a substitution cipher and I guess she really liked it. today she showed me like this 200 lines code to make the ultimate cipher made of other ciphers and you type "lol" and it becomes a buncha tamil characters or some poo poo.

nice!

kids are great

Zombywuf
Mar 29, 2008

Yeah, you know what I was saying about the NSA just throwing money at companies?

/smug

Deacon of Delicious
Aug 20, 2007

I bet the twist ending is Dracula's dick-babies

Zombywuf posted:

Yeah, you know what I was saying about the NSA just throwing money at companies?

/smug

no

tef
May 30, 2004

-> some l-system crap ->
rip this thread

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
rip im sorry

Posting Principle
Dec 10, 2011

by Ralp
tef i liked your tweets about pg but it felt like pissing into the wind. are you mad a lot irl?

power botton
Nov 2, 2011

Posting Principle posted:

tef i liked your tweets about pg but it felt like pissing into the wind. are you mad a lot irl?

no and fishmech isnt autistic irl either

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
fishmech is still alive?

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

Otto Skorzeny posted:

fishmech is still alive?

he's Install Windows

skeevy achievements
Feb 25, 2008

by merry exmarx
I was just about to say the same thing about tef but he's git clone trooper now?

I miss the simple times when tef had shaggar's av and shaggar had tbc's av and tbc had tef's av

power botton
Nov 2, 2011

lol ur all dumb

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

Internaut! posted:

I was just about to say the same thing about tef but he's git clone trooper now?

I miss the simple times when tef had shaggar's av and shaggar had tbc's av and tbc had tef's av

the good old days

Notorious b.s.d.
Jan 25, 2003

by Reene

git clone trooper posted:

no and fishmech isnt autistic irl either

i don't believe this for one second

MononcQc
May 29, 2007

I thought "oh nice the thread is alive" but welp. Happy new year, PL thread.

Opinion Haver
Apr 9, 2007

emacs may have a package for anything but half the time the package just completely sucks and if it's less than like 300LOC rather than customizing it to do just what you want you're probably better off writing one from scratch

i am given to understand that lisp in general is like that

Notorious b.s.d.
Jan 25, 2003

by Reene

Opinion Haver posted:

emacs may have a package for anything but half the time the package just completely sucks and if it's less than like 300LOC rather than customizing it to do just what you want you're probably better off writing one from scratch

i am given to understand that lisp in general is like that

common lisp has this syndrome much worse than emacs does

cowboy beepboop
Feb 24, 2001

MononcQc posted:

I thought "oh nice the thread is alive" but welp. Happy new year, PL thread.

hello mr erlang man is chicago boss any good

Adbot
ADBOT LOVES YOU

JewKiller 3000
Nov 28, 2006

by Lowtax

Mr Dog posted:

composition vs inheritance is wishy-woshy informal bullshit that stems from the fact that oo is arbitrary garbage

just give me function overloading (i.e. not methods) with dynamic dispatch idgaf about all the other poo poo

if a function that can be overloaded and supports dynamic dispatch is not a method, what is a method?

you can't claim in the same post that oop is arbitrary garbage and then insist on the core feature of oop

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply