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
carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

oh no computer posted:

Yeah I'm not trying to make games only getting some general practice in with GUI stuff.

Although on a related note I haven't really coded in Java since version 5 - is Swing completely dead now? If so I'm guessing JavaFX has replaced it?

It's complicated. JavaFX is much more modern and nicer to use than Swing, but it was only a part of the base JDK for a few releases before it was pulled out again. Meaning now you need to include the JavaFX modules and ship separate versions of your applications for each OS if you want to be compatible with Java 11. This leaves Swing as the there-by-default always-looks-the-same UI toolkit for Java, so even though it basically hasn't changed in decades there's still value if "write once run anywhere" is your primary goal.

Adbot
ADBOT LOVES YOU

smackfu
Jun 7, 2004

I feel like a lot of apps have just switched to running local web servers if they need a UI.

Volguus
Mar 3, 2009

carry on then posted:

It's complicated. JavaFX is much more modern and nicer to use than Swing, but it was only a part of the base JDK for a few releases before it was pulled out again. Meaning now you need to include the JavaFX modules and ship separate versions of your applications for each OS if you want to be compatible with Java 11. This leaves Swing as the there-by-default always-looks-the-same UI toolkit for Java, so even though it basically hasn't changed in decades there's still value if "write once run anywhere" is your primary goal.

But you need to do that anyway now with java 11. People are no longer supposed to install a JRE and just run your app (fat jar or however you bundled it) . You make a package for a particular OS that includes the modules that your application uses and the jre and that's that. That's my understanding anyway, I haven't got there yet. I'm still on Java 8 at work and at home i haven't bothered in the last 10 years to write a java app.

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

Volguus posted:

But you need to do that anyway now with java 11. People are no longer supposed to install a JRE and just run your app (fat jar or however you bundled it) . You make a package for a particular OS that includes the modules that your application uses and the jre and that's that. That's my understanding anyway, I haven't got there yet. I'm still on Java 8 at work and at home i haven't bothered in the last 10 years to write a java app.

A fat jar for a Swing app is still one jar for everyone. All the projects I've seen that use JavaFX 11 have separate executables per platform generated using jlink. The forthcoming rerelease of javapackager with Java 12 will move more in that direction. There's also a lot of hesitation to even require Java 11, which for JavaFX then means you *need* to require Java 8 in order to ensure that the requisite libraries are present. I haven't seen a convincing solution so ship one JavaFX application jar that works on both 8 and 11, but Swing does it the same way it always has.

e: I guess my point is, the JavaFX story is complicated enough that for smaller applications it becomes tempting to avoid all of it even if the resulting UI will be worse, because sadly user experience seems to take a back seat to just about everything nowadays.

carry on then fucked around with this message at 16:56 on Feb 25, 2019

Volguus
Mar 3, 2009
The idea is that you don't require anything from the user anymore. When you package your application with jlink you include the JRE as well. The user doesn't have to have anything installed anymore, he/she gets the entire package from the developer. It's a bit more of a headache to setup for the first time, but after that it "just works".
Of course, the other downside is that the user may have 100 JREs installed , like they have 100 electron engines installed. Oh well, space is cheap (or so they think) so ... yea.

Soricidus
Oct 21, 2010
freedom-hating statist shill
Are there any examples of jlink actually working usefully for non-trivial projects?

Every time I’ve looked at it I’ve realised just how many of my dependencies are not modules and probably never will be modules unless I fork them and do all the work myself, and it looks like jlink is basically useless in that case as it will have no idea which modules it needs to include.

Javafx moving out of the jdk is great though, because it goes back on the class path instead of the module path so java stops complaining about all our lovely reflection hacks

Soricidus fucked around with this message at 01:16 on Feb 26, 2019

reversefungi
Nov 27, 2003

Master of the high hat!
Anyone have any recommendations for a resource on learning Java if you already have a decent amount of C# experience? Looks like I might accept a position soon (:woop:) and it's mainly Java focused, which I've only barely dabbled in, but I know it's incredibly similar to C#.

