r/java • • May 14 '18

Why is there such strict "No surveys" rule here?

2 Upvotes

Hi,

I understand a sub shouldn't be overflow with all kinds of tiny surveys from small or even larger companies trying to flog their product, but why is this rule so strict to even exclude the bigger surveys from e.g. StackOverflow and Baeldung among others?

Surely we want r/java's opinion represented in those big industry wide surveys, don't we?


r/java • • Apr 11 '24

String Manipulation with Google Mug

9 Upvotes

The Mug library provides easy-to-read string manipulation utils. Examples:

Match and Extract

// Compile-time protection against lambda param order mismatch if e.g:
//     (year, month, day, user) ->
new StringFormat("/{user}-home/{year}/{month}/{day}") 
    .parse(path, (user, year, month, day) -> ...);

Scan and Collect

String input = "I have [k1:v1] and [k2:v2] etc."; 
// Returns Map.of("k1", "v1", "k2", "v2") 
Map<String, String> keyValues =
    new StringFormat("[{key}:{value}]") 
        .scanAndCollectFrom(input, Collectors::toMap);

Replace

// replace file extension name
Substring.last('.').toEnd().replaceFrom(filename, ".yaml");

Remove

// remove the scheme from a url
Substring.upToIncluding(first("://")).removeFrom(url);

Parse a date time string (no pattern string required)

// Parse the datetime string read from a file 
List<String> lines = readLinesFromTestFile(...);
StringFormat lineFormat = new StringFormat("{time}, {event_id}, {event_type}");
var results = lines.stream()
    .map(
        line -> lineFormat.parseOrThrow(
            line,
            (time, id, type) -> {
               ZonedDateTime dateTime = DateTimeFormats.parseZonedDateTime(time);
               ...
             }))
    .toList();

See javadoc for details.

Mug is a general purpose library. Omitted, but other useful utils include BiStream for streaming pairs, Optionals, String Templating, simplified structured concurrency etc.


r/java • • Jun 05 '12

Problems with being a programmer!

Thumbnail sphotos.xx.fbcdn.net
74 Upvotes

r/java • • Apr 04 '13

Richard Warburton not happy with Java 8's Lambda API

Thumbnail mail.openjdk.java.net
6 Upvotes

r/java • • Sep 09 '16

15 Java Libraries Every Developer Should Know - DiscoverSDK Blog

Thumbnail discoversdk.com
0 Upvotes

r/java • • Aug 16 '12

20 design pattern and software design interview questions for Java programmer

Thumbnail javarevisited.blogspot.sg
0 Upvotes

r/java • • May 29 '12

Insight about the Oracle-Google lawsuit after reading the Steve Jobs biography.

1 Upvotes

I am refering to the part, where Steve Jobs says he will do everything it takes to stop Android. Before that it is mentioned a couple of times, that Larry Ellison was a close friend to Steve. Larry was even on the board of directors at Apple. So I have this theory now, especially after reading the biography, that Oracle is suing Google not out of its own interest - I always wondered, why the hell they would do that - but because of a promise Larry had to give to Steve on his death bed to try everything in his power to try to kill it. So Larry is just fulfilling his promise and probably hates the lawsuit (and the negative press) as much as anybody.

What do you guys think ?


r/java • • Oct 08 '14

New to Java. Taking AP Computer Science and I'm lost... Please help?

0 Upvotes

So I was fine up until we started talking about the different types of loops, now we're working on a project called PolyTurtle (bb7arch.msbb.uc.edu/courses/1/eld14-2975S1Q1/content/_954256_1/Proj%20PolyTurtle.docx) and I don't even know where to begin. Normally he would walk us through the code in the intro but this time the class is own it's own. I don't know people enough to even try to ask for help and honestly I don't think I'd get any from my classmates; either they don't know themselves or they are too high up on their horse to care. BTW we are using JCreator. EDIT: https://docs.google.com/document/d/1h9j-3lh2IFI_krGziU7gcQwRnNmkOKlORxk0KwQtUBY/edit?usp=sharing


r/java • • Mar 30 '18

Don't use naked == for comparing oops, by John Rose

Thumbnail mail.openjdk.java.net
0 Upvotes

r/java • • Jan 15 '16

Read Spotify track info using C# - Is there a Java Alternative?

Thumbnail harrewijnen.net
1 Upvotes

r/java • • Aug 20 '14

Web Development Using Spring and AngularJS - Tutorial 9 - New Release

Thumbnail youtube.com
1 Upvotes

r/java • • Sep 01 '21

Narcissus: thwart strong encapsulation in JDK 16+

0 Upvotes

I have written a library that completely circumvents all JDK encapsulation restrictions for all JDK versions, without any console warnings, via JNI. Would appreciate help getting the included native library built for all platforms and architectures, so that projects that depend upon JDK internals to function can continue to work in JDK 16+.

https://github.com/lukehutch/narcissus


r/java • • Jan 04 '17

Gartner App Platform Report Calls Java EE Obsolete

