Sep 18 2013

The repetitive programmer

Category: TechnicalIuliana @ 12:36

You know who you are. I know who you are. And I hate you. And I despise you. Every time I have to  work with your code my brain keeps screaming WHY? WHY?WHYYYYYYY?  and I begin to think you are retarded. Or maybe just not retarded, but maybe you learned to program on another planet, because no programmer from this Earth, not even a mediocre one would write code like you do and also be paid for it. I would not pay you for it, I would send you do dig holes or clean shit pipes or something that does not imply any brain power whatsoever. Because you have none!

Sample:

// [bla bla  bla - code that I won't put here]
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
try {
	Document document = new Document(PageSize.A4);
	PdfWriter writer = PdfWriter.getInstance(document, bos);
        // [bla bla  bla - code that I won't put here]
	if (document != null) {
	    document.close();
	}
	if (writer != null) {
	    writer.close();
	}
        // [bla bla  bla - code that I won't put here]
        OutputStream outputStream = new FileOutputStream(attachmentURL);
	bos.writeTo(outputStream);
        // You might notice that the outputStream was not closed
} catch (MailException e) {
        if (log.isWarnEnabled()) {
                log.warn("Cannot send email for something " + something.getId(), e);
	}
	sendAdminMessage("Error sending email message to user", "Cannot send email for something nr "
			+ something.getId() + ". Message is = " + e.getMessage());
			return false;
} catch (MessagingException e) {
	if (log.isWarnEnabled()) {
		log.warn("Cannot send email of something " + something.getId(), e);
	}
	sendAdminMessage("Error sending email message to user", "Cannot send email for something nr "
			+ something.getId() + ". Message is = " + e.getMessage());
			return false;
} catch (IllegalArgumentException e) {
	if (log.isWarnEnabled()) {
		log.warn("Cannot send email ofsomething " + expressOrder.getId(), e);
	}
	sendAdminMessage("Error sending email message to user", "Cannot send email for something nr "
			+ something.getId() + ". Message is = " + e.getMessage());
			return false;
} catch (MalformedURLException e) {
	if (log.isWarnEnabled()) {
		log.warn("Cannot send email of express order " + something.getId(), e);
	}
	sendAdminMessage("Error sending email message to user", "Cannot send email for something nr "
			+ something.getId() + ". Message is = " + e.getMessage());
			return false;
} catch (IOException e) {
	if (log.isWarnEnabled()) {
		log.warn("Cannot send email of something " + something.getId(), e);
	}
	sendAdminMessage("Error sending email message to user", "Cannot send email for something nr "
			+ something.getId() + ". Message is = " + e.getMessage());
			return false;
} catch (DocumentException e) {
	if (log.isWarnEnabled()) {
		log.warn("Cannot send email of something " + something.getId(), e);
	}
	sendAdminMessage("Error sending email message to user", "Cannot send email for something nr "
			+ something.getId() + ". Message is = " + e.getMessage());
			return false;
}

So, 7 catch-es, for seven types of exceptions, we do the same thing for every type of exception, write the same code, because it looks good in the SVN if somebody looks, he will see that you wrote a lot of code. A lot of crap more like it. And why the hell do you not make sure all your streams are closed??
The person who wrote this code is payed a few thousand euros to write code like this. Yeah, I guess the recruitment department sucked ass when this person was hired.

So yeah, if you write code like this, quit programming now and look for another job. You clearly are not made for this and you are a despicable person.

Tags: ,

3 Responses to “The repetitive programmer”

  1. bu7ch3r says:

    asta-i indian sigur sigur!

  2. Iuliana says:

    Mă crezi dacă îți spun că e rus?

Leave a Reply