Jesse Silverman

Saloon Keeper
+ Follow
since Oct 25, 2020
Jesse likes ...
Eclipse IDE Postgres Database C++ Java
Been programming "since forever" but Java was always a second (or third) language. It's moving to the front seat. I'm mostly harmless.
New York
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt Green check

Recent posts by Jesse Silverman

What Campbell said.

Advice to the Security-conscious developer goes further, towards avoiding placing UserIds and certainly passwords in String types, because they are too likely to hang around on the heap waiting for garbage collection and it is therefore too easy to find a bunch of them in memory dumps.  Rather, when they need to temporarily exist at all, it is better to have them in char[] arrays which can be wiped right after use.

While it seems paranoid, I am told it is a popular interview questions to stand in for more thorough questions assessing a developer's security-mindedness.

And, what Campbell said.
2 hours ago
Everything in this discussion is awesome, with the exception that I am virtually certain that Scanner is most decidedly not deprecated.

For some reason, presumably just "too much to potentially be on the exam!" Scanner use is not covered on the OCPJP exams (but Console is) but that just puts it on a list of things that are still important in Real Life that won't be found on the exam.  It has a couple of weird behaviors until you get used to it, but it definitely hasn't been widely displaced by something better.
2 hours ago
I had the discussion with Campbell in another thread some weeks back, and made almost exactly the same points you did.

I don't even know how one goes about doing the GPU-based stuff in Java, the material I worked with was focused on C/C++/Python and FORTRAN only.

There is some vector API work that has made its way into Java 17 for future progress in this direction.

I agree with Campbell's main point that short of dealing with HUGE numbers of data, there is very little to be bought using float type, at least on the CPU-based and FPU-based instructions that I think Java uses for all normal math.

And yes, this is all way, way beyond the scope of Beginning Java.

2 hours ago
When you later get to static nested and inner classes you will see why the full rule states "public top-level" classes as well.

When they say classes there, they mean public classes, enums, annotations or interfaces.

For all of these things, if they are public and not nested or defined as members inside each other, "there can be only one".

When I am just throwing together a proof of concept or running a throwaway experiment, I take advantage of this often and will stick several classes, enum definitions, interfaces or annotations in one source, lazily.

The one that is public will have the same name as the .java source file.

I avoid doing this in Real Life, i.e. code that I would check into work or an open-source project.

When working in other languages, I am often spending forever trying to find where a particular class is, or "waiting for Intellisense...." etc.

When you avoid doing this in code others will be looking at or that you will be looking back at much later, there is 0 question about where things are defined, you aren't grepping around or playing in the IDE trying to locate them.

Of course, if they need to be public, because they are being accessed outside the package you've defined them in, then you can't utilize this convenient trick at all, as a maximum of one can be public and therefore seen anywhere outside the package that the source is in.
2 hours ago
While we are on the topic here, when working with the long primitive type, or the Long wrapper types, we use the suffix L for literals, like 123_456_789L.

Java allows you to use "l" as well, but humans reading your code will be unsure depending on your display and settings if they are looking at:

On my screen as I type this here at CodeRanch they look differently, in many other contexts they look so alike many will mistake them.

F/f if you work with floats and L/hopefully not l when working with long types are the only common suffixes for literals in Java.

But both doubles and floats also have embedded letters e or E, such as:

jshell> double c = 2.99792458E08;
c ==> 2.99792458E8

Avoid confusing that with a variable named e or E as well.
8 hours ago

class key word I thought it connects to various people class from LKG to all possible time
I thought class key word needs more tutorials to create class program

But class keyword easily created using Eclipse like IDE

So I like SQL Table Keyword

ClassRecord or Record will be better in java, C++ If possible in future

I thought class key word is related to Time Machine and Time Travel

There's some pretty fanciful stuff in here, and some practical stuff.

In Object-Oriented Analysis and Design, which is not strictly associated with any one particular implementation language, which could be Java, Scala, C#, C++, Python or others...

The class is a basic unit of design, as well as being a keyword in most of the implementation languages.

