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
Shaggar
Apr 26, 2006

Shameproof posted:

I think var is fine iff the type name is in the method that returns it. So
code:
var meltingPoint = new Temperature(32,'F');
var meltingPoint = Temperature.MeltingPointFor("water"); //Not using a constructor, but still
							 //likely to be a Temperature.
var meltingPoint = PhysicsConstants.TemperatureLookup("WaterMeltingPoint"); //Not using Temperature struct directly,
									    //but the method says temperature so it should be fine.
are good uses of var while
code:
var meltingPoint = 32.Degrees('F'); //Using extension method,
				    //which may not return a Temperature.
var meltingPoint = Water.FreezingPoint; //Water may have changed the type
					//used for this property.
var meltingPoint = PhysicsConstants.Lookup("WaterMeltingPoint"); //Same problem as above.
are not.

i agree, but its just another thing to gently caress up that people will gently caress up. java forces you to do the right thing always which is one of the things i like about it. people gettin mad bout long type declarations are probably scrubs used to writing their badlanguages in text editors.

Adbot
ADBOT LOVES YOU

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
i put shaggar on ignore and 7 weeks later i had a programming job

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
luv ya, buddy

EVGA Longoria
Dec 25, 2005

Let's go exploring!

JawnV6 posted:

it's not "learn x language to be a good programmer" thats stupid

it's the reverse, "languages teach you not to want what they cannot provide". like if you were chugging along in BASIC and thought BASIC had everything, the concept of the language having special features for classes that can do the heavy lifting for vtables should blow your mind. it's like opening that "computer can do that?" door all over again

i swear ill get through higher order perl guys, probably going to order a hard copy for the bookmark-guilt to be tangible

I read higher order perl

It's got some interesting stuff, but it is really repetitive. "I wrote this function. What if you want it to do x too? I rewrote it to do that. But that's really bad practice, so I've tweaked it to do x in a different way. Now it's great!" *new chapter* "so that function we wrote last chapter needs to be reworked"

It has a lot of great information on perl's scopes and the things you can use them for. Also using anonymous functions effectively. If youre familiar with perl I'm not sure it adds much

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror

CaptainMeatpants posted:

and for the love of god do at least one decent sized project without jquery

ugh. this is like those people that say you should learn c so you know about pointers/memory management/stupid antiquated poo poo

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
god drat perl is cool
like srs every day im learning a new module and some new poo poo to do and am constantly thinking of ways to implement it, as a language it never frustrates me without my fuckup being the root cause, i am pretty good with the debugger at this point, hell yeah

CaptainMeatpants
Jun 1, 2010

Tiny Bug Child posted:

ugh. this is like those people that say you should learn c so you know about pointers/memory management/stupid antiquated poo poo

hey you don't have to do that if you dont want to learn about programming

but the guy said he wanted to learn about programming

NeoHentaiMaster
Jul 13, 2004
More well adjusted then you'd think.

Jonny 290 posted:

god drat perl is cool
like srs every day im learning a new module and some new poo poo to do and am constantly thinking of ways to implement it, as a language it never frustrates me without my fuckup being the root cause, i am pretty good with the debugger at this point, hell yeah

Now you can look forward to constant frustration as 'people' tell you its a dead language that was only good for 'simple scripts'

EVGA Longoria
Dec 25, 2005

Let's go exploring!

Jonny 290 posted:

god drat perl is cool
like srs every day im learning a new module and some new poo poo to do and am constantly thinking of ways to implement it, as a language it never frustrates me without my fuckup being the root cause, i am pretty good with the debugger at this point, hell yeah

Do you have a good resource for the debugger cause I haven't been using it and I think I should be for my next project

coaxmetal
Oct 21, 2010

I flamed me own dad

Tiny Bug Child posted:

ugh. this is like those people that say you should learn c so you know about pointers/memory management/stupid antiquated poo poo

you really should learn c. And maybe some ASM too. its good to know about what is lower level than the poo poo you program, gives you some insight into it.


PLus c owns.

coaxmetal
Oct 21, 2010

I flamed me own dad
also, perl dudes: i've never really done much perl, what kinda oo is it? also how high level, comparatively. Tia.

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

Sweeper posted:

i want to read a blog that teaches me about the latest and greatest in programming languages without having to read giant white papers full of math and poo poo i dont feel like reading

lambda the ultimate

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

Ronald Raiden posted:

also, perl dudes: i've never really done much perl, what kinda oo is it? also how high level, comparatively. Tia.

perl's object oriented facilities are provided via moose, which is essentially a port of CLOS from lisp if you're familiar with that. it's very high level (the canonical style is more or less declarative), supports traits/roles, composition thereof, traditional inheritance, really deep introspection, and has a metaobject protocol such that the object framework itself is extensible (there are a bit over seven hundred packages in the MooseX namespace - this isn't for show)


there are some that will tell you that perl has some other object oriented system, based on python's old-style classes with some of larry wall's zany nomenclature thrown in; if you run into one of these people, shoot them.

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

Jonny 290 posted:

god drat perl is cool
like srs every day im learning a new module and some new poo poo to do and am constantly thinking of ways to implement it, as a language it never frustrates me without my fuckup being the root cause, i am pretty good with the debugger at this point, hell yeah

ps devel::nytprof is real cool i'm told

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

Casao posted:

It has a lot of great information on perl's scopes and the things you can use them for. Also using anonymous functions effectively. If youre familiar with perl I'm not sure it adds much

it introduces closures, function composition, and laziness pretty well. the first you might know just from being a language lawyer but the other two you wouldn't. the incrementalism you mentioned is pretty common in tutorial works as a way to introduce new concepts or features with the motivation for using them

CaptainMeatpants
Jun 1, 2010

no way are you gettin 5 in a row buddy

coaxmetal
Oct 21, 2010

I flamed me own dad

Otto Skorzeny posted:

perl's object oriented facilities are provided via moose, which is essentially a port of CLOS from lisp if you're familiar with that. it's very high level (the canonical style is more or less declarative), supports traits/roles, composition thereof, traditional inheritance, really deep introspection, and has a metaobject protocol such that the object framework itself is extensible (there are a bit over seven hundred packages in the MooseX namespace - this isn't for show)


there are some that will tell you that perl has some other object oriented system, based on python's old-style classes with some of larry wall's zany nomenclature thrown in; if you run into one of these people, shoot them.

that sounds promising, and makes me kinda want to give perl another shot.

In whatever the newest perl is, How oo is it? is everyting including functions a first-class object, or is it half-assed oo like java.

coaxmetal
Oct 21, 2010

I flamed me own dad
or php but that's really not worth mentioning, except to invoke tbc. php OO is like, .000001 assed.

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror
what's wrong with php oo

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
perl debugger is dead simple, at least how i use it

-d flag to invoke of course
add this up top:
use Data::Dumper;

s to single step (after you s you can just enter enter enter to step)

c <line number> or c <sub> breaks you there
c <enter> to just blow through to the end
R restarts from the beginning
L lists your breakpoints
V lists your vars
S lists subroutines

p <$scalar> prints it
x <@array or %hash> prints those
but dont use that
use
print Dumper(\%hash)

if you want to do a postmortem on your vars, do an o inhibit_exit before you c


also imo it is easier + faster to gently caress around in the debugger versus writing/running if you're just learning how print works and poo poo. run 'perl -de 1', boom youre in a clean interpreter. R wipes your vars, fresh start.

Jonny 290 fucked around with this message at 04:32 on Jul 10, 2012

coaxmetal
Oct 21, 2010

I flamed me own dad

Tiny Bug Child posted:

what's wrong with php oo

ugh im arguing with tbc but im drunk so whatever ill bite.


The oo itself isn't completely terrible, but its super inconsitent, you can't expect any given thing to behave like an object, some behave sorta l ike some, some aren't and....



actually gently caress it, nevermind. I'm not gonna do this. PHP is bad but arguing with tbc about it, even drunk, will get me nowhere. TBC I love you. But no homo.


Well, Maybe A little homo, if we get some taco bell in the mix.

salted hash browns
Mar 26, 2007
ykrop
github just raised $100M in their first round of funding.

drat

CaptainMeatpants
Jun 1, 2010

nice that should be one hell of a logo redesign

Nomnom Cookie
Aug 30, 2009



Php type definitions are static but php variables are dynamically typed. It's the worst thing ever and the best you can do is c++ for retards without all the handholding you get from a c++ compiler.

CaptainMeatpants
Jun 1, 2010

woah when did PHP add reflection, that's sort of useful

CaptainMeatpants
Jun 1, 2010

quote:

Please note that certain parts of the internal API are missing the necessary code to work with the Reflection extension. E.g., an internal PHP class might be missing reflection data for properties. These few cases are considered bugs, however, so they should be discovered and fixed.

is there a :dice: for php

homercles
Feb 14, 2010

What I like about Perl, in addition to all that stuff previously mentioned is lists. gently caress yeah lists! Get your hash keys or values or take some array, throw it into map and grep and maybe take some stuff from List::Util/List::MoreUtils (like zip, mesh, partition into multiple arrays) and baby you've got a stew going

As for the Java stuff, to be more specific in Java 7 "Type Inference for Generic Instance Creation" was added, that is the RHS of an assignment can omit type parameters, so this:

Map<String, List<Trade>> trades = new TreeMap<String, List<Trade>> ();
becomes
Map<String, List<Trade>> trades = new TreeMap<> ();

So, it is some minor syntax sugar that applies to the RHS of an assignment. Better than nothing I guess?

tef please also learn scala and post about that

TiMBuS
Sep 25, 2007

LOL WUT?

it is good to see perl getting the love it deserves.

Ronald Raiden posted:

that sounds promising, and makes me kinda want to give perl another shot.

In whatever the newest perl is, How oo is it? is everyting including functions a first-class object, or is it half-assed oo like java.

oh man its my time to shine:
*deep breath*

In perl 6 everything is an object -- actually, it's a metaobject which can be represented by anything; you can declare an object that is actually mapped to a C struct for instance.
But yes! Even classes are objects. They don't need to be initialized! here, read a code:
Perl code:
class Point { 
  has $.x; 
  has $.y; 
}

my $a = Point;       #$a now holds the typeclass 'Point'
my Point $b;         #$b is now of the type 'Point'.
$b = $a.new(x => 3); #Just let that poo poo sink in now.
Functions are objects too yes, but not everything is a method call on an object, this isn't smalltalk. functions are quite useful: for example most operators are functions that can be redefined. New operators can be defined and added and can even have their precedence defined (ie tighter than +, looser than *, etc). This is possible because:
The actual grammar of the language is also first class and can be accessed as if it were a 'regex'. I say regex because perl 6 actually uses full recursive grammars as its regex, and the parser is written using said grammars. This means the language can be redefined during compile-time by altering its parsing grammar. Here's how:
Perl code:
#An operator to combine two things into one list:
sub infix:<Y> ($left, $right) { 
  return ($left, $right) 
}
This will modify the grammar and slip the 'Y' infix operator in for you. now you can make a lovely pair tuple by going:
my $tup = 4 Y 'fart';

This is pretty swell because then metaoperators get involved. What the gently caress are they, you probably didn't ask? yu should know, you've undoubtedly used one:
$a += 5;

^ Metaoperator! an operator that uses another operator. Lets get the awful Y combinator thing I just made and try it out:
Perl code:
my $foo = 1; 
$foo Y= "teh";
say $foo.perl() # Prints (1, "teh") holy poo poo its amazing
and since you invoke methods with a dot, you can also do this metaoperation:
Perl code:
$butt .= new; #which will assign you a shiny new Butt class provided $butt was a Butt 
#which you could have declared just like any other language:
my Butt $butt;

#so for short:
my Butt $butt .= new()
^ Which fully fuckin solves the 'ObjectType $var = new ObjectType()' wordy crap without having to use 'auto' (which moves the ObjectType to the wrong side of the assignment). And it's solved by the actual mechanisms of the language. gently caress you. Go learn you a perl 6.

EVGA Longoria
Dec 25, 2005

Let's go exploring!

Perl 6 isn't perl yet sorry bro

tef
May 30, 2004

-> some l-system crap ->

Otto Skorzeny posted:

lambda the ultimate

lol

Otto Skorzeny posted:

there are some that will tell you that perl has some other object oriented system, based on python's old-style classes with some of larry wall's zany nomenclature thrown in; if you run into one of these people, shoot them.

it's more likely than you think. but yeah jonny might have issues with moose on ~5.0~

tef
May 30, 2004