evilentity
Jun 25, 2010
Speaking of libgdx and stuff, ive recently upgraded to lwjgl3 backend. That requires '-XstartOnFirstThread' flag. That for whatever reason breaks awt/swing.
The only reason i care about that, is that id like to replace the dock icon with something sensible. Previously ive used 'com.apple.eawt.Application' set dock stuff, also tried '-Xdock' flag and Taskbar in jdk9+. None of that worked. Anyone knows if there is a way to set the dock icon some other way, that doesnt involve bundling the app?

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice

The Dark Wind posted:

Anyone have any recommendations for a resource on learning Java if you already have a decent amount of C# experience? Looks like I might accept a position soon (:woop:) and it's mainly Java focused, which I've only barely dabbled in, but I know it's incredibly similar to C#.

Dude, you're solid. If anything, maybe just brush up on how the standards are different (ClassImpl instead of IClass), camelcase everything, open braces on same line, etc etc.

I went from Java to C# doing hobby game dev and it was no effort whatsoever.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

poemdexter posted:

Dude, you're solid. If anything, maybe just brush up on how the standards are different (ClassImpl instead of IClass), camelcase everything, open braces on same line, etc etc.

I went from Java to C# doing hobby game dev and it was no effort whatsoever.

The only other thing I was gonna mention was brushing up on available tooling (i.e. build, code coverage, IDE, profiling / monitoring tools, unit testing)

Daviclond
May 20, 2006