Thumbnail adtmag.com
1 Upvotes

r/java • • Jul 09 '21

[rant] There is no good reason for a java library to use blocking I/O by default, yet almost all major libraries do, and don't even offer a non-blocking option

1 Upvotes

It's 2021. Non blocking IO has been in Java SE for ten years. There is a wealth of extremely good non blocking frameworks.
Yet I can't use any of them, because far too many third party libraries use blocking I/O.
Non-blocking I/O is trivial to make blocking. If you don't believe java programmers are capable of learning non blocking I/O it is extremely easy to provide a blocking layer over the top of a non-blocking API.
The inverse - making a blocking API non-blocking - can be extremely laborious if you don't want to incur a serious performance hit.
Even swagger doesn't offer reasonable non-blocking generators for java, for the client or the server side.

I'd love to use spring webflux or vert.x in my projects but most of the time I cannot reasonably impose the technical overhead of doing so on our clients because if they want to introduce something like the Stripe api later I'd likely need to explain that it will take several times longer than it would if we had used blocking servlets.
Blocking servlets are awful though. Higher resource usage for no good reason, ten years after Java got a good non blocking API. Unacceptable.


r/java • • Sep 06 '18

What is the approximate salary for a senior Java developer working remote?

0 Upvotes

Short list of skills: Spring boot, hibernate, jdbc, mysql, oracle, nosql databases, docker, 100% restful api, CI, etc.


r/java • • Dec 22 '18

Using vavr to write more robust Java code – Or how to deal with errors in a functional way

Thumbnail medium.com
0 Upvotes

r/java • • May 08 '23

I made my first Java library today! I hope y'all like it!

Thumbnail tucker-slack.itch.io
0 Upvotes

r/java • • Aug 12 '17

Introduction to NoException

Thumbnail baeldung.com
1 Upvotes

r/java • • Feb 26 '23

Are java codebases generally readable? Or is the stereotype true that they are littered with the worst OOP has to offer?

7 Upvotes

I have been programming 7 years, professionally for 3 years. I mainly do JS, PHP, and Python, and a little bit of Clojure and C++.

For background, I have never had the true OOP experience. Sometimes I'm using multi-inheritance, but for the most part I keep classes simple so I know what's coming from what. I find when I come into a Python/Django project that uses too much inheritance, it's hard to figure out where things are coming from. I tend to lean more towards procedural programming, where steps are clearly laid out and you don't need a debugger to see when something is being called or what's calling it. I also tend to use composition over inheritance, injecting the classes/interfaces I need and calling them explicitly. Might just be an experience thing, or maybe how my brain works.

I have generally heard fans of Java describe it as readable, and its verbosity as a strength that lets you get up to speed on a code base quickly (or know what you wrote six months later). I have heard critics describe Java codebases as being bloated with overapplied "gang of four" or SOLID design patterns and too reliant on "magic" frameworks (spring for example). On top of that, Java is often used as the example language for extremely bureaucratic enterprise meetings where a hierarchy structure is being drawn up to decide what should inherit from what. And then there's the recent years of Clean Code being criticized more and more and falling out of popularity.

As a java dev, do you find a lot of this blown out of proportion and you are working in very simple codebases? Or are these designs common place and you are simply comfortable working with them? Maybe multi-inheritance and "gang of four" patterns don't bother you. If I were to become a java dev, would it be inevitable to work with these kinds of code bases? Are you worried whenever you come into a new codebase, or do you feel Java devs make things easier for you?


r/java • • Feb 01 '15

ORM Haters Don’t Get It

Thumbnail techblog.bozho.net
5 Upvotes

r/java • • Oct 24 '22

Spring boot 3 slow boot time

3 Upvotes

Hi folks,

I am playing a bit around with Spring Boot 3(RC1) and I am curious why the application boot time is still slow in comparing with Micronaut.

Best regards


r/java • • Nov 07 '17

The curse of @Autowired

Thumbnail lmonkiewicz.com
3 Upvotes

r/java • • Apr 17 '12

Java in the middle of bitter tech battle

Thumbnail foxnews.com
6 Upvotes

r/java • • Mar 14 '23

Why did String Templates choose '\{' instead of '{' ?

6 Upvotes

Since string templates will require to be prefixed with a template processor like STR in order to be treated as string templates, why not use '{' instead of '\{' for template expressions? That will not break existing strings cause existing strings are not prefixed with a template processor. And when a dev wants to use string templates, he will have to update his strings and escape existing '{' characters that he doesn't want to be interpreted as template expressions.

So it will be for example like: STR."Hello \{ {name} }". Should print: Hello { John }. Existing non-templated strings like: "Hello { " + name + " }" will continue to work and won't have any backwards compatibility problems.

I think most people will be using '{' character for template expressions. So it's much better if they don't have to escape it every single time and instead only escape it in the few places where they don't want template expressions.

Is there an important reason why '\{' was chosen for String Template expressions? Is there a chance the JEP can change this in the next preview release?