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

Mr Dog posted:

Dependency Injection is nice for webapps, how else are you going to instantiate your fifty-odd "controllers"

Spring, like many Java things, started out decent and then completely went off into the metametametaframework weeds. Implicit injection with annotations is some :okpos: poo poo and AOP makes me feel like I'm being trolled. "Yes certainly, let's implicitly alter the semantics of methods if their names match certain patterns. This sounds like a very reasonable thing to do"

I use aop to wrap methods in transactions and im pretty sure mybatis-spring uses it for mapping method names in interfaces to your sql in ur mapping files. so that stuff is cool and works well.

altho I don't use spring for webzones, only web services (cxf).

Adbot
ADBOT LOVES YOU

Goat Bastard
Oct 20, 2004

aop is great unless you are trying to debug code or read code or understand what code is doing in really any way

Goat Bastard
Oct 20, 2004

cf. database triggers

Sapozhnik
Jan 2, 2005

Nap Ghost
So basically the same arguments made by plangers as to why dynamic typing is a good idea (because they need to use fewer keystrokes in Sublime Text or whatever to poo poo out their latest node.js disasterpiece. text entry being the most strenuous part of programming, you see)

"oh i don't do software maintenance i'm a ~*code poet*~ at an awesome new startup full of likeminded ninja coders. we'll just throw away buttframework v0.4 beta and replace it with fartframework v0.4 beta without making any end-user-visible improvements whatsoever but it'll be more ~*omakase*~ or some poo poo"

SavageMessiah
Jan 28, 2009

Emotionally drained and spookified

Toilet Rascal

Shaggar posted:

I use aop to wrap methods in transactions and im pretty sure mybatis-spring uses it for mapping method names in interfaces to your sql in ur mapping files. so that stuff is cool and works well.

altho I don't use spring for webzones, only web services (cxf).

it probably uses proxies which are one of those java features that makes the language actually usable

also gently caress spring

guice 4 lyfe

Shaggar
Apr 26, 2006
lol

Sapozhnik
Jan 2, 2005

Nap Ghost
proxies own

esp when you use them to write something that turns interface method calls into stored proc calls and return result sets as lists of java objects (i did this (it owns))

Shaggar
Apr 26, 2006
that's what mybatis-spring does except it can do more complex object mappings too

tef
May 30, 2004

-> some l-system crap ->

Mr Dog posted:

So basically the same arguments made by plangers as to why dynamic typing is a good idea (because they need to use fewer keystrokes in Sublime Text or whatever to poo poo out their latest node.js disasterpiece. text entry being the most strenuous part of programming, you see)

come back when you've got a real type system, with inference and row polymorphism.

tef
May 30, 2004

-> some l-system crap ->
Enum<F extends Enum<F>> heh

tef
May 30, 2004

-> some l-system crap ->
i used generics once. my boss told me they would make the api too hard so we just went with a runtime checked api. thanks java!

Share Bear
Apr 27, 2004

tef posted:

i used generics once. my boss told me they would make the api too hard so we just went with a runtime checked api. thanks java!

this is a terrible question but what kind of engineering requires that level of genericity

this shows my crappiness as a developer but i've never quite understood why there's so much genericness

Shaggar
Apr 26, 2006
generics are ez.

FlapYoJacks
Feb 12, 2009
Naming conventions should be as follows:


Files: All lower case with underscores if a space is needed. IE: butt_file
Enum/Struct fields: All caps. IE: BUTTS, FARTS
Objects: One word with a capital letter for each new word. IE: ButtObject
Object fields: Same as objects. IE: ButtObject.Fart


Comments at our place are as follows:

/**
* @brief Butt Function
* @params None
* @retval Farts
/*


Works out p-well for me!

MeruFM
Jul 27, 2010

Stringent posted:

i wish ppl would document the circumstances surrounding the code rather than the functionality.

it'd be just as if not less useless and way more fun to read.

"This stopped working 4 months ago but they wanted to change something and eclipse file search grabbed this so I'm changing it.
Gluck to next person"

uG
Apr 23, 2003

by Ralp

ratbert90 posted:

Naming conventions should be as follows:


Files: All lower case with underscores if a space is needed. IE: butt_file
Enum/Struct fields: All caps. IE: BUTTS, FARTS
Objects: One word with a capital letter for each new word. IE: ButtObject
Object fields: Same as objects. IE: ButtObject.Fart


Comments at our place are as follows:

/**
* @brief Butt Function
* @params None
* @retval Farts
/*


Works out p-well for me!

ur fired

tef
May 30, 2004

-> some l-system crap ->

Share Bear posted:

this is a terrible question but what kind of engineering requires that level of genericity

this shows my crappiness as a developer but i've never quite understood why there's so much genericness

in languages with some level of generics (type erasure be dammed), it is useful for things where you don't know the exact

type in advance. generics are used to allow enums in java for example. homework: try writing an abstract class in java where a method returns the type of the subclass.

Shaggar posted:

generics are ez.

p e c s

FlapYoJacks
Feb 12, 2009

uG posted:

ur fired

Says you, my code is drat good looking. Also I adhear to C11 comments. /* */ no // for me!

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

tef posted:

in languages with some level of generics (type erasure be dammed), it is useful for things where you don't know the exact

type in advance. generics are used to allow enums in java for example. homework: try writing an abstract class in java where a method returns the type of the subclass.