Bad post sighted! Firing.
I'm working in my first development job out of university on a legacy back-end Java product in the UK. Over the past few months I've been getting increasingly triggered by various aspects of the code base, such as:
  • Severe lack of good OOP and abstraction; classes thousands of lines long, loads of JavaBean-style classes passed around and used like structs instead of encapsulating their behaviour
  • Lack of documentation of method contracts (most javadocs are just a less concise reiteration of the method name, like init(): /** Initialises the Foo */, even when there's important side-effects going on
  • Lack of tests on said methods / web services for anything other than common cases (at best), making refactoring onerous if not impossible since there is a fear of changing current behaviour in any of the possible edge cases
  • 15 years of SOAP web service versions being bolted on top of each other. Boilerplate classes everywhere, and spaghetti logic operating on them all.
  • Reams of XML config all over the place, requiring various environment property files to be in the right place and updated with the right values for a successful build, which is managed through a huge collection of Ant scripts that have accumulated over 15 years
I'm doing my best to leave the code cleaner that it was when I found it, with good unit and integration test coverage. I clean up pre-existing code where I have the time to do it properly and safely (with good test coverage, basically). I get on well with the team and have been complimented on how quickly I've gotten up to speed and made contributions. But, although I love development and find the work intrinsically interesting, all these factors are increasingly getting to me. I resent just how much poo poo code the product has managed to build up over its lifetime.

There's opportunity to move teams and I'm intending to talk to management about a move to a newer product with modern architecture and technologies. But I'd value some perspective on how I'm feeling and to what extent I should suck it up / get over it / buckle up for the long haul. Is this the norm for enterprise Java? How rare are companies/teams that get this stuff right? Should I be shooting for Big N and higher-tier companies if this is important to me?

RandomBlue
Dec 30, 2012

hay guys!


Biscuit Hider
I've been doing dev for a long time at a lot of companies from Fortune 100 down to a small <10 person company. You're going to run into most of those problems at any company and it will vary from project to project. I'm sure that there are companies that do it much better than others but they're rare and you likely won't know for sure until your hired and working on a project.

Keetron
Sep 26, 2008

Check out my enormous testicles in my TFLC log!

Daviclond posted:

There's opportunity to move teams and I'm intending to talk to management about a move to a newer product with modern architecture and technologies. But I'd value some perspective on how I'm feeling and to what extent I should suck it up / get over it / buckle up for the long haul. Is this the norm for enterprise Java? How rare are companies/teams that get this stuff right? Should I be shooting for Big N and higher-tier companies if this is important to me?

Your list is common in a place with an older application, many mediocre developers and management that cares more about short term features than future delays and techdebt. You should never buckle up if you are unhappy, life is just to short for that. This horseshit is however found in a lot of places, mostly those that pay not so much and thus attract mediocre lifers.
Companies that get this right are rare but you can guess their names.
What is Big N? I looked it up. Basically yes. The bigger the brand name, the more likely they are going to get it right. I am currently at the worlds biggest sporting goods brand and they are doing things pretty good as well. I would like to move to ebay after this but they went all into GoLang in my location so that remains to be seen.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Daviclond posted:

There's opportunity to move teams and I'm intending to talk to management about a move to a newer product with modern architecture and technologies. But I'd value some perspective on how I'm feeling and to what extent I should suck it up / get over it / buckle up for the long haul. Is this the norm for enterprise Java? How rare are companies/teams that get this stuff right? Should I be shooting for Big N and higher-tier companies if this is important to me?

In my experience everything you said is the norm when you're maintaining a legacy project. It has probably changed hands at least 5 times and none of the original devs work in the company anymore. For some reason the version control contains meeting minutes and vacation requests from 2008. The project wiki contains a lessons-learned section from 2012 that lists things that are still a problem.

If you want to start refactoring the code, I recommend using http://pitest.org/ for testing your code coverage.

NuclearEagleFox!!!
Oct 7, 2011
I don't have a technical question, just a request for recommendations.

I learned basic Java way back in high school: methods, classes, objects. Since then, I've used it professionally and in my hobby projects effectively and encountered no issues. But now, my projects have gotten more complex and I've run into examples on Stack Overflow and even Oracle's Javadocs that seem completely foreign to me. They've hinted at features that I've only heard of in other languages: lambda functions, properties, list comprehension, etc. I'm familiar with these in other languages, but I didn't know they were available in Java and so never learned them there.

What's a good resource for learning "modern" Java for someone who's familiar with the language and these features in other languages? Part of the problem is that I don't know what I don't know, and so I can't just search for "X in Java".

Thanks in advance.

CPColin
Sep 9, 2003

Big ol' smile.
If properties and list comprehensions are in Java now, that's news to me, but I've been out of the Java world for two years now. Looking at the Java version history article on Wikipedia, the big syntax features you might not know yet are lambdas and var, while the big library features are Streams and maybe java.time.

Edit: Oh, also modules, but I have zero experience with those.

RandomBlue
Dec 30, 2012

hay guys!


Biscuit Hider

NuclearEagleFox!!! posted:

I don't have a technical question, just a request for recommendations.

I learned basic Java way back in high school: methods, classes, objects. Since then, I've used it professionally and in my hobby projects effectively and encountered no issues. But now, my projects have gotten more complex and I've run into examples on Stack Overflow and even Oracle's Javadocs that seem completely foreign to me. They've hinted at features that I've only heard of in other languages: lambda functions, properties, list comprehension, etc. I'm familiar with these in other languages, but I didn't know they were available in Java and so never learned them there.

What's a good resource for learning "modern" Java for someone who's familiar with the language and these features in other languages? Part of the problem is that I don't know what I don't know, and so I can't just search for "X in Java".

Thanks in advance.

https://www.baeldung.com/ is a pretty good resource.

NuclearEagleFox!!!
Oct 7, 2011

RandomBlue posted:

https://www.baeldung.com/ is a pretty good resource.

Thanks, this is pretty much exactly what I was looking for!

Sad Panda
Sep 22, 2004

I'm a Sad Panda.
I've just started to play with Java for the first time since university back in 2004. I decided to flick through this thread from the beginning and it's helping. I got to a post back in 2009 with someone's homework assignment and decided to make it.

Here is my effort.

Two questions.
1) General feedback on my way of doing it?
2) How does an inner class work? I was trying to create another object of GradeInformation which would be inited with a constructor of say ("A", 90, 100). Then I could have an array of GradeInformation objects, and iterate through it to init things instead of hardcoding it. That data could then for example be read in from a file too. When I was trying to run GradeInformation() it was saying something about "Method call expected".

