• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

Do you think collectively we could get these guys to upgrade to Java 11 LTS version?

 
Ranch Foreman
Posts: 223
8
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys:

I know HackerRank is NOT CodeRanch, and I know it is just one site among many that provide similar challenges...

I also notice that numerous languages are not really provided in a very up-to-date format on their site, for whatever reasons.

However, with all of the Java 11 studies I'd been doing I found it particularly irksome I couldn't use any Java 9, 10 or 11 features, not to mention 12, 13, 14 or 15....

https://www.hackerrank.com/environment

It is more relevant to Java because Oracle bends over backwards compared to some other Brand X languages not to break anything in terms of backwards compatibility, you would not be running Applets or JWS on there for any of the problems, I am pretty sure.  Other languages would have better reasons to be conservative, since user code stored on the site could cease working just because they had written it a while ago due to incompatibilities from version to version of them.

I'm glad at least that they are using a relatively safe/updated version of Java 8, but the number of "nice new ways" to do things in even Java 11 that one has to remember not to use is getting pretty high...

At some point in the past I tried to engage them, I don't remember if 11 LTS version was even out then, I think it was.

I didn't remember hearing back from them.

It is still very highly used (in my experience) in the interview space, and for all sorts of coding challenges.

It would be really nice if 'we' could get them to support say, 11 and 15, or at least, say, 7 and 11 or 8 and 11...

It indirectly reflects on Java with respect to interview and competitive programming challenges hosted there.

Any ideas about this?  I ignored the situation for a year or two after a half-hearted attempt to engage them, nothing came of it.

Thanks all.
 
Jesse Silverman
Ranch Foreman
Posts: 223
8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I did think of one other reason they might be shy of upgrading, besides that it is work.

They give you a nominal amount of CPU and memory size to pass each challenge.

If they changed to a Java version that was way more efficient in one of these ways it would allow less optimal solutions to pass with a certain score.

If they changed to a Java version that was way less efficient in one of these ways (and left the limits the same) it would cause previously passing solutions to fail, which might upset users.

So there is some sort of hazard, but I think neither is a known problem, and it would be nice not re-setting my brain back to Java 8 only when doing stuff there.
 
Rancher
Posts: 3787
49
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I dunno; I think there are already going to be large variations in efficiency between many of the languages they do support.  But when they have a minimum performance cutoff on a problem, that's often based more on whether or not people use an O(N^2) solution when there's an O(N) solution available.  They just make N big enough that it doesn't matter whether one JVM or library is 2x faster than another; the issue is if your algorithm is the wrong order.  Usually.  I think.

But I do think HackerRank should at least put JDK 11 in there.  If they want to skip all the non-LTS versions, fine, I don't blame them.  But 11 has been out a long time now...
 
Mike Simmons
Rancher
Posts: 3787
49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Drat - I forgot to copy my message that I just sent, and there doesn't seem to be a record.  But, I found the Hackerrank feature request here: https://www.hackerrank.com/support/feature

And I looked through the list of supported language versions here: https://www.hackerrank.com/environment

All the languages I looked up, the version Hackerrank uses came out sometime in 2019.  Except Java 8, which came out in 2014.

This is what I put in my message.  Why can't Hackerrank support a more modern version of Java?

Although now, I note that technically, Java 1.8.0_191 came out in 2018.  So they have been upgrading with bug fixes.  But without leaving 1.8.x.  So my message wasn't necessarily phrased as well as it might have been.  Others may have their own ideas on what to say to Hackerrank.
 
Saloon Keeper
Posts: 23268
158
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jesse Silverman wrote:It is more relevant to Java because Oracle bends over backwards compared to some other Brand X languages not to break anything in terms of backwards compatibility...



Actually, that's Sun Microsystems, long before Oracle ate them. But Oracle comes from a mainframe background, where a COBOL program written 40 years ago is expected to still compile and run. So, haven been given an infrastructure, it was no real problem to keep on that track. Although I think Campbell will be glad to chime in and point out that recently Oracle has broken some backwards compatibility.

And you can ay "Microsoft", you don't have to say "Brand X". Well, yes, there's Python 2/Python 3 and the Perl Update that Never Really Happened, but we know whose backwards compatilbility is the worst.
 
Marshal
Posts: 72066
312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
They went one better. They introduced non‑backwards compatible code even before it was publicly available. Look at this method. It appeared in Java13 in the hope that text blocks would work, and has been made permanent since then.
Fortunately most of the newly‑deprecated API are those nobody uses any more, e.g. Object#finalize(), new Integer(int). Old code will keep working as long as the previously compiled XXX.class files remain. If they stop working with no such method exceptions, that would be a great incentive for everybody to move across to C#.

I agree; Hackerrank ought to update themselves to Java11. JDK1.8.0_191 isn't really an upgrade to Java8, but a load of bug fixes. Java17 which is the next LTS version is supposed to come out this year. Maybe then Java8 will come out of general support.
 
Jesse Silverman
Ranch Foreman
Posts: 223
8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd forgotten (just for the moment) the deprecations of finalize() which was never a great idea, and more seriously for commercial code, the serialization deprecation.

