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
Soricidus
Oct 21, 2010
freedom-hating statist shill

sarehu posted:

Finding where a type is defined is easy in any case. There are other gains in maintenance when you have multiple types per file.

such as?

Adbot
ADBOT LOVES YOU

sarehu
Apr 20, 2007

(call/cc call/cc)

Having the types in the same place in a file lets you easily have it all visible on your screen. You can refactor code and move it from file to fie more incrementally.

pseudorandom name
May 6, 2007

it's a shame that nobody has invented a method of displaying two things at once

Soricidus
Oct 21, 2010
freedom-hating statist shill

sarehu posted:

Having the types in the same place in a file lets you easily have it all visible on your screen. You can refactor code and move it from file to fie more incrementally.

wow

the first claim is weak because your classes aren't going to fit on the screen at once in a single file unless they're absolutely trivial, and in that case what's wrong with just nesting them? the only downside is that it can get confusing if the nested classes are non-trivial, but we've already established that we must be talking about trivial classes. and in any case, if anything it's easier to view two classes side by side if they're in different files.

i don't even know what the second sentence is trying to say. how exactly does having things in the same file make it easier to move them to different files incrementally than if they were already in different files to begin with? and in any case, refactoring code and moving it from file to file is the ide's job, not mine.

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

sarehu posted:

People aren't genetically oriented towards language design decisions like that. One choice is more productive than the other, it's not a matter of preference. Calling it a matter of preference is attractive because nobody has to be wrong and nobody's language is bad, but in fact, one choice is the wrong one and the other is better.

I'm not saying in general your statement is false, there are very clear cases where one choice is better than an other and there are lots of lovely language design decisions all over the place to prove this. But in this particular instance it does feel like a preference thing and not something with a clear win as demonstrated by your weak claims to it's efficiency.

leftist heap
Feb 28, 2013

Fun Shoe

rrrrrrrrrrrt posted:

in what way is java *deeply* flawed?

a bunch of poo poo answers so far and nobody said nulls. lol.

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

rrrrrrrrrrrt posted:

a bunch of poo poo answers so far and nobody said nulls. lol.

*ding ding ding ding*

thank God Java8 finally added Optional

gonadic io
Feb 16, 2011

>>=
don't forget generics (and also their interactions with primitives lol)

i'm the toLongBiFunction

Brain Candy
May 18, 2006

Janitor Prime posted:

*ding ding ding ding*

thank God Java8 finally added Optional

that's better but it's still not statically checked. i've already seen people return null in place of an Optional (caught in review but jfc)

java desperately needs language level value types with something equivalent to using builders so writing immutable things is not so painful

immutable by default would be great too, but that won't happen

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

Notorious b.s.d. posted:

early in the c# era, people did try to port the then-preeminent java build tool to .net, and nANT was the result. nANT was every bit as good as the original ant, but microsoft didn't adopt it, so it died

"as good as ant" generally isn't considered a compliment

Shaggar
Apr 26, 2006
when you're building stuff in visual studio its going through msbuild. msbuild loving sucks. not only is it a script like build tool, its a script like build tool where visual studio is designed to read and understand the scripts in order to present certain stuff in the UI related to the build. if this sounds confusing and stupid that's because it is. you can make lots of changes the ui wont understand. most wont break visual studio, but the changes are invisible unless you unload the project and look at the file. this can cause massive confusion if anyone picks up your project and tries to build it and poo poo works weird. they would need to understand msbuild and to check your project file for hidden build logic.

this is made worse by nuget which is the official unofficial package manager of c# and visual studio. nuget could theoretically be used as just a package manager, but in reality that's not how it works. on first import nuget packages can and will make significant changes to your project files (meaning the msbuild configs). this is just as bad as it sounds with unknown changes getting shoved into your build left and right to the point where you have no idea where anything came from. what happens when you uninstall a package? who knows. it might clean up the project changes it made, it might not. even if it does, its guaranteed to break if you made any customizations to the build yourself.

AND its even worse if you want to do automated builds because the way nuget is handled in visual studio is that nuget is the one loving thing they dont put into your stupid project file. nuget dependencies go into a packages file which is interpreted not by msbuild but by an internal vs component that kicks off nuget to manage packages. its awful. if you want to get nuget packages to be downloaded during automatic builds, you have to add nuget package manager steps to the build. you can do this by hand, or you can configure your project to do nuget packages in msbuild instead of visual studio. well that sounds ok, right? lol no. If you don't do this before you download any package, visual studio will get confused about what references in your project are nuget packages and which are manual imports. even though the nuget packages are listed in the packages file. This means it will try to check in nuget packages that you installed before you enabled the disabling of visual studio's build in nuget package management in favor of msbuild package management. if you are confused or don't understand you are correct.

and to top it all off, nuget is an awful package manager. if you install a package that has dependencies, nuget will resolve them for you. by adding them directly to your package list as if you added them yourself. It does not handle transitive dependencies. It knows about them and will complain about them if you are missing one, but it wont try to resolve it for you.