Java code:
/*
Write a program to read a list of exam scores given as integer percentages in the range 0 to 100.
Display the total number of grades and the number of grades in each letter-grade category as follows:
90 to 100 is an A, 80 to 89 is an B, 70 to 79 is an C, 60 to 69 is an D, 0 to 59 is an F.
Use a negative score as a sentinel value to indicate the end of the input.
(The negative value is only used to end the loop, so do not use it in the calculations.).

For example, if the input is

98, 87, 86, 85, 78, 73, 72, 72, 70, 66, 63, 50, -1

the output would be:

Total number of grades = 14
Number of A's = 1
Number of B's = 4
Number of C's = 6
Number of D's = 2
Number of F's = 1
*/

import java.io.FileNotFoundException;
import java.util.HashMap;
import java.util.Scanner;
import java.io.File;

public class GradeReader {
    // Fields
    final String SENTINEL = "q";
    private HashMap<String, Integer> markBook = new HashMap<String, Integer>();
    private int marks = 0;

    GradeReader(){
        // Init with a list of possible grades + inited markbook.

        // Failing - GradeInformation[] possibleGrades = new GradeInformation[5];

        String[] possibleGrades = {"A", "B", "C", "D", "F"};
        for (String grade : possibleGrades)
        {
            markBook.put(grade, 0);
        }
    }
    /*
    class GradeInformation{
        private String letterGrade;
        private int lowerBoundary;
        private int upperBoundary;
        GradeInformation(){
            System.out.println("Init GradeInfo");
        }
    */

    public static void main (String[] args){

        GradeReader reader = new GradeReader();
        reader.getInput();
        reader.printMarkBook();
    }

    void getInput(){
        // Tries to read in from a file, otherwise gets keyboad input
        File file = new File("/Users/obow/Dropbox/Coding/Java/MiscProjects/src/results.txt");
        Scanner scanner;
        try {
            scanner = new Scanner(file);
        }
        catch (FileNotFoundException e) {
            System.out.println("File not found" + file.getAbsolutePath());
            System.out.println("Using keyboard instead.");
            scanner = new Scanner(System.in);
        }

        do{
            // Loops through the input (keyboard or file) until hitting a q.
            System.out.print("Please enter a score : ");
            String line = scanner.nextLine();
            if (SENTINEL.equalsIgnoreCase(line)){
                break;
            }
            else{
                try{
                    int score = Integer.parseInt(line);
                    if (isBetween(score, 0, 100)) {
                        this.updateMarkBook(score);
                    }
                    else{
                        System.out.println("Score must be between 0 and 100.");
                    }
                }
                catch(NumberFormatException e){
                    System.out.println("Invalid input. Whole numbers only.");
                }
                catch(Exception e){
                    System.out.println(e);
                }
            }
        } while(true);
    }

    void updateMarkBook(int score){
        // Updates a grade. Based on the idea that there's only one markbook per instance.
        String grade = scoreToGrade(score);
        this.marks ++;
        System.out.printf("%d - Adding grade %s for score %d to markbook.\n", this.marks, grade, score);
        this.markBook.put(grade, this.markBook.get(grade)+1);
    }

    void printMarkBook(){
        // Iterates through the keys in a markbook and outputs
        System.out.printf("\nTotal number of grades %d\n", this.marks);
        for(String key : this.markBook.keySet()){
            System.out.printf("Number of %s's : %d\n", key, this.markBook.get(key));
        }
    }

    String scoreToGrade(int score){
        // Takes a score, checks it and turns it into a grade.
        String grade = "";
        if (isBetween(score, 90, 100)){
            grade = "A";
        }
        else if (isBetween(score, 80, 89)){
            grade = "B";
        }
        else if (isBetween(score, 70, 79)){
            grade = "C";
        }
        else if (isBetween(score, 60, 69)){
            grade = "D";
        }
        else if (isBetween(score, 0, 59)){
            grade = "F";
        }
        return grade;
    }

    boolean isBetween(int score, int lower, int upper){
        // Checks if a value is between two values. Returns true/false.
        return lower <= score && score <= upper;
    }
}

