Live data from Hacker News

Skills Poor Programmers Lack

justinmeiners.github.io

91–100 of 211 posts

Re: Skills Poor Programmers Lack

#91
post #82
post #81

The example is interesting. if isDelivered and isNotified: isDone = True else: isDone = false; is not the same code as isDone = isDelivered and isNotified in ruby, python, js (and more?). [edit: while I'm nitpicking... breaking webpage text selection is also a clear sign of poor programming] [Edit2: more unsubstantiated "absolute truth" from OP]: Using sleep(), cron jobs [...] is almost always wrong. false . Any hw r…

Assuming those variables are all booleans why wouldn't it be?

Assuming is not something "good developers" do.

Re: Skills Poor Programmers Lack

#92
post #28

This article says more to me that the author(s) are inexperienced themselves rather than shed any light on the practice of software development. I'm imagining some recent boot camp graduates attempting to conflate their months of programming experience into something more than that. "Hey old dudes in company I just joined, I found some things I think are basic so I'm going to write an article to indirectly shame you…

I don't think these accusations are fair. The author has been programming since at least 2009, and is degreed in math. They also wrote the "think in math write in code article" that people here seemed to like quite a bit last week.

> The author has been programming since at least 2009

Which is to say, since the author was 12 years old if they followed a standard K-12 + undergrad program (graduated from a Utah Valley University last year it seems).

I think the irony in the article is that the author is very likely 22 or 23 years old and opining about how developers that have been coding for longer than he's been alive still just-don't-get-it. I guess you'd just expect this kind of article from someone with more experience in the field.

I did like this, however:

> Poorly designed software lacks conceptual integrity...It usually looks like a giant Rube Goldberg machine that haphazardly sets state and triggers events.

That is, it seems, the modern web :)

Re: Skills Poor Programmers Lack

#93

Most programmers do not follow the Golden Rule, which is to write code you'd like to maintain with minimal training. It's a principle, but there are various skills involved in doing it successfully, including writing, automation, design, seeking quality peer review, and a few other things. Similarly, writing code that can be deleted is an important skill. Using "good design" and "knowing your language" are fairly neb…

> writing code that can be deleted is an important skill

Are you saying "I can easily delete this code from the project" is a metric for modularity? That's really interesting, is it your own thought?

Re: Skills Poor Programmers Lack

#94
post #88

Earlier quoted context omitted.

In college they taught me that every line of code should do one thing and one thing only. So doing both a test and an assignment on one line would not be prefered over the first example(split over multiple lines). I don't have a lot of experience with programming so for now I do what I was taught. :)

The code is doing one thing: assigning the result of a boolean expression. It's not different in structure from, say, `x = a + b`.

it's sort of an interesting problem in intention - if the reason why the expression

"isDone = isDelivered and isNotified" was written is because the programmer saw "if isDelivered and isNotified: isDone = True else: isDone = false;"

and thought I can improve that, then what they have done is managed to wrap the checking and assignment into one expression, they are logically now doing two things in the one line - it just so happens that they can do that because one of those things was not really necessary to do.

Re: Skills Poor Programmers Lack

#95
post #82
post #81

The example is interesting. if isDelivered and isNotified: isDone = True else: isDone = false; is not the same code as isDone = isDelivered and isNotified in ruby, python, js (and more?). [edit: while I'm nitpicking... breaking webpage text selection is also a clear sign of poor programming] [Edit2: more unsubstantiated "absolute truth" from OP]: Using sleep(), cron jobs [...] is almost always wrong. false . Any hw r…

Assuming those variables are all booleans why wouldn't it be?

They're not booleans in ruby, python, js; they're objects that can be null.

Re: Skills Poor Programmers Lack

#96
My standard for writing "good' code is...

- can my team read & understand it now

- would my team likely be able to read & understand it later

Earlier I wasted a lot of time trying to impress people with clean code, only to later learn those people were never going to care. Now I'm more in the camp of getting it done, which is a heck of a lot easier when you work on a team, and at a company, that shares enough of my values. Getting hung up on "what is good?" is a waste of time, because everyone cares about different things. When you ship stuff, the people who don't care don't speak up don't, and the people who do care do. When the people who care speak up, that's when you have an opportunity to learn what is important to them.

Don't write complete crap, and don't try to make everything. Just try to be productive and not ridiculous, what that means will vary from project to project. Your polished diamond is someone else's stinky turd, and vice versa. For example, I initially learned to write code while hanging out with people who really valued testing everything and aggressive decomposition (e.g. a line of code should only do one thing). I wrote code like that on a new job, and the team hated the number of classes and functions I was asking them to read in a code review.

Re: Skills Poor Programmers Lack

#98
post #73

The skills cited in the article are: 1. Understanding how the language works. Additionally understanding how the language infrastructure interfaces with the computer. 2. Anticipating problems. Prefer solid foundations over veneers that appear to get the job done. 3. Organizing and designing systems. Essentially, SOLID. Two things on this: First, bad code often results from conflicting goals. Moving goalposts and on t…

I'd say that point 1 is more De Morgan and Karnaugh than code.

Re: Skills Poor Programmers Lack

#99

> Using sleep(), cron jobs, or setTimeout is almost always wrong because it typically means you are waiting for a task to finish and don’t know how long it will take. What if it takes longer than you expect? What if the scheduler gives resources to another program? Will that break your program? It may take a little bit of effort to rig a proper event, but it is always worth it. While I understand the sentiment of thi…

I initially had the same reaction, but I don't think that's the author's intentions. He's saying don't use sleep() and cron to constantly poll if some asynchronous thing has completed, have a proper event fire at the end and handle that. Don't think that's in conflict with what you like about your systems :-)

Re: Skills Poor Programmers Lack

#100

> You may have seen code which misunderstands how expressions work: > if isDelivered and isNotified: isDone = True else: isDone = false; > Instead of: > isDone = isDelivered and isNotified Are people actually finding code like this in professional work or is this just an example? I'm self-taught and know I've got some gaps, but this example is so fundamental I find it shocking.

Is anyone willing to explain the second line? I get the first means "if isDelivered and isNotified are both true then set isDone to True, if not set it to false". However I've never seen a variable being set "isDone = isDelivered" as part of a logical test. Personally I think programmers who are "too clever" are cancer inside a codebase. Sure you saved a bunch of keystrokes but your code golf has locked the code fore…

It isn't (isDone = isDelivered) and isNotified, it's isDone = (isDelivered and isNotified). It's just an expression being assigned to a variable.
Post reply on HN