If You Call Out Bad Code, Make Sure It's Bad First
naildrivin5.com
naildrivin5.com
Bullshit, sorry.
Questions to ask yourself before "calling out bad code".
1. Does this code belong to someone on your team?
2. Does your code rely on this code?
3. Does the code represent a risk to you or your business in some way?
4. Do you have the direct contact info for the developer so you can appropriately, discretely and professionally inform them about their code?
Github == "Developer Playground/Experimentation Lab".
Why in the hell should I have to feel that every piece of code I put up there 'must' adhere to 'your' standards or anyone else's?
How can we as a development community rationally expect to grow the open source ecosystem and encourage people with this type of snobbery?
There's one lesson that I'm personally taking from this, after unsolicited ridicule, one sincere apology, one bullshit non-apology, and one arrogant I have nothing to apologize for! If I build a small thing to scratch my own itch (which I often do) I'm going to think twice about sharing it with the world at large. Or, more succinctly, I've become yet more of a misanthrope.
Thanks guys!
Can we, as a community, be at least as nice as serious amateur photographers?
Maybe I should be, but I am generally unafraid of sharing my photos.
Maybe I, as someone horrified by Heather Arthur's story, have some sort of ethical obligation to provide constructive and helpful feedback to people. I'm not a great programmer, but I've been at this for long enough to have some useful opinions.
Open invitation for my fellow HN community members: point me at a repo and I'll try to say something actually helpful.
You could do something similar (or those guys could do it) where you provide feedback on other people's repositories in exchange for feedback on your repository. Sort of a community code review process.
it's JS but you might enjoy node-webworker, which uses websockets to implement inter-Node.js message passing: your specific case is debugger being an outbound messaging port, emitting context programmatically.
Regardless, my point is that I don't think I'm able to grow a thick enough skin to be indifferent in the face of such cruelty, so I'm not going to extend myself. Other people may feel differently, and that's great for them.
The idea of open sourcing our work is truly admirable however there are some of us out there who just can't stand the hate and Alpha-nerd jockeying, so we opt out. I don't think the world is missing out on much by my own lack of contribution but who knows how many truly brilliant yet fragile minds are self selecting out of the open source community because they just cannot cope?
just like she chose to read the good things, she chose to read the bad things. SHE CHOSE.
people seem to ignore that little fact, instead they result to writing meaningless essays, on how to apply their opinion as a universal standard to life. nothx
look through the tweets. https://twitter.com/search?q=%40harthvader&src=typd
noone personally shoved it down her throat. it's new to me that you get personal messages for someone talking about your github repo somewhere.
the blame the victim talk is like saying getting personally assaulted is the same as someone getting his car destroyed after parking your car in front of central park in new york. sure you could argue that they did it solely, because they knew the person, but this is clearly not the case here.
It doesn't take long to read a tweet, and you can't exactly un-read it if you find it to be deplorable.
http://www.kjetilk.com/2009/02/legacy-code-is-code-without-t...
The argument I guess is, at what point does it become fair game for criticism?
OTOH it is also a place for your crappy bash scripts.
I've got plenty of hacky scripts that I would consider putting on github, just as a backup as much as anything else. I honestly wouldn't care what criticism they got, though criticism with accompanying pull requests would be vastly superior.
My main hesitation though would be if a prospective employer goes and looks through it and goes "oh, this guy's code sucks".
I don't want people to use my shitty methods or shitty code, I just want somewhere to put my thoughts.
I can't help feeling that this kind of attitude is what caused Heather to feel bad in the first place.
I agree with your points, but the way you present them leaves a lot (of politeness) to desire.
I thought he hit the nail on the head.
It's no body else’s business but your own what you choose to put in GitHub.
Those that claim the genesis of this whole issue is offensive should take equal offense to the "bullshit" line.
So to paraphrase the OP I read him as saying:
Rubbish, I don't agree with you and here is a list of reasons why?
"What you said is rubbish. I don't agree with you and here is a list of reasons why."
Now, can you tell me what value there is in the "What you said is rubbish" part? Let's go one step further: what do you lose by omitting that part?
Mind, I'm just as sick as the next guy of the whole "we must never be negative", politically correct thought police that has been taking politeness to unrecognizable and unreasonable extremes. Sometimes there are good reasons to be aggressive or less than polite, but "sometimes" is not the same as "always" or "most of the time" or "as often as I feel like it".
Sure, there are many ways the OP could have phrased his response.
Personally, I don't think the approach use to attack someone else's point of view is that important, provided the attack is aimed at the message and not the messenger.
In this case I don't think the OP said anything about the messenger.
I don't have a problem with it, but it is the same semantics as what started this whole issue - though he does expand into a list of reasons (which isn't possible on twitter).
Now, granted the word can take on different levels of intensity depending on the circumstances in which it is used.
But it can and is used in general conversation and in that context it means nothing more than "I don't agree with you".
At least that is how the term bullshit is used here in Australia.
For what it's worth, I think most of the commentors are reading far too much into "this is an eye-bleeding script*.
I've seen people hurt by having what they've said called 'bullshit' by someone they respect; it's capable of emotional harm as well. That being said, let's not walk on eggshells.
If someone is offering something to the world at large that you don't feel is a very skilled offering, you should shut the fuck up unless you want to seem like an asshole. The reason is both that they aren't hurting you in the least and that if you aren't interacting with them, your ability to judge their skills is going to be limited. Unless they're giving out poisoned candy or something, people who give should be congratulated.
If someone is somehow intentionally annoying, hurting, offending someone else, then it is entirely OK to tell them to stop. Bonuses for being clear and uninflammatory yourself, mandatory if you aren't an involved party.
Having said that, a reasonable disclaimer about what your project really is more than assuages that concern for me. Or if it's small enough, rolling it up into a gist might be an option for proof-of-concept stuff.
In any case, the first three are most likely false in this case and the fourth is just silly. Do you appropriately, discretely and professionally inform the author of every tweet, blog, or page that is wrong on the internet?
That doesn't preclude constructive criticism. I put my stuff on Github for review. Granted, I wouldn't like malicious comments but I sure as hell would like to know if I did something wrong.
> Why in the hell should I have to feel that every piece of code I put up there 'must' adhere to 'your' standards or anyone else's?
You don't have to feel that way if somebody points out your code has flaws. The issue in heathers case was (1) the code wasn't bad (2) the criticism was malicious.
Please don't. The Twitter snark isn't normal, it's an exceptional case. It wouldn't be on the front page of HN if that kind of behavior were the norm. And it's the jerks on Twitter who came out looking bad here, not the author of the code.
I really like how GitHub has encouraged people to err on the side of releasing their personal experiments. I was doing it myself in pre-GitHub days by publishing Darcs repo URLs on my website, but it didn't have the social aspect and Darcs never caught on like Git has. It's lovely to see the idea of "share all your code, by default" so validated as it is on GitHub.
Whether or not you release your code, assholes will still exist and they'll still find a way to be assholes. So don't let them ruin a good thing.
No, this isn't true. It's completely normal. It's been normal since long before Twitter. In exactly the same way high school bullying is normal, this is most definitely (a) prevalent, and (b) a problem. But it won't change, because people tolerate it.
You want me to open up my personal projects? It's not going to happen. It won't happen because we live in an ecosystem where the top dog is the one who barks the loudest, not the one who's most productive. People pay attention to what other people say. And there is nothing anyone could say about personal projects except "Pretty cool" or "Damn, what a steaming pile". The first is nice, but I'll get by without it. The second serves only to lower me and my ideas. I don't want my capabilities (ideas) to be constrained by others' lack of imagination.
Even if you're only following prominent people in your industry, you see some really embarrassing back-and-forths. I didn't want to get myself involved in the ones dealing with my friends and people I enjoyed because I have no idea who I will run into throughout my career, so I deleted my account.
I wish it were that easy. Other people'e negativity just... gets to you.
The only way I've found to deal with it is to run away from it until I have a project I truly feel will help the world (even in some small way). Then I'll happily face the negativity.
Exactly. And before GitHub. And before open source. And because haters will hate no matter what, we shouldn't let them stop us from sharing what we build and learn.
I write code every day, some of it is great, most of it is good, some of it is shit (working shit, but shit nonetheless). The reason some of it is shit varies: time constraints don't allow for the proper solution, working around a crappy abstraction that I can't control, etc, but if you decide to focus on some snippit of the shitty code I wrote and extrapolate that to assess my skill as a programmer I reserve the right to extrapolate that your experience doing real world programming is pretty limited, because otherwise you wouldn't be so naive.
The most fun I have at work now is "try to get the most audacious python module through the firewall and then get it approved by the project manager as they have absolutely no clue about what I do".
Sorry kids but unless you make it (and make it big)... that's you in ten years time.
If I am honest, I have got over the "OMG what's it written in?" stage. If it works and if the (time saving per run * the times I need to run it ) > time it would take to write it myself, then .. that's a success. Then.. move onto the next issue to get some project tasks done, contract renewed, kids fed, mortgage paid etc etc etc.
On the topic of massive Perl scripts, I once worked on implementing a system that was an unholy maze of Perl, Pro-C, Pro-COBOL, Oracle Forms, Java, and PL/SQL. It was the first time I'd ever had to read and write Perl and Pro-C. I even remember reading Pro-COBOL at one point to debug a problem. Good times.
Since the above is somewhat tongue-in-cheek, I'll clarify that I certainly think we should strive to write excellent code and constructively help each other to that end. We should probably be very slow to dispense judgement but quick to share carefully considered, contextually relevant advice. You really do need to understand the context under which something was written to make any useful statements about goodness or badness (which is still probably not that helpful a measure). Something that looks bad at first may be fantastic work considering the circumstances under which it was written.
I was very surprised by the quality of the code in the replace.js repo given the vitriol that surrounded it. I'm not a big contributor to open source, but I've recently made some modifications (improvements?) to a Haskell library I use and was planning to make a pull request soon. This event gave me pause. As someone who couldn't tell what was so eye-bleedingly bad about the replace.js code, I was nervous that I would endure a similar fate.
I don't mind the code being publically-accessible as the price for free hosting but I have no interest in being hounded about my personal scratch code either.
And while this was mentioned a few times in the previous thread, it bears repeating again: There are quite a lot of people out there using Windows, which includes developers. Node is a first-class citizen on Windows, and grep, sed and friends won't be there out of the box for you. A properly done Node command-line utility is generally more cross-platform than a shell script using grep and sed would. And there's quite a bit of command-line utilities made with Node out there (most revolve around web development, such as build tools like grunt and things like CoffeeScript/TypeScript/etc compilers), so it's not like this one is unique in that regard either.
Heather Arthur day: On this special day we post useful code that we might otherwise be unwilling to post because of what other people might think of it. Because some people have the courage to do this anyway and when they do, it makes the world a better place.
If just a few people do this, they might be considered crazy and laughed at, but if all of us do it, why then we'd have a movement.
Ask HN: What is your dumbest project on Github? :-)
Please don't let this deter you! I know how it feels. I was literally shaking when I put my first project on GitHub. Literally. The second time too. And the third. Still am. Still scared of making a fool of myself, but I know what a great learning experience it is and that it benefits my career, so I force myself to do it. Add to that the fact that it is a ton of fun, and every single star a project of mine gets (and the stars are few) makes me proud.
For example today I found a memory leak in a popular open source library. There's a good chance it is installed on the computer you are using right now. It never even occurred to me to submit a bug report or patch because when I have submitted patches to this project before one was completely ignored (somebody else fixed the issue 6 months later) and the second time I got flamed (that crash causing bug still exists as far as I know).
I have about half a dozen local copies of projects related to things I'm interested in that have various improvements or fixes that will probably never be submitted back to the project, and I don't think I'm unusual in that. Most of the issues are fairly obvious and tend to get fixed eventually anyway.
It wasn't until after I left there I realized how incredibly myopic and arrogant these people really were. This was one of many lessons I had to learn. There is no one way to do anything in development. Sure there are certain things you should and shouldn't do - but one way to do everything? Hardly.
After I left said company I really gained more respect for how people write and maintain code. As such, I now just keep my eyes and ears open for best practices. Unless it's going to be constructive, I never hack on anybody else's code. I know the feeling of thinking you've done something wrong. When in fact, it might just be a different approach to reach the same conclusion.
https://github.com/pjungwir/range
[0] "What is your dumbest project on Github?": https://news.ycombinator.com/item?id=5112546
It's very useful, but basically impossible to discover except by happening to see somebody else use it. So I really don't wonder that somebody would end up unknowingly reimplementing it.
Quite an arrogant evaluation criterion IMHO.
On the otherhand I think this is stating to reveal the less than stellar aspect of open community based/social projects. Not everyone agrees with you, and/or has the same opinions as you. Also, its not all free love and drugs as it was promoted to be.
This basically means that he could have been one of the guys who called out the badness of the replace code and just took the opportunity to get some attention by posting about a hot topic.
Half of you included, look at the ridiculous shit you say, and how much more offensive you are than anything anyone originally said.
Also this is great for a laugh: http://dl.dropbox.com/u/116385/Slingshot/Pictures/Screen%20S...
Oh, you missed the tweet, in the screenshot, where he wishes you get cancer and that he calls you a cunt :)
The more general issue is that Internet has become a place of competition and EXTREME negativity, just read any article on Hacker News if you need convincing. Some dude will spend months or years working on some shit, only to be greeted with cheers and claps like "wow, that sucks", "How is that useful?", "Your code is bad and you should feel bad", "LOL, you handled security like my 2-year old handles the TV remote". So no, it's not even a problem of calling out code when it's bad, it's just a simple matter of recognizing that those people you so hastily call out are in fact human beings. And NO ONE likes to be humiliated.
Criticism is the highest aspiration of non-fiction writers. Zinsser says so in On Writing Well so it must be true. Even if it's not, what he says about most people sucking at it, certainly is. Negative criticism is easy, positive criticism isn't. Lead with an insult, and the internet pays attention. But it is hard work to criticize something productively - to point out the value and the areas for improvement. Writing a lead for that criticism is even harder.
Most people, including myself, are not in the habit of spending the time to do it right. The article takes the time to get it right. It does so by looking at why Heather did what she did. It compares what she did to the common alternatives. The author tells what he did when faced with similar situations. That's what makes it good criticism.
https://github.com/harthur/replace/blob/master/replace.js#L4...
It relies on the fact that you can provide javascripts String#replace a "replace function" (1). The author just evals the contents of a command line provided file into a variable called `replaceFunc`.
Beside that, there's not a lot that can be pointed out as "bad", at least by just reading it lightly (5-10 mins).
[1] https://developer.mozilla.org/en-US/docs/JavaScript/Referenc...
What would you do in this case?
There is only 2 people who can call out said code.
They are: 1) Their Employer. Then you can ask them to refactor the code. 2) Them.
Additionally, your mother was right. If you don't have anything nice to say you shouldn't say anything at all.
Just because you were born on this planet and survived past birth; does not give you the right or the excuse to harm another person or cause harm to said person's "Value of Life".
- BSD utilities do not accept any -options after filenames, GNU utilities do.
- The situation is reversed for BSD find. It insists on accepting a directory name as the first parameter.
- BSD sed doesn't support the -i option in the same way as GNU sed does.
- Even different versions of GNU utilities are not necessarily compatible. A few years ago I ran into compatibility problems with 'head', 'tail' and even 'free' across different Linux distros. I can't remember the exact issues though.
So I agree with the grandparent, Node and Python are a lot more portable than shell scripts.
I generally just wrap things in checks for $OSTYPE and Perl when I'm not working with the system itself.
http://www.gnu.org/software/autoconf//manual/autoconf-2.69/h...
Can you elaborate on this?
A lot of the Unix tools (including SED) run just fine on Windows without cygwin:
I suspect they would be easier to install than node.