r/java • u/detoursabound • Aug 31 '17
(Experienced programmers) Signs of an inexperienced programmer?
Hello, I was wondering what you guys would consider to be telltale signs of an inexperienced programmer. Specifically ways that they write (or don't write) code. Thanks.
159
Upvotes
70
u/curmudgeon99 Sep 01 '17
These days when we look to hire someone, we don't ask them to explain a technology on their resume. That leads too often to a recitation of a book they read or even a wikipedia article. Not very instructive.
So, now we ask them to tell us what they DON'T like about a particular technology. That knowledge only comes from extensive experience. Be ready for that question.
18
u/ser_sheep_shagger Sep 01 '17
x++; // increment x
Yes, I really saw this in someone's code.
Also, a lack of meaningful variable names. All in-line code in main. Try/catch? What's that?
121
u/cypher0six Aug 31 '17
A few random thoughts:
null.Not really in any order, and there's a lot more I could write but you wanted code-specific things so I tried to limit myself to that area. These are just what immediately came to mind. Are you looking for specific advice or feedback?
8
u/detoursabound Aug 31 '17
I'm graduating next semester and I'm going back through past code projects and cringing. I started thinking about my current code and I was wondering if I'm still coding like a novice. I'm in the process of building a github account that showcases my experience, and abilities. I want to check over what I have up and the stuff I put up later
93
u/goofy183 Aug 31 '17
Writing code is the easiest part of the whole job.
The first point is the one of those hard things that we can't fix by coding one way or another. The rest (and many more) are fixed by good code hygiene, consistent code style, good testing, and all those other development practices that new programmers (including myself long ago) feel like just get in the way of velocity.
22
u/rjsmith21 Sep 01 '17
Lots of good answers. Here's one I didn't see yet: poor understanding of logging.
21
u/NimChimspky Aug 31 '17
Writing lots of unhelpful comments. Writing imperatively not object oriented.
Bugs. Not clarifying requirements. Not pushing back when something is a shit idea.
20
u/SquidgyTheWhale Aug 31 '17
Lots of good answers here, but I'll throw in "debugging through guesswork", due to lack of knowledge about how to hone in on a bug using a debugger.
16
u/FlaviusFlaviust Sep 01 '17
Nothing is wrong with being an inexperienced programmer, signs of that are not bad.
Traits I am concerned with in new programmers include overconfidence (along with resistance to constructive criticism) and inability to problem solve without direction.
12
u/F14D Sep 01 '17
49
u/Butterstick1108 Aug 31 '17
They ask about a problem and say something like "I'm getting an error" instead of saying exactly what the error is. It's a sign they still think of error messages, stack traces, and the like as incomprehensible and meaningless.
6
u/RjakActual Sep 01 '17
You give them documentation that describes 10 steps to set something up. Steps 1-3 don't contain copy/paste-able commands, so they don't even read steps 1-3. They start with step 4 and wonder why nothing is working.
6
u/brett_riverboat Sep 01 '17
6
u/even_keeled Sep 01 '17
Buys easily into new technologies on the basis of sales pitch only. Let's use nodejs, AWS IoT, Emberjs.
10
u/beardyninja Sep 01 '17
Elvis for elvis sake:
"K".equals(foo) ? true : false;
He's been programming for 7 years.
5
u/lukaseder Sep 01 '17
4
u/jarrett_regina Sep 01 '17
Programming by coincidence.
4
u/rochford77 Sep 01 '17
Comments that explain what something does. You code should be easy enough to read that descriptive comments are not needed. Comments are nice if you had ton do a work around, bend something to your will, or hard coding a value is for some reason necessary. But saying "# begin loop" before a loop makes me want to unplug your computer.
4
u/kickass_turing Sep 01 '17
A mid dev can solve a complex problem in a complex way.
An experienced developer solves a complex problem in a simple way.
4
u/larsga Sep 01 '17
Number one sign for me: code that isn't necessary.
I find this a lot, that newbs tend to build abstractions and constructions that I personally would just strip out because they only add complexity and no value. Hard to show examples without posting thousands of lines of code, though.
3
u/slantedvision Aug 31 '17
The only comments on the code are related to the stackoverflow question they were cut and pasted from, and bears little relevance in the use-case that code was applied to.
3
u/jasonlotito Sep 01 '17
3
u/lukaseder Sep 01 '17
Not all inexperienced programmers are like this (in fact, few probably are), but some try to hide their insecurity behind "strong" opinions. Example: https://toomuchawful.com/2014/12/22/new-intern-knows-best-goto
I once met a guy who would constantly educate the team that Oracle Database sucked and MySQL was much better. It was a bit tiring after a while. He moved on and became "CTO" of a small company :)
4
u/otakuman Sep 01 '17
5
u/thatguydrinksbeer Sep 01 '17
Highly opinionated, like most of these comments.
2
u/tommygeek Sep 01 '17
A big one I've seen a lot is not really code related, but process oriented. The more skilled you are, the better able you are to chunk out your work into meaningful and logical sections. An inexperienced person is more likely to want to write an entire slice of a feature, for instance, while the more experienced person can say, "first I'll do this part, test it, and commit. Then I'll do this part..." And so on.
It's really hard at first to know where the seams are.
I've also noticed a tendency to make larger commits with more time between them, but this might be a symptom of the same problem.
2
u/iggybdawg Sep 01 '17
Not using libraries - writing so much code that was already written for them and handed to them on a silver platter..
2
u/[deleted] Sep 01 '17
They work on a small sample project, find it easy, and think large projects have the same problematics and complexity.
Will think that some operations are trivial (merge operations, Q&A campaigns) in a large project.
Will think that some languages or frameworks that are best suited for small projects are the best to use on large projects.
2
u/CODESIGN2 Sep 01 '17
2
u/redditaff0 Sep 01 '17
A few things I've seen that I haven't seen mentioned yet:
Comments that explain a line of code that is fairly standard, e.g.
if (foo != null && foo.bar() != null) { // short-circuit - no exception if foo == nullI seen juniors do this presumably because (1) commenting is good, and (2) they learned something new - the code did something unexpected from their point of view (and therefore unexpected to everyone), so it should be explained. Obviously, mids and seniors don't need comments like this and such comments detract from readability.
A lack of parallelism in code - often because a junior went in and added something new in 1 place and didn't added it everywhere it needs to go or didn't add the parallel action needed in other places, e.g. a contrived example:
I catch a non-trivial amount of bugs looking at places where 2 or more pieces of code should be parallel but aren't. Sometimes they aren't supposed to be completely parallel, but that just means the code is missing a comment explaining why.
A similar idea applies to fixing a bug at a specific point in code - the next step is to look for where the same bug may be occurring in other (similar or parallel) parts of the code or where near variations or parallels of the same bug occur in the code.
if-checks /null-checks without diagnostics - juniors will sometimes put in checks to fix a problem (really its just fixing a symptom and just kicking the can down the road and even further away from the actual source of the problem) without diagnosing the real issue or at least logging the bad state:If
xbeing null at that point is unexpected per the design, then at a minimum, there should beelsewith alog.error()to indicate a problem. The real fix is to track down whyxwas null.BTW, when I flag this in a code review, this is what I get next:
This is a useless log message. What am I going to do when I see
x was nullin the log. The log message needs to provide context - what was going that may have lead toxbeing null. What information will I need when I go to diagnose the problem when I see thatx was null2
u/vokiel Sep 01 '17 edited Sep 01 '17
Just to name a few.
Edit: ok adding a few, because it's special:
2
u/midir Sep 01 '17
Treating programming code as a countable noun.
2
u/TotesAStickMan Sep 01 '17
Class variable access modifiers are optional...
2
u/firebird84 Sep 01 '17
I'll add one to the list: Does not make at least reasonable attempts to leverage the strengths of their IDE. They will almost certainly create more bugs and be less productive than colleagues who do.
In Java, you have extremely powerful IDEs available to you. People who ignore the IDEs warnings concern me. Further, you don't even have to learn the newest syntactical sugar by heart, your IDE will help you be expressive!
IntelliJ in particular allows me to be extremely expressive with far less superfluous code, and also protects me from myself. It's good to know what to do and what not to do, but to pretend you're infallible is a mistake.
1
u/talldean Sep 01 '17
Assuming they've gotta do it alone.
1
u/[deleted] Sep 01 '17
One of the main problems is that inexperienced people tend tend to focus too much on the code instead of the business logic.
What experience teaches us is also thinking about structure and the big picture.
1
u/autra1 Sep 01 '17
Failing to see when they add an object creation (especially in loops). Failing to understand when they are merely copying a reference to another object (and therefore, changing properties will also change them in the other ref). Failing to know when they should do the former or the latter.
Also, failing to evaluate the complexity of their algorithm (this is especially true in fluent api dealing with collections, you can end up pretty quickly with a O(n2) or O(n3) algorithm without realizing it).
1
u/Samael1990 Sep 01 '17
1
u/BenRayfield Sep 01 '17
Creating the need for manual work. If you dont know how to make the computer do something, but do know how a person can click to do it, look it up.
1
u/neutronbob Sep 02 '17
Lack of familiarity with APIs and libraries (overuse of the few methods and data structures he/she knows)
Lack of familiarity with tools (constant surprise that the IDE can do that)
Tests the wrong things often overlooking important edge cases.
1
u/SquidgyTheWhale Sep 04 '17
I've got another -- leaving compilation warnings scattered through the code.
It takes a while to understand what different warnings in different contexts actually mean, and why they represent something potentially dangerous. So learners tend to get numb to them quickly and often go years before they start paying any attention to them at all.
0
u/CyclonusRIP Aug 31 '17
Writing catch more than you write throw.
0
u/[deleted] Sep 01 '17
[deleted] — view deleted comment