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.
 
  • Locked thread
Shaggar
Apr 26, 2006
very carefully

Adbot
ADBOT LOVES YOU

leftist heap
Feb 28, 2013

Fun Shoe

MALE SHOEGAZE posted:

Is there like a nice list of Java best practices I can cargo cult until I understand the language? Mainly like :

- how to do exception handling best in java
- Java antipatterns
- gotchas
- weird gc related stuff

maybe what you really need is a guide on googling really mundane poo poo

Shaggar
Apr 26, 2006
exceptions follow this flowchart:
pre:
Can I do something about this exception ?
 | -- Y-> What Can you do about this exception ?
 |            | --> I can do something about it like maybe fix it or maybe send it to someone or w/e and that will be the end of it
 |                     | --> Handle the exception
 |            | --> I can add some information about the state of things so maybe someone else can handle it
 |                     | --> Wrap in new exception with additional info and throw
 | -- N -> Throw

brap
Aug 23, 2004

Grimey Drawer
intellij is good and I like it better than eclipse. it has smarter autocomplete or something, i forget exactly what.

leftist heap
Feb 28, 2013

Fun Shoe
id be more worried about spring best practices. best practice is actually "very carefully".

Shaggar
Apr 26, 2006
spring is neither good nor evil but it can be used to great effect in either direction.

leftist heap
Feb 28, 2013

Fun Shoe
i worked on a project where literally every single class had to be instantiated via spring, even just pojos.

not only that but the team lead wouldn't let you use any spring annotations, so you had to manually get a handle on the spring context to instantiate even the most simple beans.

bobbilljim
May 29, 2013

this christmas feels like the very first christmas to me
:shittydog::shittydog::shittydog:

MALE SHOEGAZE posted:

Is there like a nice list of Java best practices I can cargo cult until I understand the language? Mainly like :

- how to do exception handling best in java
- Java antipatterns
- gotchas
- weird gc related stuff

all you need to cargo cult is some self esteem mister!!!

that and take a gander on snack overflow for some sweet sweet jon skeets

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

MononcQc posted:

Because if you have something like 50 servers in clusters and poo poo it means you now need a total of 100 just to deploy new software without risking losing capacity or uptime.

whatevs just spin up more on :yayclod:

Shaggar
Apr 26, 2006

rrrrrrrrrrrt posted:

i worked on a project where literally every single class had to be instantiated via spring, even just pojos.

not only that but the team lead wouldn't let you use any spring annotations, so you had to manually get a handle on the spring context to instantiate even the most simple beans.

I don't put spring annotations in any of my code, but I also only really use spring as part of other frameworks like cxf.

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

MononcQc posted:

Because if you have something like 50 servers in clusters and poo poo it means you now need a total of 100 just to deploy new software without risking losing capacity or uptime.

hmm i can see a way of allowing this in :yayclod: haskell by defining an Iso from oldMessage to newMessage and back but :effort:

Shaggar
Apr 26, 2006
my ioc container is a runtime dependency.

Asshole Masonanie
Oct 27, 2009

by vyelkin

MALE SHOEGAZE posted:

OK I'm trying to get spun up on java / spring

-How do I make intellij tolerable for a vim / emacs dev

- how do I breakpoint / debugger most effectively?

Java 8 fwiw

there is a vim plugin for intellij

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...
the only "vim plugin" i have ever found to work at all reasonably is, ironically, the one for emacs

leftist heap
Feb 28, 2013

Fun Shoe

Shaggar posted:

I don't put spring annotations in any of my code, but I also only really use spring as part of other frameworks like cxf.

i think that's fine in general, but if you're already creating a compile time dependency by pervasively using the context anyway you might as well just annotate.

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

Shaggar posted:

spring is neither good nor evil but it can be used to great effect in either direction.

shaggar was uncontroversial

more like dICK
Feb 15, 2010

This is inevitable.
java is neat. i'm neck deep in a big ole spring + hibernate project right now and life is easy

don't ever write xml, read effective java, and break your spring config into multiple small @Configuration classes, combined in a single context ftw

e: i get that hibernate is actually a really bad way to manage data but drat if it isnt easy

more like dICK fucked around with this message at 03:10 on Apr 30, 2015

more like dICK
Feb 15, 2010

This is inevitable.

Shaggar posted:

spring is neither good nor evil but it can be used to great effect in either direction.

Shaggar
Apr 26, 2006
use mybatis and mybatis-spring instead of hibernate

bobbilljim
May 29, 2013

this christmas feels like the very first christmas to me
:shittydog::shittydog::shittydog:
use raw jdbc so u can really feel the SQL

Notorious b.s.d.
Jan 25, 2003

by Reene

MALE SHOEGAZE posted:

OK I'm trying to get spun up on java / spring

-How do I make intellij tolerable for a vim / emacs dev

- how do I breakpoint / debugger most effectively?

Java 8 fwiw

intellij has a good vim plugin to make the editor part more bearable

if you actually want to get out of ide-land, emacs and java work well together

Notorious b.s.d.
Jan 25, 2003

by Reene

more like dICK posted:

e: i get that hibernate is actually a really bad way to manage data but drat if it isnt easy

hibernate owns

gently caress the haters

the key thing to remember is that hibernate doesn't have to own your schema. you CAN let hibernate own the schema, but it is entirely possible, practical, and pleasant to use hibernate with a schema the application does not control.

Brain Candy
May 18, 2006

Notorious b.s.d. posted:

intellij has a good vim plugin to make the editor part more bearable

if you actually want to get out of ide-land, emacs and java work well together

eclim. the good bit of eclipse is that ibm wrote an incremental java compiler that has been maintained and has exposed hooks for your tools

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

Notorious b.s.d. posted:

hibernate owns

gently caress the haters

the key thing to remember is that hibernate doesn't have to own your schema. you CAN let hibernate own the schema, but it is entirely possible, practical, and pleasant to use hibernate with a schema the application does not control.

hibernate works like that because it's a reimplementation of the Enterprise Objects Framework, which worked the same way

NeXT wins again

VikingofRock
Aug 24, 2008




I made a functional programming thread.

leftist heap
Feb 28, 2013

Fun Shoe
hibernate has a laundry list of gotchas and pitfalls and ime it's pretty easy for beginners to waste a lot of time dealing with pretty routine crap. i can't count the number of times i've seen beginners struggle with poo poo like the persistent/detached dichotomy or session management and that's just basic poo poo outside of things like hairy performance issue.

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:


first post

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
the answer was 'effective java' thanks assholes

VikingofRock
Aug 24, 2008





noice :respek:

Asshole Masonanie
Oct 27, 2009

by vyelkin
:rip: the haskell man is gone

edit: i guess i'm late to this funeral


To the Yale College Community,

It is our sad duty to inform you that Paul Hudak, professor of computer science and master of Saybrook College, died last night after a long battle with leukemia. With him were Cathy Van Dyke, associate master of Saybrook, and their family.

Professor Hudak’s life and work touched so many people, among them the students and faculty in the Department of Computer Science, the community of musicians who shared his love for jazz, the high-school lacrosse athletes he coached, and the students, staff, and fellows of Saybrook College.

A memorial service is planned for Sunday, May 3, at 1:30 p.m., in Battell Chapel, giving the community a chance to come together, honor Professor Hudak, and celebrate his life. Friends may call on the family on Saturday, May 2, from 2:00 p.m. to 6:00 p.m., at Sisk Brothers Funeral Home, 3105 Whitney Avenue in Hamden.

Sincerely,

Peter Salovey
President and Chris Argyris Professor of Psychology

Jonathan Holloway
Dean of Yale College; Edmund S. Morgan Professor of African American Studies, History, and American Studies

Luigi Thirty
Apr 30, 2006

Emergency confection port.

that pseudo-Haskell with the JavaScript ui system looks cool

VikingofRock
Aug 24, 2008




Power Ambient posted:

:rip: the haskell man is gone

:rip:

giogadi
Oct 27, 2009

Luigi Thirty posted:

that pseudo-Haskell with the JavaScript ui system looks cool

What're you referring to? Elm?

Luigi Thirty
Apr 30, 2006

Emergency confection port.

yeah it's talked about in that thread

Carthag Tuek
Oct 15, 2005

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



woot my code injection works even thuogh i dont fully understand how

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

Snapchat A Titty posted:

woot my code injection works even thuogh i dont fully understand how

understanding how is not as important as liking how

VikingofRock
Aug 24, 2008




Luigi Thirty posted:

that pseudo-Haskell with the JavaScript ui system looks cool

Yeah the general consensus is that Elm is shaping up to be cool as hell.

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

VikingofRock posted:

Yeah the general consensus is that Elm is shaping up to be cool as hell.

I read some of that Tetris code and it didn't seem significantly different from Haskell.

would prefer a better syntax, like S-exprs.

giogadi
Oct 27, 2009

eschaton posted:

I read some of that Tetris code and it didn't seem significantly different from Haskell.

would prefer a better syntax, like S-exprs.

Elm's syntax is almost exactly like Haskell's. If you don't like Haskell's syntax you won't like Elm, but besides syntax many people's beefs with Haskell come from (a) people's liberal use of complex structures from category theory, and (b) lazy evaluation being really confusing to reason about.

Elm addresses these two things by not having typeclasses and using eager evaluation. These are compromises of course, but the payoff is a vastly simpler language than Haskell, even with the syntactic similarities.

Adbot
ADBOT LOVES YOU

Arcsech
Aug 5, 2008

giogadi posted:

Elm's syntax is almost exactly like Haskell's. If you don't like Haskell's syntax you won't like Elm, but besides syntax many people's beefs with Haskell come from (a) people's liberal use of complex structures from category theory, and (b) lazy evaluation being really confusing to reason about.

Elm addresses these two things by not having typeclasses and using eager evaluation. These are compromises of course, but the payoff is a vastly simpler language than Haskell, even with the syntactic similarities.

also signals are way easier to wrap your head around than haskell's io system, which helps a lot

elm may have typeclasses eventually if a good enough case can be made for it but the guy behind it is really skittish about adding them (understandably so)

  • Locked thread