Sad Panda fucked around with this message at 23:13 on Apr 8, 2019

RandomBlue
Dec 30, 2012

hay guys!


Biscuit Hider
You're going to pick up a lot of outdated info and broken links reading Java posts from 10 years ago. I wouldn't recommend you approach it that way.

Arcsech
Aug 5, 2008

Sad Panda posted:

I've just started to play with Java for the first time since university back in 2004. I decided to flick through this thread from the beginning and it's helping. I got to a post back in 2009 with someone's homework assignment and decided to make it.

Here is my effort.

Two questions.
1) General feedback on my way of doing it?
2) How does an inner class work? I was trying to create another object of GradeInformation which would be inited with a constructor of say ("A", 90, 100). Then I could have an array of GradeInformation objects, and iterate through it to init things instead of hardcoding it. That data could then for example be read in from a file too. When I was trying to run GradeInformation() it was saying something about "Method call expected".

Your approach is... Consistent with what I'd expect from someone looking at resources and homework assignments from a decade+ ago. It's not awful, but it's not modern Java. I'm not really sure where to point you here for an intro to modern Java aimed at someone newish to programming. But this is a good start overall! It's good that you factored updateMarkBook out into its own method rather than doing it directly in getInput for example.

Here's what I'd recommend:
  1. Using a try-with-resources block to initialize the Scanner
  2. Using a foreach loop instead of the do-while
  3. Rather than call updateMarkBook from getInput, have getInput return a List<Integer> and iterate over that to update the markbook - you generally want each method to be responsible for as few things as possible
  4. For the love of dog, get yourself an IDE that has an auto-format function (IntelliJ Community Edition is free and really good)

I'd also recommend looking up Java Streams at some point, but that might be a bit past where you are right now.

Regarding inner classes, you almost never want a non-static inner class - non-static inner classes are some weirdass poo poo that I've never seen anywhere other than example code for explaining how they work. Use a static inner class (technically a "nested class") instead - just use "static class GradeInformation" instead of just "class GradeInformation" and you should have fewer problems. I'm not sure how to answer your specific question as I don't quite understand what you were trying to do and what problems you were running into.

PierreTheMime
Dec 9, 2004

Hero of hormagaunts everywhere!
Buglord
Speaking of learning newer Java options, can anyone tell me what I'm doing wrong with this? I've got a simple class with a Date variable and I'm compiling a List of objects from that class, but I cannot seem to be able to sort them as expected based on the Date value.

code:
sessions.sort(Comparator.comparing(SessionObject::getStartTime));
It doesn't return any error, it just doesn't perform any sort. Where did I screw this up?

Sindai
Jan 24, 2007
i want to achieve immortality through not dying
That's weird. It's simple enough and certainly looks like it should work. I suspect your problem isn't on that line.

Arcsech posted:

Regarding inner classes, you almost never want a non-static inner class - non-static inner classes are some weirdass poo poo that I've never seen anywhere other than example code for explaining how they work.
That's interesting, I would have said the opposite - dynamic inner classes are far more common and useful since they have a useful semantic feature (a reference to the outer object) while static inner classes are just an organizational tool to make up for Java's annoying one root element per source file limitation.

Remember that all lambdas and anonymous objects are just instances of anonymous inner classes. Named inner classes are less common these days but fundamentally no different.

CPColin
Sep 9, 2003

Big ol' smile.

Sindai posted:

Java's annoying one public root element per source file limitation.

Fixed, because while the limitation is still annoying and stupid, it's that special, unique kind of stupid that Java's so good at!

PierreTheMime
Dec 9, 2004

Hero of hormagaunts everywhere!
Buglord

Sindai posted:

That's weird. It's simple enough and certainly looks like it should work. I suspect your problem isn't on that line.

Yeah, I figured it out, the object being evaluated was from a different source, the sort works fine. I don't get to use many "new" features super often, but this is certainly one I appreciate.

ivantod
Mar 27, 2010

Mahalo, fuckers.