the nuget package manager UI in visual studio does not have a place for you to select a version. if you do updates, you cant select a version to update to. it always installs/updates the newest versions. this is really really awesome when doing something like upgrading from mvc3 to mvc4 because not only does the lack of proper dependency (transitive and direct) management mean you will have leftover dependencies you don't need anymore, but it goes through a massive set of scripts to update your project files, your web.config, parts of other files in your project, and loads of other stuff. its impossible to undo it without reverting the entire project in source control. it will also miss poo poo all the time during the upgrade so you'll end up with references to mvc3 version of packages in some files and your project wont run. the official fix was to add special poo poo to the web.config that basically says, "oh, heh, yeah... if you see mvc3, um, that should really be mvc4... so if you could just use mvc4 instead that would be great.. thanks"

its an absolute poo poo show. if someone made a .net version of maven they could charge thousands of dollars for it per seat and people would pay and pay and pay.

Shaggar fucked around with this message at 01:49 on Jul 27, 2015

Shaggar
Apr 26, 2006
nuget is not comparable to maven. its probably more comparable to those weird javascript 'dependency" managers

Shaggar
Apr 26, 2006
it seriously drives me loving insane because if .net had maven it would be the best platform hands down, by miles and miles and miles

Shaggar
Apr 26, 2006
that retard who thinks build scripts are cool would probably like nuget and msbuild because its loads of work to get them working right for automated builds.

Shaggar
Apr 26, 2006
oh my god maven is so good and I miss it more and more every day.

abraham linksys
Sep 6, 2010

:darksouls:

Shaggar posted:

nuget is not comparable to maven. its probably more comparable to those weird javascript 'dependency" managers

sounds like bower, which is all-but-dead now that NPM is better at deduplicating its dependency tree

I should mention that, with that change, NPM is now basically the perfect package manager

sarehu
Apr 20, 2007

(call/cc call/cc)

Soricidus posted:

wow

the first claim is weak because your classes aren't going to fit on the screen at once in a single file unless they're absolutely trivial,

They'll fit if you don't have to put methods inside the classes.

akadajet
Sep 14, 2003

abraham linksys posted:

sounds like bower, which is all-but-dead...

oh thank god. bower was a mess

Shaggar
Apr 26, 2006
"hrm, it looks like I have a bunch of different logging apis in these dependencies. how do I fix this?"

maven solution: "have maven replace every instance of those artifacts across the entire dependency tree with the relevant slf4j bridge so everything gets sent to slf4j/logback*

nuget solution: "lol gently caress me I give up"

raminasi
Jan 25, 2005

a last drink with no ice
one time i added two dependencies via nuget that each relied on a different version of json.net

i believe nuget's solution was to just arbitrarily pick one, it didn't even tell me there was a problem

brap
Aug 23, 2004

Grimey Drawer
Java's optional is a complete joke. basically look at swift if you want to know how to do optionals correctly

Sapozhnik
Jan 2, 2005

Nap Ghost
nulls in java are bad but then the same is true of basically every other curly brace language

Optional<> is a lovely retrofit but I'll take that over playing nullability guessing games any day

hepatizon
Oct 27, 2010

sarehu posted:

They'll fit if you don't have to put methods inside the classes.

so what's wrong with nested classes? i haven't written java for a long time and i remember nested classes feeling generally awkward, but that's it

leftist heap
Feb 28, 2013

Fun Shoe
Also lol at no mention of checked exceptions. Most java haters are clueless.

Shaggar
Apr 26, 2006
checked exceptions are good

triple sulk
Sep 17, 2014



Shaggar posted:

it seriously drives me loving insane because if .net had maven it would be the best platform hands down, by miles and miles and miles

perhaps one day, shaggar, perhaps one day

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
shaggar i'm convinced. you should build it so i can use it with future .net projects, godbless and thanks in advance

comedyblissoption
Mar 15, 2006

Mr Dog posted:

nulls in java are bad but then the same is true of basically every other curly brace language

Optional<> is a lovely retrofit but I'll take that over playing nullability guessing games any day
Optional<> does nothing to solve nullability guessing games, because every single object reference is still nullable

You could maybe solve your problem if you had a NotOptional<> in tandem with Optional<> and enforced its usage and wrapped all library apis and hope you didnt make a mistake and are okay with the ridiculous boilerplate

b0lt
Apr 29, 2005
oh also no unsigned types, which they "fixed" with this poo poo https://blogs.oracle.com/darcy/entry/unsigned_api

comedyblissoption
Mar 15, 2006

I guess you could have a project convention of assuming that everything not wrapped in Optional means that it should never be null and cross your fingers and hope for the best

comedyblissoption
Mar 15, 2006

Is there still not an unsigned byte type

just lol forever

comedyblissoption
Mar 15, 2006

of course theyd get unsigned int in before unsigned byte

lol

sarehu
Apr 20, 2007

(call/cc call/cc)

hepatizon posted:

so what's wrong with nested classes? i haven't written java for a long time and i remember nested classes feeling generally awkward, but that's it