Whether the units of individual classes are visible in a meaningful way to the User depends on what we are dealing with.

For example, End Users normally won't be aware of our class hierarchies.

But if you spend a lot of time writing API's, then various classes will indeed be part of the Application Programming Interface that the "user" (who is also another programmer) sees.
Other ones will be part of the internal implementation and hidden from or invisible to the programmer who is the "user" or "client" of the API we are providing.
In Java and some other languages we have something called an interface rather than a class, whereas in C++ for instance, even the things we would put in there are implemented as purely abstract or partially abstracted classes.

So there is some overlap and some distinction between Object-Oriented Analysis and Design and coding and keywords such as class or interface.

Java has been extremely popular for just over 25 years, so things that intended to present OOAD principles would contain ideas that were explicit in Java but only implied in C++, the main one coming to mind being an interface.


I thought class key word needs more tutorials to create class program

A big part of the entry-level Oracle Java Certifications concerns solid understanding of how these principles work in practice in Java.
The exams are expensive and obtaining one is something that you might or might not want to do.
However, any of countless courses ranging from completely free thru cheap to very expensive cover this material very well, you should consider devoting some time to it whether or not you decide to seek any particular certification.  In the "no charge at all category" one famous source is the Tutorials that are associated with the team that provided us Java in the first place:

In particular, the Java Community's collective understanding of the basics of classes, interfaces and objects can be found here:

It may be that as you look at those, you feel "I already know all of this!"
If that is the case, then the most productive area to work on could possibly be effective technical communication in whichever languages your team or prospective employer speaks/reads/writes. On CodeRanch, we do share all our writings in English whatever our first languages may be (we sometimes have interesting discussions about how our first languages differ from each other in ways that can affect how we think about programming or design, but not in our main threads).

Similarly in Computer programming characters can be specified as +A, +B+,..+z, -A,-B,..-Z
ASCII needs to be created for this If possible

Example : Blood groups found with positive & negative values
Banking and Insurance uses Rating positive & negative values

Here I would say that we really don't need additional characters in Unicode for these things, because something like +A or -z would be a String rather than a single character.
Knowing Unicode well is very good if you want to be working with different written and spoken languages in your software, I am currently studying Internationalization and Localization topics in Java in preparation for the OCJP so these things are on my mind.  Materials on these topics are found in the tutorials I linked above as well.

Because this is CodeRanch, and because you were thinking that we wanted more characters to represent categories like Blood Groups or Ratings, I will link something that explains why even Strings are not the ideal way to represent such concepts in Java (or most other languages).  At one point in the history of Computer Science nearly everyone did it, but now we have better options than "Everything is a String".  It can be done but has many drawbacks.  I did not write this, but I think there is a lot to think about there:

I'm about out of time right now, so I hope these things have been helpful.
8 hours ago

Campbell Ritchie wrote:How much of a handicap is not having 819 if you have been programming and earning good money for several years? I know some experienced people sit 819 more to learn the newer features of Java8+ than to have the qualification.

Yeah.  In this case the people I am thinking of know hardly any Java 8 new features, and pretty much none from 9, 10 or 11.
They write code the way any good developer would have in 2012 and 2013.

9 hours ago
There may be an upper limit on how reassuring I can be given the fact that I am myself between jobs at the moment, going on lots of interviews and sometimes actually doing very well but not quite getting hired for anything for a while now.

You mentioned continue which is very specific but I will address that first.

I see some problems in the current formatting of the long version of the style guide that JavaRanch/CodeRanch maintains:

But if you look you will see that there was a consensus that continue is poor Java style.

It is interesting that Java provides labeled break and continue (at least I found it interesting, coming from a variety of languages none of which had it) and for years you could expect one or more questions on such things on Java Certification Exams (I absolutely *hate* those problems, they can eat up all of your time and kill your grade all by themselves, and have made a rule to force myself to skip them and only come back to them later if I have time, as I might get four, five or six other questions right in the time I would waste on one of those)...

Oops -- that's about *me*.  The point is, they had gotten you all discouraged about not being familiar enough with a Java feature that many good Java developers feel you should never, or almost never use!