Neither of those would affect much HackerRank code, which normally just focuses on clever usage of the Java Collections Framework to solve a million different algorithms and data structure problems.

Both changes there and in the usable-ness of streams api make a big difference between 8 and 11 -- not that you can't do the things in 8, but there are neater easier quicker ways to do them in 11, missing those gives a comparative disadvantage to Java 11 programmers (and those who have been studying for Cert exams) on both interview-related and competitive programming problems hosted there.

As to the performance limits, back when I was killing myself doing C++ as my only HackerRank language, I took pride in the fact that only C and C++ have a base factor of "2" for how long you get for your program to compile/link/pass all test cases compared to the others.  There is a column on that page with the fudge factor they use to decide how much resources you get for a problem based on which language you choose.

It is true that the primary purpose of the limits is to make sure you selected optimal algorithms and data structures.

That said, there were problems where I could only get the same algorithm to pass for full score using one language or another, because implementation details would indeed cause me to time out on the longer test cases, or to waste just enough memory to go boom.

I remember those days well, looking with pain at my 30 beautiful lines of C++ code that would have been 380 of C and being proud until I saw someone solving them in 8 lines of Python (which looked like line noise -- the code golfing some people do can make their Python as unreadable as obfuscated Perl)...

Anyway, I hope we can get them to offer Java 11 as an option.  I remember when I was doing C++ interviews I'd have to re-write very neat C++14 as messy C++11 with a disturbingly fast timer ticking down to doom...not fun.

Cheers!
 
Tim Holloway
Saloon Keeper
Posts: 23268
158
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Who needs to obfuscate Perl? It comes pre-obfuscated! And in Perl you could do all that in one line.
 
Mike Simmons
Rancher
Posts: 3787
49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:They went one better. They introduced non‑backwards compatible code even before it was publicly available. Look at this method. It appeared in Java13 in the hope that text blocks would work, and has been made permanent since then.



I don't really see how that's non-backward compatible - what existing code could it break?  Rather, it had a warning that in the future, a backward-incompatible change might be introduced if they changed something about that method.  Which, ultimately, they did not.  But as of JDK 13, they thought they might.  Which could have been a problem for anyone who didn't read the warnings... but wasn't.  Even if it had been, nothing would have been incompatible with code written before JDK 13 - the possible incompatibility would have been later.  Or am I missing something?
 
Mike Simmons
Rancher
Posts: 3787
49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jesse Silverman wrote:It is true that the primary purpose of the limits is to make sure you selected optimal algorithms and data structures.

That said, there were problems where I could only get the same algorithm to pass for full score using one language or another, because implementation details would indeed cause me to time out on the longer test cases, or to waste just enough memory to go boom.



Interesting - good to know.  I wonder if some of those are cases where they didn't test carefully whether their times were appropriate for all languages?  Or if there was some other optimization you missed?  It sounds like you've done a lot more HackerRank than I, especially for other languages.
 
Jesse Silverman
Ranch Foreman
Posts: 223
8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mike Simmons wrote:

Jesse Silverman wrote:It is true that the primary purpose of the limits is to make sure you selected optimal algorithms and data structures.

That said, there were problems where I could only get the same algorithm to pass for full score using one language or another, because implementation details would indeed cause me to time out on the longer test cases, or to waste just enough memory to go boom.



Interesting - good to know.  I wonder if some of those are cases where they didn't test carefully whether their times were appropriate for all languages?  Or if there was some other optimization you missed?  It sounds like you've done a lot more HackerRank than I, especially for other languages.



There are deque problems on there that will only pass in C++ if you use a Vector/ArrayList to back them, and others that will only work if you use a LinkedList to back the deque interface.

And other things similarly rewarding of coding to interface not implementation, and then playing with it til it works [data dependent].

p.s. I didn't answer the direct question you posited.  I believe they did fall short of that some times, as evidenced by the comments sections for a few problems here and there where multiple "contestants" complained they could get it to pass in X language or Y but not Z (sometimes only passing with some hyper-optimization most people would never guess and not needed in the others...).  It also shows a reason that they could sometimes be shy about replacing one version of a language with another.  If any significant number of formerly (just) passing solutions started failing with only a change in the language version used, that would also cause them a headache.  I vaguely remember some stories about that in the past, possibly even with some past Java upgrade(?), which is why I mentioned the timing stuff in the first place.  One thing I like a lot about it is how easy it is to test your solution in a few different languages casually.  The other is how much work they put into their test cases.  There are so many problems where it is easy to quickly come up with a valid but sub-optimal solution that breezes thru the easy cases but then requires some deep or lateral thinking in order to get the big fat ones in under the weight limit.  It also has a pleasant balance of ridiculous fake cutesy problem descriptions with real world use cases hiding behind the same solutions needed to rescue the princess or make the frog happy...it just doesn't have Java 11.
 
If you like strawberry rhubarb pie, try blueberry rhubarb (bluebarb) pie. And try this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic