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
duTrieux.
Oct 9, 2003

tef posted:




oh my god

Adbot
ADBOT LOVES YOU

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

Police Academy III posted:

ya, you've got to spend like 6 lines of code just to make some dumb class to hold 2 values and then 8 more lines for getters + setters if you don't want to piss off the java oop sperg gods. basically what im saying is that java is terrible.

It's you, the dumbo that doesn't use an IDE to auto generate that poo poo and forget it.


iamthexander posted:

I do, ~23500 items.

Thinking LinkedArray might actually be the best here since I never need random access and only need to iterate through the whole thing. Any benefits to using a Pair class over creating my own shell class?

Also new step: now lets say I have the following objects:

code:
LinkedList myList1;
LinkedList myList2;
...
LinkedList myListn;
Where should I toss those Lists so I can access them programatically by their names (something like 'return yosposArrays["myList17"];')? HashMap?
The pair class is useful if you only really need 2 things to be grouped together because it can be reused later to hold 2 other things without having to create a bunch of shell classes.

Also you're last question really reeks of the XY problem. What are you trying to do with named variables? The short answer without knowing jack poo poo is to use a Map with the variable names as the Keys, and the Lists as the values.

tef
May 30, 2004

-> some l-system crap ->

MEAT TREAT posted:

It's you, the dumbo that doesn't use an IDE to auto generate that poo poo and forget it.

http://projectlombok.org/slideshow.html :q:

skeevy achievements
Feb 25, 2008

by merry exmarx
assuming there's no simple tuple in java(?) iirc in you can have public inner classes which might be a handy way to build those one-off return types without polluting your file system

like

code:
public class MyList {
  
  public class Pair {
    // vars and accessors
  }

  public MyList.Pair getNext() {
    // etc.
  }

}
dunno if that's idiomatic or not but probably beats having your source directories littered with one-off return types


eh no more like typing "rint count" or whatever in IDEA, hitting crtl space -> Generate Accessors and it generate a private int variable called with public accessors

guys who are good at IDEA can have 80%+ of their code generated, it's pretty cool to watch code explode out from a few keystrokes

skeevy achievements fucked around with this message at 00:34 on May 19, 2012

coaxmetal
Oct 21, 2010

I flamed me own dad

tef posted:




ahahahahahaha

salted hash browns
Mar 26, 2007
ykrop

MEAT TREAT posted:

Also you're last question really reeks of the XY problem. What are you trying to do with named variables? The short answer without knowing jack poo poo is to use a Map with the variable names as the Keys, and the Lists as the values.

So essentially I have this kind of data:
code:
[timestamp][name][value]
0000000001  AAA1  100
0000000001  BBB2  728
0000000001  CCC3  343
...
0000000043  AAA1  233
0000000043  BBB2  111
0000000043  CCC3  552
And I want to obtain the objects 'AAA1', 'BBB2', 'CCC3' (that contain timestamp and value in order) so that I can perform comparisons against each possible combination, for example:

code:
myCompareFunction(AAA1, BBB2);
myCompareFunction(AAA1, CCC3);
myCompareFunction(BBB2, CCC3);
Except in reality I have like 500 of those objects. There has to be a better way of doing this!

Opinion Haver
Apr 9, 2007

tef posted:




jesus



e: holy poo poo he says he's a feminist in his profile ahahhah

Opinion Haver fucked around with this message at 09:37 on May 19, 2012

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
reverse sexism :argh:

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
is nick donnelly someone is should know/care about, or just some random nerd obn the internet?

tef
May 30, 2004

-> some l-system crap ->
just another dickhead

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
hehhhhhh

tef
May 30, 2004

-> some l-system crap ->
http://nodephp.org/

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
i can tell im developing as a coder because instead of just emptyquoting stuff like that with a "loll" i now take a minute to actually get fuckin' horrified at what the gently caress im looking at

0xB16B00B5
Aug 24, 2006

by Y Kant Ozma Post
im making my next website in react

http://nodephp.org

cowboy beepboop
Feb 24, 2001

tef posted:

http://nodephp.org/

no. no..

tef
May 30, 2004

-> some l-system crap ->

my stepdads beer posted:

no. no..

YES. YES.

tef
May 30, 2004

-> some l-system crap ->
personally I can't wait for this node fever to reach java, and someone ports the 'reactor' to the java including a nice big old xml file for establishing the services

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe
Server running at http://127.0.0.1:1337

tef
May 30, 2004

-> some l-system crap ->

Internaut! posted:

tef how on a scale of 1-10 how much do you sneer at domain specific languages implemented in lisp dialects

lisp would be a good language if there was some way to use it without turning into an rear end in a top hat. I think it might have something to do with metaprogramming, i'm not sure.

probably something about how instead of writing in a language other people can use, lisp users are encouraged to write their own language only they can use. yadda yadda yadda.

lisp — the best way to show *exactly* how clever you are to all those other programmers.

tef
May 30, 2004

-> some l-system crap ->
I guess that may count as 10 on sneering, but it is more of a 'why would you go and do a thing' :stare:

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

tef posted:

lisp would be a good language if there was some way to use it without turning into an rear end in a top hat. I think it might have something to do with metaprogramming, i'm not sure.

i guess i need to start writing some macros :q:

skeevy achievements
Feb 25, 2008

by merry exmarx

tef posted:

I guess that may count as 10 on sneering, but it is more of a 'why would you go and do a thing' :stare:

consulting dollars, presumably big ones

I'm flipping through this book on DSLs for kicks and the author with a straight face is relaying how his company built a DSL for trading where traders would enter trades ala the following:

code:
place orders (
  new Order to buy(100 sharesOf "IBM")
    limitPrice 300
    allOrNone
    using premiumPricing,
  new Order to buy(200 sharesOf "CISCO")
    limitOnClosePrice 300
    using premiumPricing,
    new Order to buy(200 sharesOf "GOOGLE")
    limitOnOpenPrice 300
    using defaultPricing
)
can you imagine any possible problems with this approach to entering trades versus doing so in a custom written and tightly controlled gui

that said small macros to handle tedious poo poo like that regex switch statement I mentioned earlier seems like ownage but let me try debugging a few and get back to you :suicide:

skeevy achievements fucked around with this message at 15:43 on May 19, 2012

Rufus Ping
Dec 27, 2006





I'm a Friend of Rodney Nano
DSL joke

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror

tef posted:

http://nodephp.org/

noooo these people aren't even supposed to like php

My Linux Rig
Mar 27, 2010
Probation
Can't post for 6 years!

Tiny Bug Child posted:

noooo people aren't even supposed to like php

tef
May 30, 2004

-> some l-system crap ->

Internaut! posted:

consulting dollars, presumably big ones

it is more of the 'rubyist' look ma I made a dsl *inside* a general purpose language that gets me. it isn't a real domain specific language unless the parse errors/stack traces are about that language.

:colbert:

without coming over all spolsky, one of the few bits of terminology he nailed was 'leaky abstractions'. I am yet to see a so-called "Embedded DSL" in practice that didn't demand knowledge of the host language, especially when debugging it.


quote:

I'm flipping through this book on DSLs for kicks and the author with a straight face is relaying how his company built a DSL for trading where traders would enter trades ala the following:

DSLs are often hailed as a silver bullet of programming, wherein you can get people to write programs, in programming languages, without learning how to program. I don't get it myself.

I'm a big believer in having a language with enough syntax to get by, and extending it through libraries, over a language where you grow it through adding new semantics/syntax. If you'll excuse a poor linguistic metaphor - I would rather use a language with a small grammar and a rich vocabulary, even if some constructs are clunky, than a language with a rich grammar. It is less cognitive overhead for us poor slobs who have to maintain code.


quote:

can you imagine any possible problems with this approach to entering trades versus doing so in a custom written and tightly controlled guy

I don't think those are necessarily the only option, but really, the advantages of using a text format come from the variety of tools available - source control is the obvious one. Still, we do use big and fancy gui programs to write big and fancy text programs. They aren't incompatible.

quote:

that said small macros to handle tedious poo poo like that regex switch statement I mentioned earlier seems like ownage but let me try debugging a few and get back to you :suicide:

The problem is that this compounds. not to sound like a broken window, but metaprogramming is rather moreish. You will find that each and every library has just a few macros, here and there and the complexity adds up considerably. Every file you open can have its own different ideas on flow control, syntax and structure.

This is the crux of the "lisp makes you an rear end in a top hat" problem. Without discipline and self control, programmers are free to run wild with the power tools across the code base. It makes it easy for the person writing the program to explain things, and terrible for anyone else editing the file. Metaprogramming is an antisocial activity, a toolsmithing desire to change the language to suit your needs, burdening others with your inability to explain what you want in simpler terms.

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
there are too many programming languages imo

tef
May 30, 2004

-> some l-system crap ->

rotor posted:

there are too many programming languages imo

there aren't enough different ones.