Again, it is on certification exams, so you do need to know it if you take one of those, but I wouldn't let it bother me too much.

Back to jobs.  I will quote "Durga Sir" from DurgaSoft, who jokes (but is only at most half-joking) "To get the job you need to know everything, to keep the job you need to know nothing" based on the fact that a huge percentage of his students are between jobs or trying to get their first one, and relatively few of his students are currently working at the time.

I can tell you that when I am interviewing it feels like everyone is better than me or knows more than me, but when actually working with them it often doesn't feel that way at all (I have had the privilege of working with a good number of extremely highly competent people, but they aren't a majority) -- a lot of people know enough to get by, and have found themselves some niche that works for them.

There will be some jerks even at generally good places to work, and there are places that might be good for their customers or stockholders, or at least their top owners, but are terrible places to work at.

I do feel that basic nested loops have been a pretty basic part of computer programming for a long time, and are commonly seen in various different languages where they look more alike than different.
So there is something to getting comfortable with that.  Even if you might see them more on interviews or coding challenges than in Real Life they are hardly rare or exotic.  Nested loops with labelled continue or break on the other hand are something that a good number of people think shouldn't exist at all, and a lot would only expect to see them on tests and not be writing them.

There are definitely elements of luck in job searches in particular and life in general.  I have had interviews where they asked question after question on things I just knew a lot about randomly, and other ones where the opposite happened, or worse still, the focus of the whole tech interview was a related series of questions/coding on some topic I was planning to study in the near future but hadn't gotten to yet.
So don't get discouraged.

Lastly, there are people like Piet who aren't paid for a day job of "Computer Programmer" or "Software Engineer" who could likely program neatly concentric rings around many people who are.  There are so many different jobs out there with so many different requirements.  I have worked with many people who were making good money and keeping their "stakeholders" happy that would barely do any better than my late Grandmother would have on many of these interviews.

I right now know a bunch of people who are making very good money as Java developers, for instance, that might score ~30% or so by my estimates if they were to try to take the 819.  It will likely be an issue for them if they need to change jobs, but doesn't affect them in their day to day life (well, that they know of.  I happen to think a lot of the newer things in Java are quite awesome)...

I hope that helps make you less discouraged.  Usually we are discussing specific technical things about Java, frameworks, algorithms or data structures here but I definitely sympathize, not just empathize, with you about challenges of the hiring process.  As for some jobs being terrible places to work at, I think most people who visit this site would say that is an unfortunate fact of life we know about.  Getting or staying away from such places is one reason some may be working on the skills they come here to help advance.  Cheers!
20 hours ago
In PowerShell you can cd to any directory that exists and your userid has permission to access from any other directory you are allowed to be in.

In legacy CMD, for those who miss the 80's, you can use the /d switch.

PS F:\Labs> cd C:\
PS C:\> cmd
Microsoft Windows [Version 10.0.19042.1288]
(c) Microsoft Corporation. All rights reserved.

C:\>cd /d F:

Knight Rider, Who's the Boss, Cheers, and CMD.EXE, amiright?

javac puts any .class file resulting from compiling any .java source file into the same directory as the .java source file sat in.

Unless you pass "-d <outputdirectory>"

Then it puts it wherever it belongs according to the package that it is in under <outputdirectory>"

That is, if the output directory is F:/javaclasses/, then a source that has package com.coderanch.example
will have its class file land in F:/javaclasses/com/coderanch/example/Sample.class etc. regardless of where the .java file was originally sitting when javac found it.
1 day ago

Piet Souris wrote:
I've never been involved as a professional programmer, albeit I used things like Basic, C and Java at home, and Excel, VBA and R in my job. So I am not hindered by any professional standard there may be, I am as free as a bird to follow any convention I like, even self-made conventions!

Yeah, um, well, for those who are seeking employment, choice of coding style may likely be as tailored to what the interviewers want to see as choice of hair/makeup/clothing and delivery is for a Broadway or Hollywood audition.  Maybe not quite that much, but maybe yes.