They're fine... if you want your classes to be nested.

Sapozhnik
Jan 2, 2005

Nap Ghost

comedyblissoption posted:

Optional<> does nothing to solve nullability guessing games, because every single object reference is still nullable

You could maybe solve your problem if you had a NotOptional<> in tandem with Optional<> and enforced its usage and wrapped all library apis and hope you didnt make a mistake and are okay with the ridiculous boilerplate

Static analyzers can catch uses of null in packages where you've declared null off-limits

Checker Framework is a thing but I haven't bothered to set that up yet.

Bloody
Mar 3, 2013

comedyblissoption posted:

Is there still not an unsigned byte type

just lol forever

are chars signed? lmao

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
char is unsigned, which only makes the decision to make byte signed even more inexplicable

CPColin
Sep 9, 2003

Big ol' smile.

Mr Dog posted:

Static analyzers can catch uses of null in packages where you've declared null off-limits

Checker Framework is a thing but I haven't bothered to set that up yet.

Yeah, my favorite part about Optional is that Eclipse still can't tell whether it's @NonNull or @Nullable, completely defeating the purpose. Stupid Oracle needs to bring @NonNull and @Nullable into the dang language specification already.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
msbuild as originally designed is actually kinda elegant: ideally the project file should contain nothing but a list of files associated with various tasks and some configuration settings for those tasks, with the tasks themselves defined in .net assemblies written in the .net language of your choice. unfortunately, the other 90% of msbuild is awful cancerous growths of functionality hacked in in the worst possible ways because for some reason they decided not to just tell people to write custom build tasks when they need some logic in their build system.

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Shaggar posted:

when you're building stuff in visual studio its going through msbuild. msbuild loving sucks. not only is it a script like build tool, its a script like build tool where visual studio is designed to read and understand the scripts in order to present certain stuff in the UI related to the build. if this sounds confusing and stupid that's because it is. you can make lots of changes the ui wont understand. most wont break visual studio, but the changes are invisible unless you unload the project and look at the file. this can cause massive confusion if anyone picks up your project and tries to build it and poo poo works weird. they would need to understand msbuild and to check your project file for hidden build logic.

this is made worse by nuget which is the official unofficial package manager of c# and visual studio. nuget could theoretically be used as just a package manager, but in reality that's not how it works. on first import nuget packages can and will make significant changes to your project files (meaning the msbuild configs). this is just as bad as it sounds with unknown changes getting shoved into your build left and right to the point where you have no idea where anything came from. what happens when you uninstall a package? who knows. it might clean up the project changes it made, it might not. even if it does, its guaranteed to break if you made any customizations to the build yourself.

AND its even worse if you want to do automated builds because the way nuget is handled in visual studio is that nuget is the one loving thing they dont put into your stupid project file. nuget dependencies go into a packages file which is interpreted not by msbuild but by an internal vs component that kicks off nuget to manage packages. its awful. if you want to get nuget packages to be downloaded during automatic builds, you have to add nuget package manager steps to the build. you can do this by hand, or you can configure your project to do nuget packages in msbuild instead of visual studio. well that sounds ok, right? lol no. If you don't do this before you download any package, visual studio will get confused about what references in your project are nuget packages and which are manual imports. even though the nuget packages are listed in the packages file. This means it will try to check in nuget packages that you installed before you enabled the disabling of visual studio's build in nuget package management in favor of msbuild package management. if you are confused or don't understand you are correct.

and to top it all off, nuget is an awful package manager. if you install a package that has dependencies, nuget will resolve them for you. by adding them directly to your package list as if you added them yourself. It does not handle transitive dependencies. It knows about them and will complain about them if you are missing one, but it wont try to resolve it for you.

the nuget package manager UI in visual studio does not have a place for you to select a version. if you do updates, you cant select a version to update to. it always installs/updates the newest versions. this is really really awesome when doing something like upgrading from mvc3 to mvc4 because not only does the lack of proper dependency (transitive and direct) management mean you will have leftover dependencies you don't need anymore, but it goes through a massive set of scripts to update your project files, your web.config, parts of other files in your project, and loads of other stuff. its impossible to undo it without reverting the entire project in source control. it will also miss poo poo all the time during the upgrade so you'll end up with references to mvc3 version of packages in some files and your project wont run. the official fix was to add special poo poo to the web.config that basically says, "oh, heh, yeah... if you see mvc3, um, that should really be mvc4... so if you could just use mvc4 instead that would be great.. thanks"

its an absolute poo poo show. if someone made a .net version of maven they could charge thousands of dollars for it per seat and people would pay and pay and pay.

nuget and msbuild are loving garbage and maven is the best

Adbot
ADBOT LOVES YOU

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Brain Candy posted:

that's better but it's still not statically checked. i've already seen people return null in place of an Optional (caught in review but jfc)

java desperately needs language level value types with something equivalent to using builders so writing immutable things is not so painful

immutable by default would be great too, but that won't happen

upgrade null pointer exception from RuntimeException to Error imo

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