-> some l-system crap ->
http://vimeo.com/45474360 welp so I gave a talk.


but someone else's talk http://vimeo.com/45433299 was much better.

tef fucked around with this message at 14:23 on Jul 10, 2012

Zombywuf
Mar 29, 2008

Jonny 290 posted:

god drat perl is cool
like srs every day im learning a new module and some new poo poo to do and am constantly thinking of ways to implement it, as a language it never frustrates me without my fuckup being the root cause, i am pretty good with the debugger at this point, hell yeah

Stop it, you're making me jealous.

TiMBuS
Sep 25, 2007

LOL WUT?

Casao posted:

Perl 6 isn't perl yet sorry bro

he asked, unless u think he really wanted to know if everything in perl 5.16 was a 1st class object

MononcQc
May 29, 2007

I don't know guys, I think programming is pretty rad. What sucks is the bunch of lovely business problems that many get paid to solve while they'd never ever touch that poo poo for free. I.e. what sucks is more often the environment you program in and the problems you solve, not programming itself.

text editor
Jan 8, 2007

MononcQc posted:

I don't know guys, I think programming is pretty rad. What sucks is the bunch of lovely business problems that many get paid to solve while they'd never ever touch that poo poo for free. I.e. what sucks is more often the environment you program in and the problems you solve, not programming itself.

well of course everyone feels this way

skeevy achievements
Feb 25, 2008

by merry exmarx

Apocadall posted:

i'm currently working my way through code academy for the past couple weeks trying to understand programming better. while it has been enjoyable and i like the way the teaching itself is set up i have had a few people tell me that i should do more with java or learn c++ before using js because it will create bad habits. is this true and how do people here recommend self-teaching, past week i've been trying to teach myself linear algebra but that is going to a much harder task i'm feeling.

also on the subject of self-teaching, how do you tell an employer about self-taught skills? do you keep a portfolio of projects you have worked on? with stuff such as networking and computers i can at least go get a certification to have proof of my knowledge, are there certifications in programming languages?

congrats on being a stand up self learner

c++ gives you more rope to hang yourself with than java, if your goal is to learn c++ and java then you're stuck, but if your goal is to learn a modern oo language then I'd probably recommend python as it's easier to start with - js is junk but useful if you want a web programming job

linear algebra (and probably most types of math) are way more fun to learn if you have a fancy calculator to actually grind the numbers for you, I always recommend MATLAB but depending on what your interests are and what you're learning, Excel may work just as well (if you plan to work in a numerate field, learn both)

certifications can make you learn things about a language or piece of tech that you wouldn't otherwise know and reinforce your confidence for interviews, they're not a panacea but only a hipster employer would think less of you for spending the time, effort and money to attain them - that said I'm sure there's a huge spectrum of quality and cost effectiveness in the certifications out there so do your homework

tef
May 30, 2004

-> some l-system crap ->

Internaut! posted:

hipster employer would think less of you for spending the time, effort and money to attain them - that said I'm sure there's a huge spectrum of quality and cost effectiveness in the certifications out there so do your homework

I found that there is no correlation between certificates and ability, or at least not a significant enough one to warrant only looking at certified programmers.

Shaggar
Apr 26, 2006

Internaut! posted:

congrats on being a stand up self learner

c++ gives you more rope to hang yourself with than java, if your goal is to learn c++ and java then you're stuck, but if your goal is to learn a modern oo language then I'd probably recommend python as it's easier to start with - js is junk but useful if you want a web programming job

linear algebra (and probably most types of math) are way more fun to learn if you have a fancy calculator to actually grind the numbers for you, I always recommend MATLAB but depending on what your interests are and what you're learning, Excel may work just as well (if you plan to work in a numerate field, learn both)

certifications can make you learn things about a language or piece of tech that you wouldn't otherwise know and reinforce your confidence for interviews, they're not a panacea but only a hipster employer would think less of you for spending the time, effort and money to attain them - that said I'm sure there's a huge spectrum of quality and cost effectiveness in the certifications out there so do your homework

python is bad. dont learn python

coaxmetal
Oct 21, 2010

I flamed me own dad
on the other hand, python is good, do learn python.




really makes u think

Adbot
ADBOT LOVES YOU

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
don't listen to shaggar, learn all the languages.

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