I feel like I've gotten colder receptions to code that would work perfectly than to other stuff that might have had one or more serious flaws based on whether my code "looked like what their team considers normal coding style".  I'm neither applauding this as good nor decrying this as terrible, but it is palpable.  During pair coding sessions on interviews, one thing they are looking for is "Do I want to read code that looks like this?"  I've heard some people say that even getting the problems right is secondary to whether they feel comfortable or uncomfortable looking at it.

Here at the Ranch, the only enforcement of our "coding standards" is the promise that if they are adhered to (code tags, sane/consistent indentation, meaningful variables names, following Capitalization Conventions) that the posters will maximize their chances of lots of smart people reading and replying to it.  In interview situations it determines the chances that they will call "Next!" and pass on the candidate.

That's kinda just me grousing.  My actual opinion is that it is a marketable skill to be able to say "Sure, would you like that in Idiomatic Modern Java or in a style that those who only spend 10% of their time looking at Java code will recognize the quickest?"  I am open to considering your solution or a variant of it the best "Idiomatic Modern Java" solution.  Those who want it to look as near-identical to the C++/C#/C Python and JavaScript solutions they are looking at might not like it, so it is great to be able to do either upon request.

1 day ago
Because the posters who would most likely say "Hey, you should be doing that with a .stream(), a .filter() and a Collector anyway!" might not come into this forum often, I will just say that if you asked this on one of the other forums, you would have already gotten that response by now.

I am semi-neutral on the topic, but thought I should represent them.  
1 day ago

Do you really mean examMap there or was that just a typo?

You wouldn't normally see stuff like what you showed very often.

In terms of "Why do I make data private and should I have getters and setters as part of the public interface for my class?" There is not only tons of stuff "Out there, somewhere" covering this question, but it has recently been discussed extensively right here.

The first thing that came up when I searched was this recent popular thread:

1 day ago
And, "Welcome to the Ranch!"

Your post brought so many ideas and questions to my mind I completely failed to note that this is one of your first posts here.

We really do strive to be as friendly, welcoming and understanding as we aim for technical competence.

Have you been working in Software Development recently?  Has it been in Java?  I failed to ask these two questions as well.
It would be difficult to give useful answers to some of your queries without knowing those things.
1 day ago

a) How c++ class key word, java class key word successful for many years? Please guide me . Thank you

b) Why class key word created in Java compared to Table keyword in SQL? Please guide me. Table of Data is realistic approach as per Real world system. class of Data is not realistic. I feel Java needs key word change for class. I not able to communicate this problem in 1999-2000 during the C++ lesson in B.E Mechanical. Still deep discussion not done by any one for Table key word in SQL vs class key word in Java. In 2006, I worked in Object Relational mapping software Hibernate. Please provide your feedback. Thank you  

c) In job interviews, recruiters & Technical panel members are not able to discuss about class key word. In LinkedIn post also I am not getting any response. Lot of delay is happening for my next Employment & Job. Please help. Thank you  

I certainly don't see the class key word or class type going away any time soon, or even becoming rare.

The most relevant trend in Modern Java that I am thinking of is "Record Classes" or just record for short.

Learning about those may be helpful to you, suggesting that Java, C++ or C# "should" stop using the class keyword will not be.

You may be getting low response rates because a lot of people are having difficulty understanding exactly what your questions are.  There are some very patient and kind volunteers at this forum who may help you refine your terminology and get your points across more clearly.

As an example of a sentence that is filled with valid English words and presumably valid grammar, yet one that I can only guess at what it is saying, let's take this one:

In job interviews, recruiters & Technical panel members are not able to discuss about class key word.

That is simply untrue, I have had many technical panel members doing Engineering interviews that are most certainly quite able to discuss these issues.
I may not understand what that sentence means to say.

I had already responded about how the best way to speak to highly technically-trained engineering team members is very different to the most effective way to speak to technical recruiters, who, despite their title, may have never written a line of code in their lives, or taken an OOAD course, etc.