Sindai posted:

Remember that all lambdas and anonymous objects are just instances of anonymous inner classes.

Saying that a lambda is just an instance of an anonymous inner class is oversimplifying things by quite a bit.

Here is a talk by Brian Goetz that goes into some detail:

https://www.youtube.com/watch?v=MLksirK9nnE

CPColin
Sep 9, 2003

Big ol' smile.
Totally gonna watch that on company time under the guise of "research," even though I already know about lambdas and have used them a bunch!

Arcsech
Aug 5, 2008

Sindai posted:

That's interesting, I would have said the opposite - dynamic inner classes are far more common and useful since they have a useful semantic feature (a reference to the outer object) while static inner classes are just an organizational tool to make up for Java's annoying one root element per source file limitation.

Remember that all lambdas and anonymous objects are just instances of anonymous inner classes. Named inner classes are less common these days but fundamentally no different.

That last bit is true (sorta, as has already been mentioned), but I was referring to named inner classes. And I was exaggerating, I have seen them used, but very rarely and they are pretty counterintuitive unless you understand how they work at a level deeper than most beginners are prepared for.

baka kaba
Jul 19, 2003

PLEASE ASK ME, THE SELF-PROFESSED NO #1 PAUL CATTERMOLE FAN IN THE SOMETHING AWFUL S-CLUB 7 MEGATHREAD, TO NAME A SINGLE SONG BY HIS EXCELLENT NU-METAL SIDE PROJECT, SKUA, AND IF I CAN'T PLEASE TELL ME TO
EAT SHIT

Sad Panda posted:

Two questions.
1) General feedback on my way of doing it?
2) How does an inner class work? I was trying to create another object of GradeInformation which would be inited with a constructor of say ("A", 90, 100). Then I could have an array of GradeInformation objects, and iterate through it to init things instead of hardcoding it. That data could then for example be read in from a file too. When I was trying to run GradeInformation() it was saying something about "Method call expected".

An inner class is basically just a class, but because it's located inside another class it gives you some organisational options. If you leave it visible from outside the outer class, then other stuff can use it, but only through an instance of that outer class - so they're inherently connected, like the inner class is some aspect of the outer, which makes it clearer how your project is structured and what relates to what. If you make the inner class private, only the outer class can use it, so that functions more as an internal helper class that your outer one makes use of - which is what you wanted to do. That way this internal implementation detail doesn't leak out and cause confusion, or problems if you ever want to change it

The other thing about inner classes is they can see all the outer class's private stuff, which means you can take the OOP approach to your problem without having to expose parts of your main outer class just so the other classes you've come up with can interact with the methods and fields they need. By making them internal inner classes, you don't have to worry about visibility - it's all nicely encapsulated. (This isn't the only way to deal with this kind of thing, but it's how inner classes work anyway)


as for yr code, if the grades were hardcoded I'd suggest using an enum instead of rolling your own class, but yeah if that grade scheme needs to be separately provided then you'd need your own class (enums are like a class with a fixed set of instances that are initialised when your program starts). Personally I'd probably make a Grade class (name, lower bound, upper bound) and a MarkBook class (constructor takes a bunch of Grades as a Collection or vararg or whatever, creates a map of Grades to counts initialised at zero). That way you just need to
  • read and parse your grading scheme, producing Grades
  • create a MarkBook with that set of Grades
  • read and parse your scores
  • hand scores to the MarkBook, let it handle them internally (whatever data structure, whatever grouping logic, whatever error handling)
  • print the MarkBook (you could override toString in the class if you like)

that way you've broken it up into a basic flow - you have some input bits, you have a couple of ways you want to parse those inputs, you end up with your data (Grades and scores), and then you just feed that data to the MarkBook which is really the business end of things, everything else is more like prep work, y'know?

oh as well as what other people mentioned, this
Java code:
private HashMap<String, Integer> markBook = new HashMap<String, Integer>();
should be
Java code:
private Map<String, Integer> markBook = new HashMap<String, Integer>();
where the type you're declaring is the Map interface, not the specific implementation(HashMap). That means if you ever decide to use something other than a HashMap, so long as it's a Map everything that was using it before will still work. Generally this doesn't come up, but when it does and you have to refactor everything, it can be a pain

