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
Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp

Cybernetic Vermin posted:

do you feel that your life took a wrong turn at some point?

Actually the balloon story on the Onion got me thinking and i spent a few hours thinking about it last night and i figured out my balloon incident. so yes, i can pinpoint it to spring in third grade. ill write it out later on, i have a shitload of stuff to hit today

Adbot
ADBOT LOVES YOU

skeevy achievements
Feb 25, 2008

by merry exmarx

Cybernetic Vermin posted:

does anyone seriously read source code without specific purpose and direction?

yeah linux source is great if you're like me and weren't forced to write your own OS in school

doom iphone code was great to read out of curiosity to see what programming gamez is like

but like open sores code or work code without a specific need to understand/fix something? lol no

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Internaut! posted:

yeah linux source is great if you're like me and weren't forced to build your own OS in school

doom iphone code was great to read out of curiosity to see what programming gamez is like

these are both purposes and directions

Squinty Applebottom
Jan 1, 2013

on fridays i curl up with my cats, bottle of wine, and just read source by the fire

weird
Jun 4, 2012

by zen death robot

rotor posted:

perl gets an undeservedly bad rap for large software projects.

the limiting factor is the availability of decent perl programmers and people who are willing to write perl well, not anything to do with perl itself. it's sort of a self-fulfilling prophecy when shitheads who dont know gently caress from poo poo start complaining about how you can't write large programs in $LANGUAGE and people start listening to them.
But why would you want to? Perl was designed as a /bin/sh alternative, and most of its featureset reflects that. You can write large projects in Perl, as in any other language, but I don't see many features in it that make it a standout choice for that kind of thing.

Larry Wall posted:

Perl is, in intent, a cleaned up and summarized version of that wonderful semi-natural language known as 'Unix'.

weird
Jun 4, 2012

by zen death robot

Carthag posted:

whats a good book on like idiomatic C or whatever. i feel like when i write C sometimes i just mash keywords in a row and delete poo poo until it compiles

I really liked Plauger's book on the implementation of the standard library.

b0lt
Apr 29, 2005

rotor posted:

the last two places i've been have had what amounted to nonreplaceable perl infrastructure and were constantly hunting for senior-level perl people and never found them.

idiot posted:

Code repositories and version control are gone. We work on live
sites (Pipelines protects us from stupidity), never document code (it's
legible, that's the point), and focus on the client's business
requirements. We sell them the flexibility upon which they depend.

Required skills:
raw perl (no modules), javascript, building web-sites using some kind of
templating language (e.g. template toolkit).

You must hate version control systems, we won't be using any. You must
hate commenting and documenting code, it's redundant to anyone who can read
the code. You must hate block-style css, it over-abstracts layout. You
must hate optmizing code or writing efficient code, that's not the point.
Everything we do here prioritizes the ability for the client to make
changes. That's the only speed that counts.

uG
Apr 23, 2003

by Ralp

VanillaKid posted:

But why would you want to? Perl was designed as a /bin/sh alternative, and most of its featureset reflects that. You can write large projects in Perl, as in any other language, but I don't see many features in it that make it a standout choice for that kind of thing.
Said the only person in the world who has never heard of CPAN

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

VanillaKid posted:

But why would you want to? Perl was designed as a /bin/sh alternative, and most of its featureset reflects that.

it's not a /bin/sh alternative so much as a sed/grep/ack alternative, and as perl people did more with it they grew the language until about twenty years ago when they just kind of gave up changing it ever again

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

VanillaKid posted:

But why would you want to? Perl was designed as a /bin/sh alternative, and most of its featureset reflects that. You can write large projects in Perl, as in any other language, but I don't see many features in it that make it a standout choice for that kind of thing.

you know, now that you've asked, i dont really know. i dont know why you'd want to use perl for producing web pages, it's not well-suited for text handling or manipulating character streams or doing things with files.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

rotor posted:

you know, now that you've asked, i dont really know. i dont know why you'd want to use perl for producing web pages, it's not well-suited for text handling or manipulating character streams or doing things with files.
perl wasn't particularly ubiquitous in 1995 and never had a good library for handling cgi environment variables and http headers 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
I wouldn't say that the language stopped moving at 5.0 or 5.6/5.8. Since about 2007 the pace of Perl 5 development picked up again (not to mention the large changes in best practices that happened in the early 2000s) and they're releasing a new version every year now, with reasonably large changes. 5.16 is considerably different from 5.6/5.8 that a bunch of folks are frozen on for a lot of pretty basic things.

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
incidentally this kick in the pants to perl 5 was spurred by people giving up on perl 6 and barfing at jumping ship to ruby

weird
Jun 4, 2012

by zen death robot

rotor posted:

you know, now that you've asked, i dont really know. i dont know why you'd want to use perl for producing web pages, it's not well-suited for text handling or manipulating character streams or doing things with files.

Right, Perl's good at being the Unix shell on steroids. I guess I just assumed large scale web development was more than munging text??? idk I don't care about web development. Since the question was contrasting Perl with C, I figured we were more talking about applications programming anyway

uG
Apr 23, 2003

by Ralp
What world class ORM does C have?

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum
i have a java problem cause im dumb and dont know java

i have an interface, and i want one of the functions to take an argument with the type of the implementing class

what is this called, idk how to google it. i have a weird hodgepodge of generic templating going on, but i have a couple unchecked casts so i think im missing something

ex:

public class Foo implements Bar {
// from Bar
public void do(Foo foo) { /* do something with Foo type */ }
}

public interface Bar {
public void do(<ImplementingType> foo);
}

what am i doing wrong with my design people smarter than me??

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

uG posted:

What world class ORM does C have?

C doesn't have language-level support for Os, nobody wants to write an ORM for it

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

VanillaKid posted:

Right, Perl's good at being the Unix shell on steroids. I guess I just assumed large scale web development was more than munging text???

yeah, there's also databases

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Sweeper posted:

i have a java problem cause im dumb and dont know java

i have an interface, and i want one of the functions to take an argument with the type of the implementing class

what is this called, idk how to google it. i have a weird hodgepodge of generic templating going on, but i have a couple unchecked casts so i think im missing something

ex:

public class Foo implements Bar {
// from Bar
public void do(Foo foo) { /* do something with Foo type */ }
}

public interface Bar {
public void do(<ImplementingType> foo);
}

what am i doing wrong with my design people smarter than me??

your design is probably wrong, because you can't do that with an interface contract

is there any reason you can't do with another implementer of the interface?

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum

Cocoa Crispies posted:

your design is probably wrong, because you can't do that with an interface contract

is there any reason you can't do with another implementer of the interface?

yea its definitely a design issue im not seeing an easy way to fix it and i dont care enough about unchecked casts to the concrete type to fix it :v:

basically I refer to objects as Bars, but one of the functions of Bar needs to be the concrete type because it needs properties of the concrete type. the problem is the properties aren't generic between concrete types

edit:
im doing a genetic algorithm of source for optimization and i made it all generic, but i need to do the crossover with concrete classes

Sweeper fucked around with this message at 21:55 on Mar 6, 2013

MeruFM
Jul 27, 2010
You can somewhat force it with generics.

Sweeper posted:

code:
public class Foo implements Bar<Foo> {
   // from Bar
   public void do(Foo foo) { /* do something with Foo type */ }
}

public interface Bar<T extends Bar<T>> {
   public void do(T foo);
}

But then it also lets you use Bar<Baz> instead of Bar<Foo>.

raminasi
Jan 25, 2005

a last drink with no ice

Sweeper posted:

what am i doing wrong with my design people

why do you need do to be in the interface

JewKiller 3000
Nov 28, 2006

by Lowtax

Sweeper posted:

one of the functions of Bar needs to be the concrete type because it needs properties of the concrete type. the problem is the properties aren't generic between concrete types

then don't put them in the generic interface?

efb god dammit

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum

JewKiller 3000 posted:

then don't put them in the generic interface?

efb god dammit

its a generic operation that happens with a specific type :v:

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum
hah i know how to fix it nvm im dumb, just not going to refer to them as the interface type and use a generic type which implements the interface

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum
dont do drugs

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum
kidding do all the drugs

FlapYoJacks
Feb 12, 2009

Cocoa Crispies posted:

C doesn't have language-level support for Os, nobody wants to write an ORM for it

It may not, but I still program it with Os in mind.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
sling that poo poo boy

temp code, dont hate.
poo poo works
chuggin thru some xml arrays

code:
sub FindandReplace() {
	my @actionarr = @_;
	my %actionhash = %{shift @actionarr};
        my $actiontag = $actionhash{'id'};
        shift @actionarr;
        my $file = @{shift @actionarr}[2];
            my %replacehash;
        while ($actionarr[0] ne "apd") {
        shift @actionarr;
        my $from = @{shift @actionarr}[2];
        shift @actionarr;
        my $to = @{shift @actionarr}[2];
        $replacehash{$from} = $to;
        }
        foreach (keys %replacehash) {
        $replaces{$actiontag}{$file}{$_} = $replacehash{$_};
        }
        shift @actionarr;
        push(@apds, @{shift @actionarr}[2]);
	
}
it looks gross for now but fortunately that will chop down about 50% once i spend some time on it

uG
Apr 23, 2003

by Ralp
I'm the foreach loop that should be $replaces{$actiontag}{$file} = $replacehash; or map {$replaces{$actiontag}{$file}{$_} = $replacehash{$_} } keys %$replacehash; (or something)

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
there is a possibility that we'd have to run it multiple times if there are multi lines with same ID and file, I was just dancing to make sure we didn't overwrite old hashes. its pretty mind bending to go this deep but i'm coping ok

Nomnom Cookie
Aug 30, 2009



Jonny 290 posted:

sling that poo poo boy

temp code, dont hate.
poo poo works
chuggin thru some xml arrays

code:

sub FindandReplace() {
	my @actionarr = @_;
	my %actionhash = %{shift @actionarr};
        my $actiontag = $actionhash{'id'};
        shift @actionarr;
        my $file = @{shift @actionarr}[2];
            my %replacehash;
        while ($actionarr[0] ne "apd") {
        shift @actionarr;
        my $from = @{shift @actionarr}[2];
        shift @actionarr;
        my $to = @{shift @actionarr}[2];
        $replacehash{$from} = $to;
        }
        foreach (keys %replacehash) {
        $replaces{$actiontag}{$file}{$_} = $replacehash{$_};
        }
        shift @actionarr;
        push(@apds, @{shift @actionarr}[2]);
	
}

it looks gross for now but fortunately that will chop down about 50% once i spend some time on it

XML processing? U need xslt

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
I have XML::Parser, and that is it.

this is due on 15th by COB, it would take 8-12 months to get a single perl module added to 10,500 walmart servers

uG
Apr 23, 2003

by Ralp
You could just ship/include everything in local::lib with the project or some poo poo.

or do it all in regex

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp

uG posted:

You could just ship/include everything in local::lib with the project or some poo poo.

or do it all in regex

oh god the regex based parser i was working on yesterday
aaaaa
anyways their poo poo's super locked down and stuff like inlined/slipstreamed/whatever modules and libs will deffo fail code review. i wish i could just do that stuff and be done with it

Cybernetic Vermin
Apr 18, 2005

just got a paper about perl regexes accepted at a conference, i am now indebted to larry.

tef
May 30, 2004

-> some l-system crap ->

Sweeper posted:

kidding do all the drugs

then regret it and post stories about hosed up people

tef
May 30, 2004

-> some l-system crap ->

Nomnom Cookie posted:

XML processing? U need xslt

xslt is pretty neat but that's really cos of xpath. xpath is neat as hell.

Adbot
ADBOT LOVES YOU

tef
May 30, 2004

-> some l-system crap ->

Jonny 290 posted:

anyways their poo poo's super locked down and stuff like inlined/slipstreamed/whatever modules and libs will deffo fail code review. i wish i could just do that stuff and be done with it

this is going to sound hilariously bad, but what about you write some perl scripts to write perl scripts :2bong:

what I mean is that you can basically compile xpaths into perl code using xml::parser. autogenerated stuff will probably pass code review, cos it will look pretty much like what you have already

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