e) In School level Mathematics, Graph is used for representing positive data, negative data in +X axis, -X axis, +Y Axis, -Y axis for numbers. 4 Quadrants used for covering 360 degree in Graph. Similarly in Text data or String Data, etc positive data handling, negative data handling not discussed. I am thinking about Positive attitude, Negative attitude of Programmer, Program end user related Positive attitude, Negative attitude etc. Software Programming languages such as BASIC, C, C++, Java etc not handles the Human Positive Attitude, Human Negative Attitude, Safety and Security aspects of Human in Programming & Application usage. I came to know about Business Process Management (BPM) or BPEL linked to Human activity in Process. I feel from 1996 to till date Computer Languages & Software Programming not takes care of Human Safety and Security. Managing Human connection to Computers, Computer Programs & Applications needs to Managed in Proper way. Thank you  

There are a couple of issues here.  One is that there seems to be some confusion about the mathematical sense of positive and negative, which merely mean >0 and <0, and words that happen to be the same word, but with greatly different meaning in general English usage.  The words "positive" and "negative" mean roughly good and bad in English vernacular outside of mathematics and engineering.  In accounting, positive normally indicates money coming in by convention, and negative normally indicates expenses or fees, or gains and losses in the value of an asset.

The other stuff you start getting into aren't specific to C, C++, Java or Python at all, and are very important, but are considered in the general areas of Human Factors and CyberSecurity.  Again, they are certainly very important, and, in fact, the Java OCPJP 819 exam has an entire section on Cyber-Security in terms of its implications to Java programmers these days.

Once you get to the technical interviews and coding challenges, your ability to communicate clearly is an important part of the hiring decision process.  Until that point, it is by far the most important part of the process.  Writing at/on any place that you can find people willing to read and discuss points that you are making, including giving you feedback on the level of readability or comprehensibility of your communications will help you hone those skills.

This often requires learning to be brief and clear in your answers, a challenge I can rise up to when required.  I've been (much) more verbose in my answers here because I am also having some difficulty in being sure exactly what your different points were asking, and wanted to cover multiple possible interpretations.

I am not certain that Java in General is the best of our forums to continue the discussion, but I am pretty sure there would be regulars on this site who would be happy to help you refine the language you are using  in the various questions.  This would likely help you in early stages of interview processes as much as any other efforts.

Some of the Java-specific interpretations of some of your earlier questions might be covered in discussions about "Why did Java recently get 'record classes' after all these years and when should I be using them instead of the plain old regular classes we've always had?"
This would be precisely the forum to have that discussion.
1 day ago
I'll take a stab at one or two of these because they seem to be interesting questions.

f) Interview Panel is not reading my resume & LinkedIn profile properly. Lot of Delay happening in Employment. Please help me for faster Employment

Some people place a lot of attention on seeing recent experience that will be seen as relevant by hiring managers looking at a lot of resumes in a hurry.
I am often asked by recruiters to touch up or specialize a resume they have seen highlighting things that they know that the people making the hiring decisions are looking for.
While I am not willing to "highlight" something that I have no experience in, it is often true that there are things I know quite a lot about that are not highlighted on my resume and wouldn't show up in any of the dreadful scanning checks that some places use to reduce the number of resumes being read by actual humans.

It is not entirely clear what you mean by the term you are using in this post: "Interview Panel".
I am guessing you mean those that are in charge of doing initial screening to see which candidates they are even interested in calling for a pre-screening phone discussion, prior to any "technical challenges", "coding challenges" or technical interviews with engineering staff?

In my experience, the key to getting thru that first pre-screening call, often done with HR is to sound like you have a lot of technical experience and are very easy to communicate with.  This means checking their level of technical knowledge to prevent you inappropriately going into too much technical detail in your answers, and that it is easy for business-side people to communicate with you in whatever language the company does their business in (often, but not always, English).

The other questions sound like you are already getting thru to the technical interview where you are talking to a software engineer.  The correct way to speak there is considerably different than the pre-screening with a non-technical person.

None of the above is specific to Java, and this might not be the best forum at CodeRanch to proceed further in for that line of questioning.  There are others like this:

and the adjacent "Soft Skills" ones that might be better suited.
1 day ago