p e c s

Just return the interface they both share and be done with it

tef
May 30, 2004

-> some l-system crap ->

Hard NOP Life posted:

Just return the interface they both share and be done with it

which you totally know in advance, like with enums,

quiggy
Aug 7, 2010

[in Russian] Oof.


this showed up on my facebook feed from a friend

code:
this->onClick = [](){};
kill all c-langs

uG
Apr 23, 2003

by Ralp

ratbert90 posted:

Says you, my code is drat good looking. Also I adhear to C11 comments. /* */ no // for me!

if your code is so good looking why isnt it self documenting

Slurps Mad Rips
Jan 25, 2009

Bwaltow!

quiggy posted:

this showed up on my facebook feed from a friend

code:
this->onClick = [](){};
kill all c-langs

wow whoever wrote that is a total scrub u dont even need those parens
code:
this->onClick = []{};

FlapYoJacks
Feb 12, 2009

uG posted:

if your code is so good looking why isnt it self documenting

Because my program knows it couldn't possibly create documentation as beautiful as mine. :colbert:

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

quiggy posted:

code:
this->onClick = [](){};

2spooky

Nomnom Cookie
Aug 30, 2009



tef posted:

in languages with some level of generics (type erasure be dammed), it is useful for things where you don't know the exact

type in advance. generics are used to allow enums in java for example. homework: try writing an abstract class in java where a method returns the type of the subclass.


p e c s

do you mean the return type of the method is the subclass's type, or the subclass's class object. types arent values in java

tef
May 30, 2004

-> some l-system crap ->

Nomnom Cookie posted:

the return type of the method is the subclass's type

this one. and the method is defined in the abstract class.

tef
May 30, 2004

-> some l-system crap ->
spoiler look at enum :v: http://docs.oracle.com/javase/6/docs/api/java/lang/Enum.html

ps i might be getting something wrong but i'm sure that's how I ended up doing it. i can't recall why I needed to do it though. i think i was just trying to get my head around java generics.

tef fucked around with this message at 21:02 on May 29, 2013

Sapozhnik
Jan 2, 2005

Nap Ghost
yea java generics suck poo poo but the precious loving snowflakes just love their dynamic typing, so Java is the only statically typed managed language that's actually reasonably supported these days. oop in general sucks poo poo but i can live with oop more easily than i can live with having code like

def poo poo(butt): butt.do_something_i_guess_but_good_luck_figuring_out_where_this_rabbit_hole_leads()

where you end up using such fantastically sophisticated source code analysis tools as grep.

i mean it's that or use some lovely rear end functional language, and i'm lazy so i'll just re-use a zing i made over a year ago

Mr Dog posted:

Ah yes, functional programming.

I think I'll bake a cake. How do you think I formulate this problem in my head:

1. Grab bowl and ingredients, start the oven heating up in the background
2. Add flour, sugar, eggs, etc to bowl
3. Stir until consistent
4. Wait for oven to get hot if it isn't already
5. Insert dough into oven, wait X minutes

or:

Let F(tau, xi, aleph, B, W, w1, w2, n) be a regular functional of the third kind from the domain of all functions on the finite Abelian field blah blah blah blah blah p.s. monads

yeah no

Sapozhnik
Jan 2, 2005

Nap Ghost
and yes most of the software that directly enhances my quality of life and that i enjoy working on is a "database skin", deal with it (sometimes the database is a file system tho)

gonadic io
Feb 16, 2011

>>=
yeah nobody is allowed to do any functional programming until theyve passed a category theory exam

gonadic io
Feb 16, 2011

>>=
this is what imperativers actually believe

gonadic io fucked around with this message at 21:54 on May 29, 2013

Nomnom Cookie
Aug 30, 2009



nobody does anything useful with functional programming. functional languages for getting work done always include an imperative escape hatch

JawnV6
Jul 4, 2004

So hot ...

Mr Dog posted:

i'm lazy so i'll just re-use a zing i made over a year ago

tbh you sound like a functional programmer

Nomnom Cookie
Aug 30, 2009



type erasure is so bad but java generics are still the second best generics after c#

crazysim
May 23, 2004
I AM SOOOOO GAY

JawnV6 posted:

tbh you sound like a functional programmer

are promises a functional thing? examples of using promises tend to involve cooking, especially the part where you fire up an appliance like an oven or coffee maker while you go do other things.

Slurps Mad Rips
Jan 25, 2009

Bwaltow!

crazysim posted:

are promises a functional thing? examples of using promises tend to involve cooking, especially the part where you fire up an appliance like an oven or coffee maker while you go do other things.

just look at the tcc heroin megathread to learn all you need to know about promises and cooking. "gonna fire up the stove to cook some heroin, makin myself a promise to never do it again and when the future is accessed we find im just not exceptional enough to move on with my life"

this is c++ specific but im sure u could twist anything in there to fit other plangs

Posting Principle
Dec 10, 2011

by Ralp
std::future<regret>

Slurps Mad Rips
Jan 25, 2009

Bwaltow!

Jerry SanDisky posted:

std::future<regret>

Adbot
ADBOT LOVES YOU

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

tef posted:

Enum<F extends Enum<F>> heh

this legit hurts my head

I think I understand it after three reads, but it's still really a thing

wait, no, maybe I don't understand it after all

gently caress

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