(also you can drop the generic types in the instantiation and just use the diamond operator, HashMap<>, because your declaration already specified them - get an IDE it'll tell you this stuff and fix it for ya)

baka kaba fucked around with this message at 20:14 on Apr 9, 2019

moostaffa
Apr 2, 2008

People always ask me about Toad, It's fantastic. Let me tell you about Toad. I do very well with Toad. I love Toad. No one loves Toad more than me, BELIEVE ME. Toad loves me. I have the best Toad.

ivantod posted:

Saying that a lambda is just an instance of an anonymous inner class is oversimplifying things by quite a bit.

Here is a talk by Brian Goetz that goes into some detail:

https://www.youtube.com/watch?v=MLksirK9nnE

Unrelated, but this video on a different topic briefly touches on lambdas vs closures. In any case, it's really worth a watch.

https://www.youtube.com/watch?v=DOoJnJJnAG4

oh no computer
May 27, 2003

Edit: nevermind, worked it out

oh no computer fucked around with this message at 13:51 on Apr 10, 2019

PierreTheMime
Dec 9, 2004

Hero of hormagaunts everywhere!
Buglord
When did File start accepting normal Windows-based pathing without format changes? Being able to just pass the argument via copy/paste without formatting is a pleasant surprise. I don't get to work with "real" programming languages enough.

Volguus
Mar 3, 2009

PierreTheMime posted:

When did File start accepting normal Windows-based pathing without format changes? Being able to just pass the argument via copy/paste without formatting is a pleasant surprise. I don't get to work with "real" programming languages enough.

I did not know about File, but Path has been capable of that since Java 7 if i'm not mistaken. https://docs.oracle.com/javase/tutorial/essential/io/pathOps.html

F_Shit_Fitzgerald
Feb 2, 2017



I'm trying to get back into Java for practice while I look for a coding job. I took a Java class years ago in university, but my school mostly focused on C++.

There are a lot of jokes/half jokes about Eclipse being terrible, so my question to the thread: what would you consider the best free IDE for Java? IntelligJ?

Volguus
Mar 3, 2009
The one that you like. Try them all and stick with whichever. There are only 3 major ones: Eclipse, Netbeans and Intellij community. All free. There is also VS Code that is not an IDE, but that can work in a pinch. Some people love it. There are a number of smaller ones (jEdit for example) but ... eh, you'd need 2 lifetimes to try them all.

Whoever tells you "X is the best IDE" is absolutely completely wrong and you should ignore them.

John F Bennett
Jan 30, 2013

I always wear my wedding ring. It's my trademark.

"Intellij is the best IDE"

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice

John F Bennett posted:

"Intellij is the best IDE"

This is not an empty quote.

Hekk
Oct 12, 2012

'smeper fi

I am bad at programming so I cut and paste code between all three depending on what I am trying to accomplish. IDEA has some nice quality of life things that Eclipse doesn't but I have a Swing UI idiot proof layout manager setup on Eclipse that I am too dumb to get working on IDEA.

I should also mention that all my uses are for college classes so I am new and as a result inherently slow and not good.

ada shatan
Oct 20, 2004

that'll do pig, that'll do

Nostalgia4Ass posted:

I am bad at programming so I cut and paste code between all three depending on what I am trying to accomplish. IDEA has some nice quality of life things that Eclipse doesn't but I have a Swing UI idiot proof layout manager setup on Eclipse that I am too dumb to get working on IDEA.

I should also mention that all my uses are for college classes so I am new and as a result inherently slow and not good.

I can't tell if this is a joke post...

Adbot
ADBOT LOVES YOU

Ola
Jul 19, 2004

John F Bennett posted:

"Intellij is the best IDE"

I regret not having the guts to simply post this. But it doesn't matter, really. Every IDE will tell you you've written something wrong, no IDE will tell you've made something poo poo.

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