most of them are just the same language over and over again.

tef
May 30, 2004

-> some l-system crap ->

Tiny Bug Child posted:

noooo these people aren't even supposed to like php

it's u

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



software download On 2012-01-27 at 10:55
I would like to express my gratitude for your kindness supporting women who really want help with this question. Your special commitment to passing the message all over was particularly significant and have specifically made most people much like me to reach their aims. Your entire helpful instruction entails so much a person like me and still more to my colleagues. Warm regards; from all of us. I google it and found a very useful article. A code sample would be very helpful.

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.

tef posted:

I'm a big believer in having a language with enough syntax to get by, and extending it through libraries, over a language where you grow it through adding new semantics/syntax. If you'll excuse a poor linguistic metaphor - I would rather use a language with a small grammar and a rich vocabulary, even if some constructs are clunky, than a language with a rich grammar. It is less cognitive overhead for us poor slobs who have to maintain code.


I don't think those are necessarily the only option, but really, the advantages of using a text format come from the variety of tools available - source control is the obvious one. Still, we do use big and fancy gui programs to write big and fancy text programs. They aren't incompatible.


The problem is that this compounds. not to sound like a broken window, but metaprogramming is rather moreish. You will find that each and every library has just a few macros, here and there and the complexity adds up considerably. Every file you open can have its own different ideas on flow control, syntax and structure.

This is the crux of the "lisp makes you an rear end in a top hat" problem. Without discipline and self control, programmers are free to run wild with the power tools across the code base. It makes it easy for the person writing the program to explain things, and terrible for anyone else editing the file. Metaprogramming is an antisocial activity, a toolsmithing desire to change the language to suit your needs, burdening others with your inability to explain what you want in simpler terms.

the best argument for java i've ever seen

My Linux Rig
Mar 27, 2010
Probation
Can't post for 6 years!

trex eaterofcadrs posted:

the best argument for java i've ever seen

java isn't too bad

the script has issues though

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

tef posted:

there aren't enough different ones.

most of them are just the same language over and over again.

i dunno. you've got c, prolog, shell, ocaml, erlang, forth ... i'm not sure how much more different stuff you need

but yeah, i guess my complaint is that, like, why do we need perl, ruby AND python? or java, c# AND obj-c? the free market of ideas just doesn't work.

tef
May 30, 2004

-> some l-system crap ->

trex eaterofcadrs posted:

the best argument for java i've ever seen

java would be better if they'd known how people use it now compared to how they designed it.

(c.f arrays vs arraylist, primitives vs objects, final, synchronized etc)

(from what I have seen, c# is a better attempt at java with hindsight)

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

tef posted:

Metaprogramming is an antisocial activity, a toolsmithing desire to change the language to suit your needs, burdening others with your inability to explain what you want in simpler terms.

this is a seriously great quote tho

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

tef posted:


(from what I have seen, c# is a better attempt at java with hindsight)

yep.

tef
May 30, 2004

-> some l-system crap ->

rotor posted:

i dunno. you've got c, prolog, shell, ocaml, erlang, forth ... i'm not sure how much more different stuff you need

the way in which we program and the sorts of programs we have been writing have changed considerably, well considerably enough to warrant exploring new language features and new collections of features

quote:

but yeah, i guess my complaint is that, like, why do we need perl, ruby AND python? or java, c# AND obj-c? the free market of ideas just doesn't work.

there are some massive differences underpinning these, but there is no good reason to support a plethora of languages at a company (google was right :q:)

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.

tef posted:

java would be better if they'd known how people use it now compared to how they designed it.

(c.f arrays vs arraylist, primitives vs objects, final, synchronized etc)

(from what I have seen, c# is a better attempt at java with hindsight)

for sure, java was made by some pretty loving smart people who were rushed to get their thing out the door and a lot of compromises were made that C# did a better job of handling

that said, java is as close to "programmers as replaceable cogs" as i've ever seen a language get; pretty sane defaults, no real wizardry involved, syntax is dead simple, corner cases really aren't bad, jvm fixes a lot of the larger cases of programmer shittiness automatically (with a little help from javac). the standard library is kind of a cluster gently caress but javadoc is really good at allowing you to sift thru the poo poo. every time i go on msdn to look up docs for .NET i cry a little and pray for javadoc

Adbot
ADBOT LOVES YOU

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

tef posted:

there are some massive differences underpinning these

i understand that but my point is that they aim at solving the same problems in the same way and if I was Tyrant King Of The Universe i'd kill off all but one and put the development efforts all behind one of them

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