Showing posts with label rant. Show all posts
Showing posts with label rant. Show all posts

Jan 7, 2015

Premature optimization is not evil

Or rather people should stop saying this because most of the people that say it don't actually seem to actually know what is meant by "Premature Optimization" or how to determine when it is evil. I've heard people say premature optimization is evil to asking. "Is there a 3rd party library that does this more efficiently?" (knowing if there are better options is premature optimization?), "Thinking about architecting your app for horizontal scalability is premature optimization" (it is if the design is significantly more complex, but if it's just between using REST and ensuring stateless (which is about the same complexity up front, but it'd be harder to convert later)), "wanting to do Dependency Injection is..", "making that code easier to read and simpler and thus faster", and on and on. On the other hand, no one seems to think that requiring Redis, Mongodb, and NodeJS because it's webscale is premature optimization, even if the clustering is horribly convoluted and you end up in callback hell (not saying you are, just saying). Basically, you're not asking to do the thing that everyone else is doing, is premature optimization.

So let's talk about what the hell premature optimization is. Premature spending a week making sure you can spin up infinite instances on AWS because someday you might get slashdotted. Premature optimization is writing a method in a less than clear manner because you think it's faster. Premature optimization is rewriting String.format to StringBuilder because StringBuilder is faster. Premature optimization is any time that you write code that is less readable for the sake of performance, or spend an inordinate amount of time ensuring optimizing it without benchmarking to see if it's slow.

I've spent a significant amount of time in the past few months working on optimizing code, why? because no one ever thought about optimization, it never occurred to the author, in one case, that querying the same data from a database that had been previously queried, in a loop, outside of a transaction, was inefficient. It never occurred to the author that not refetching from the database to do an on screen sort every time you sort would be inefficient. Why think about what you're writing? because premature optimization is evil, or at least that's what I'd be told.

Here's are examples of premature optimization that are not evil. I choose to use EnumMap when I'm storing Enum's in a Map, I presume it's more efficient, so I do it, increase in code? a class name to the constructor. StringBuilder is faster than StringBuffer, so when I come across StringBuffer I convert it, increase in code, none. I use dependency injection to wire stateless (or unchanging state) singletons so I'm not constantly creating instances, code increase is use of a DI framework. I use onClick handlers to ensure that things happen lazily, only when needed.

Basically what I'm saying is that "Premature optimization is evil" is sadly used anytime when anyone is even thinking about anything that could remotely be considered optimization. I personally optimize my code for paradigmn/pattern matching the problem first (which leads to 2 and 3), readability second, performance last. Making smarter decisions about how to write your code is not premature optimization.

I think the real "evil" is encouraging people not to think about performance, or to further understand their craft.

Jun 19, 2010

please don't use Dist::Zilla::PluginBundle::USERNAME

or create them. Here's the problem.... (short version is Don't put PodSpellingTests in them)
normally you'd have
[pluginA]
[pluginB]
[pluginC]
[pluginXTests]
[pluginYTests]
[pluginZTests]


and one of them doesn't work on your system (for whatever reason), well you can just do this.
[pluginA]
[pluginB]
[pluginC]
;[pluginXTests]
[pluginYTests]
[pluginZTests]


the ; is a comment in ini, now dzil won't use that plugin. But people will say well you don't want to do that of course I want that plugin enabled. Here's why you may not temporarily. Casual user X has a bug in /your/ module that's using dzil, they code up a patch, and they want to run your test suite. The can't, because [pluginXTests] won't even install properly on their system due to a non perl dependency. They could have just commented it out, but now because you've used this PluginBundle it become difficult. They can't just comment it out.

They might be able to
[@Filter]
-bundle = @USERNAME
-remove = pluginXTests

IF they can get your bundle installed in the first place. This requires them find a way to install your Bundle without installing said broken module.

as I stated at the top my problem is with [PodSpellingTests] it itself isn't broken, but it's dependency Test::Spelling is on some systems, due to the lack of a 'spell' command.

Yes I know there's a workaround... I could just copy a shell script into my path that makes aspell or something work, but really that's not the right solution. No I'm not packaging GNU Spell for my system either, the other spell programs work much better (from what I've read).

Also I find modules with your own username in them to be fairly obnoxious.

If you'd like less code, can't we start making a few more generic Bundle's? I wouldn't minde seeing a Bundle for Tests, and maybe another one for other stuff. I think 1/3 of the lines in my dist.ini's are tests.

May 9, 2010

Documentation! it should be TDDD

UPDATE: I shouldn't have said what I said about RJBS and have apologized publicly

Test Driven Development should be Test and Documentation Driven Development. I don't want to read your code to figure out how to use it. I don't really care if you write the Test, documentation, or the feature first. But you should do all three before moving on to the next one.

I'm gonna pick on Dist::Zilla this seems like a very good tool. Except it's documentation is so sub par it's not funny. The new documentation is quite good, although, I have not decided that I like the 'choose your own adventure' format. However none of the documentation on CPAN is good. It ranges from significantly less than the new tutorial, to virtually non-existant, to completely inaccurate.

You know what? It's not acceptable not to write documentation, especially not when you were apparently paid to do it and have shown that you are capable of doing it. Some people I've talked to think not documenting things is ok. I don't think it is, and it's yet another one of my unpopular opinions. Sure you can not document them... If someone else has volunteered and is actually doing it.

Yet maybe this is one of the reasons perl has fallen by the wayside. Documentation is usually either cryptic, incomplete, or inaccurate. Even the core docs like perlintro has inaccurate and potentially damaging information. Why are we so surprised that so many people don't know how to program perl in a modern way if the documentation is so bad?

Documentation should explain who, what, when, where, why and how. Who should use this module, what they should use it for, when they should (and shouldn't) use it, where they should use it, why they should use it, and how to use it. Unfortunately most documentation fails at all but the how, and the what. Who is an Abstract, and Description thing, you should consider who doesn't need it. Why why can be tightly related to who, but really I want to know why this module and not another, consider who needs a templating engine vs why it should (or shouldn't) be HTML::Zoom. When is also closely related to the previous 2 and will probably be answered with them, although consider when to use a for loop vs when to use a while. Where could be anywhere from top of file, to your view in a catalyst program. How is obviously the actual code and should be covered in the synopsis. Sometimes you'll have to think if you've answered all these, but if you manage to answer them all in a comprehensive and complete manner then you're documentation is probably good enough to be useful.

I don't expect people to be perfect in this, but some effort is better than none. Also if you write documentation, you may end up answering less questions, and save people many hours finagling a problem.

I'm sure even my modules fail to meet my own standards.

The best documentation I've seen is PostgreSQL's and Gentoo's.

UPDATE:
perlintro was fixed in 5.12.1

May 5, 2010

Don't Say "Patches Welcome"

Don't say "patches welcome" it does more harm to your community than good. Why? It's a polite way of saying "I don't care. Fuck you. Fix it yourself. End of discussion".

1.) Not a Developer

The person you are saying this to is not developer. They don't know how to do it. PERIOD. At this point you are refusing to help them. This person may now have the opinion that your community isn't helpful. Don't ever for any reason assume someone is a developer, assume they are not. I would wager only 1 person in 10,000 is a developer.

I was once told that I should be able to fix a bug in git (msysgit technically) because git is a developer tool. At that time I couldn't code at all but was using git to store homework or something...

2.) Novice Developer

Some how you know the person can code through some method other than assumption. They aren't as smart as you are, there code is so amateurish that it wouldn't be worthy of inclusion, even if they could figure out how to fix the problem. They can't get that far, they've no idea where to begin. You're probably just frustrating them instead of helping the problem. All people that you know are developers fall into this category (unless they fall into the next), either be willing to help this person patch your code or just give them the real reason (e.g. I've no interest in this problem) for not helping. These people know they could be helping, they may even want to be helping, but you telling them that they could be is not helping. They need guidance, not an invitation.

3.) Doesn't Care

So the person doesn't fall into any of the 2 above categories. Guess what? they don't care about it enough. They don't need you to tell them "patches welcome", they know what open source is. They know they could send you a patch, and that you might accept it. They know all that, but there's some reason they don't want to. You aren't telling them anything they don't know. Again just tell them the truth of why you don't want to work on it. Maybe ask them why they don't. Maybe it's a silly little barrier that you can help with. But only bring that up if you know they are competent enough to do it.

Just Stop

Just stop, after years of hearing this when I couldn't do it. All I hear is "fuck you I don't want to take the time to help you". Why would I want to help if that's what I hear? Don't tell me it's not what you mean. Because I've had that said directly.

Stop acting as though everyone can or should write you a patch. Most of you don't agree that you have a responsibility to the free software you create. No one else has a responsibility to contribute to the software. They aren't leeching if they don't give back, you gave it away. Don't ask them to, don't tell them to. They don't want to hear it anymore than you want to fix their problem. Definitely do NOT "volunteer them" to get something done, that's just plain rude.

Pretty much everyone you've ever told this too already knew that patches were welcome, so there's some other reason they weren't writing one.

Exception: If someone asks you if you mind if they work on your code. You can of course answer them "patches welcome" this is because they asked, as opposed to you volunteering that info.

Mar 30, 2010

Unpaid volunteer work is a job

So the common misconception in the open source community is, "I don't get paid, I don't have to do it". Actually, it's not a misconception, you're absolutely right, you don't have to, you can stop, leave, go away. It's also well know that FOSS software is without warranty or guaranteed support. But by the vary nature of being a volunteer you are offering to do a job for free. No? have you tried working for a volunteer organization and telling your boss there "I don't have to do it because I'm not paid". I highly suspect this attitude will get you a 'then we don't need you'. I also suspect if you're say, working a food drive, and someone asks you something and you say "I'm not paid to explain it to you" what do you think that would look like? Basically when you volunteer to do something you're volunteering to do a job. If you are unwilling to perform all parts of that job should you be there?

With open source software you're volunteering to support the entire software life cycle. This means design, development, documentation, and maintenance. Most open source developers love doing the first two, but abhor the last. It's a job, some parts of it suck, if you can't be bothered to document your stuff or find someone who will, don't show up. You know what else? you're not perfect so people are going to have problems, it's your job to support them as part of your 'best effort' support. Best effort support doesn't mean bitching when someone asks you to improve something. If you reason for saying no is, "I'm a volunteer so I don't have to" come up with a better reason, there are better reasons.

If you tell people, hey I'm really swamped at the day job, they'll probably understand if this is something more than a 2 line of code fix. My wife is ill, just recently on ironman one of the dev's (sorry I'm not looking it up and I don't remember the name, condolences all the same) is taking a leave of absence due to his wife having cancer, we get that. I'm on vacation, no computer access right now. All this stuff is saying is, "now is not a good time for me", and that's ok. But saying using "I'm a volunteer" ever is not acceptable. This gives FOSS software the ugly taste that some people complain about.

Before anyone else calls me an "entitled piece of shit" (yes a FOSS developer said that to me today after calling me a "fucking asshole" for filing a bug that he didn't understand what I'd said ). I'm sorry? I just wrote a patch to help fix this problem elsewhere, is my asking you to fix your own a problem? I maintain 250+ packages in the Arch User Repository, including yours. I help people use your software, and I'm not the first one to complain. How does me telling you I'm having difficulty with your software and asking you to fix it make me entitled? do you take no pride in your work? seriously, if your responses are going to be no patch from you know fix, and fuck you because I didn't understand what you were saying... I'd rather you deleted your modules and went away.

I had a project that I didn't want to take the time for anymore, and no one was helping, but I was getting bug requests. So after asking for help, I put sign up that said, "project is dead because I couldn't do it by myself", or some such. I ceased work, and left the code up. This isn't wrong because at some point everyone moves on. You don't have to maintain your work, but you should at least let the world know that not maintaining it is your intent, and that you've quit. 150-200 of the modules I maintain on AUR were from someone who went from Arch to OS X and is no longer around, and although it took him longer than it should have, IMO. He did eventually say, "I'm not doing this anymore, relinquishing control", essentially, which was acceptable and I took over.

I couldn't always do what I could now, but wonderful communities like Gentoo, and Postgres have made me a better person, now to where I contribute where I can. I'd also like to note that Linus (and others?) have, and do, turn down patches and remove kernel code if the developers are unwilling to maintain, and support them, I endorse support concept.

You may disagree if you'd like, but this is my opinion. Just let me know if you feel this way before I do something for you so I don't waste my time. I don't want to do your job for you, and I did not volunteer to do your job.

I'm going to cover the horrible response that equates to "fix it yourself" in another post.

Mar 25, 2010

Perl Blogger annoyances

So I love Iron Man and people who blog perl. But I've got some complaints.

1.) No Language Specific Feeds. I'm not discriminating against people of foreign languages I want a Russian only feed as much as an English only. I just can't read it, and I'd rather not have it in my feed. So I'm using Dagolden's English only Feed. This feed doesn't work 100% right however, see next

2.) Dagolden's feed apparently hate's blogger. I always see posts that come from blogger's atom feed full of html tags instead of formatting so I have to view the original source instead of just reading in my feed reader. This doesn't happen with my refeeded feedburner source that I've given to ironman.

3.) I can't always Comment on good Blogger's stuff. I'm gonna pic on 2 that I like: Modern Perl by chromatic, and Matt S Trout's Blog. The former is run on Movable Type and I can't comment because it's OpenID implementation won't accept google or blogger's OpenID, it causes an error for both (yes I can auth with blogger and google in other places such as StackOverflow), it also doesn't accept anonymous comments. In MST's case, he's just never gotten around to implementing comments.

4.) Spam, about 1 in every 20 posts (numbers pooma) is nothing but spam. It contains nothing but a list of ... tags or something... Clearly contains no actual content.

This is just a rant... feel free to ignore. But maybe someone will look at it and say... oh I didn't know that was happening... I can fix that.

Bad Customer Service from T-Mobile

So about 2 months ago I got fed up with Sprint (they suck for different reasons) and I already knew that they had better service coverage than Verizon in my area. My friend suggested T-Mobile, so I went and got setup with them for a 14 day trial period. I took the phone made some calls tried the web browser, I didn't like the blackberry itself, but that's besides the point. When I got the phone home, no service, not even outside the house, making T-Mobile worse than Verizon. I didn't want to run 10 miles into town that day, the next day we had a blizzard, so wednesday, two days later I took it back. They charged back everything and everything seemed good. Until a few weeks later when I got a $10 bill for usage. I just finally got around to dealing with customer service today. They say it's accurate, and no they can't do anything. So basically as an FYI to anyone else, don't try T-Mobile unless you already know that their service will work for you because they are going to charge you anyways. This shouldn't be, your service doesn't work for me, you shouldn't charge me to tell you that. Now if I move I probably won't look at them for a service change, had they handled this in an amicable manner I probably would have as soon as there network wasn't an issue. I'm also going to tell anyone who asks about cell provider's about it. Yes $10 isn't much, but it's the principle of me having to pay them anything after I had made it clear I wasn't sure it would work and I just wanted to see if it was an option.

Mar 10, 2010

You should have hired me! ( just a vent )

So this is about the 10th time my friend has asked me for help on a SQL (w/ SQL Server) problem. I Actually interviewed with his company at one point and they elected NOT to hire me. Why? because I have never found windows errors useful, have therefore never used its logging facility, and was unable to answer questions about it. I'm was a UNIX guy then and am now. But I'm still better at figuring out problems on software I've never even used, with only about 1/10th of the information that I need. I'm so tired of fixing other people's problems and not getting paid for it, especially when somehow they profit from it.

So why don't companies seem to hire me? Because I suck at interviews. Because I don't have that 4 year degree and someone else does. Because I don't have 2 years of experience with Technology X. Because I've not got the greatest work history.

Why don't I have the greatest work history? Well I've been fired twice. Once the official reason was I fell asleep at work, I don't think I did. Even if I did I had, had insomnia for 3 days, I even told them that. I'm pretty sure I could have sued for wrongful termination, but I didn't. The other time I was hired into a position that I really just wasn't a good match for, but I didn't realize it until later. That position also didn't have enough work for me, and the work that it did have wasn't well enough explained for me to do.

Wait so I have to explain to you how to do something? no... but when you tell me to make a form with this list, and copy this pre-existng product with new tech. Then those 2 definitions conflict. So I try to do work to make what you want and then you say but I don't want those fields... I say but this can't be made to work like that without them... I never really got answers... Can't do work that I'm not given enough info to do properly, and I wasn't privy to the meetings with the clients.

I'd also like to note that I almost quit the second job as I had been given less than 5 hours a week for 3 months, and my boss, although a good hacker, wasn't a very good boss. But I'm not completely absent of blame... maybe I misrepresented my knowledge of the product, or maybe I should have done more to get the information I needed to do the work.

Well maybe my luck will change and this company I've been interviewing with recently will hire me so the next time my friend asks me for help to do his job I can say. You know your company could hire mine and the work would get done faster (better too probably).

Dec 12, 2008

Download Book, The Ruining of a Good Feature

1-3 Months ago Safari Books finally started allowing you to download full books in pdf. It used to be that you had to download chapters of books in pdf. This was annoying even if you had tokens to do it. Tokens are Safari Books way of making sure we aren't pirating en masse, you get 5 tokens a month and can only keep 3 months worth. So now we can download full books how nice? right?

Well it would be except the only books you can download without buying more tokens are pocket references, those cost 6 tokens, so over 1 months worth. Most books are 16 tokens and I think I saw an 18 token one. I'm sorry but this is just GREEDY, I currently pay $439.99 a year for this service, isn't that enough for me to be able to download 4 books a year?

I probably wouldn't be complaining about this if they allowed you to keep all unspent tokens, I have about 2 years worth now. I actually asked for that.


We would like to inform you that according to Safari terms of service, we will not be able to reinstate the unused tokens.


No, of course not, and I knew that when I asked, but it didn't hurt to ask, or point out that I've used virtually no tokens over 2 years of subscription.

Well O'reilly since I find that this is just pure greed, I won't be renewing my subscription.

Maybe I'm wrong? you know to think that I shouldn't have to pay extra to download a few normal books? what do you think?

Apr 1, 2008

Perl by Example not on O'Reilly's Safari

I like Safari. It's a great product that I pay ~$500 a year for. I just started a Perl class and the book is Perl by Example. Guess what it isn't on safari or at least searching for the exact title doesn't find it. I've queried the O'reilly and Prentice Hall people. I pay $500 a year, all the rest of the 'By Example' Books are there, I want my book.

EDIT: O'Reilly's response

Thank you for contacting us about this.

Please note that the books available on Safari Books Online are added to the service at the exclusive discretion of the individual publishers by their internal online content teams and according to their internal guidelines and procedures.

Hence I have forwarded your title request to the respective online content team for consideration. Also please note that due to various resource restraints, our participating publishers may not be able to make all titles available on Safari.

If you have any other questions, please reply to this email. We will be glad to help you in this regard.

EDIT: It's been a couple of weeks and the teacher has given an assignment from the book. The book is still not of safari. I will have to buy it, it seems.

EDIT: It's out now Perl by Example, 4th Editon


Ah typical as usual some company has made my life harder even though I'm paying them to make it easier, given I understand the reason. But I don't have to like it.

Feb 20, 2008

Participation Points

At Baker College they don't allow teachers to grade based on attendance. I'm sure this policy is common with most schools. So what do the teacher's do? they grade based on participation. This is crap as to be able to participate you must attend the class. What the teacher's are actually doing is re-labeling attendance points as participation. Because it doesn't matter whether you take part in a class conversation. All you have to do is show up.

I'm sorry but I feel this is wrong. I've had to miss one class twice due to bad weather. I refuse to drive what is normally a 45 Minute drive in white out conditions with a layer of snow on the road. My instructor is going to let me make up more than 1 quiz (the school only allows 1 normally) and I emailed my homework, but I'm still screwed out of attendance points, I mean 'participation' points.

Just so everyone knows, I'm going to a university in the fall.

Feb 15, 2008

Modern Bigotry - Black History Month

First off, I'm not racist, I'd like to think I'm not bigoted in any way.

But I'm tired of all these equality rants from blacks and females.

WE WERE SLAVES. So? so what? every race under the sun has had slaves and been enslaved at some point during the history of humans. Why are you special?

Why don't we have a white history month? A Jewish history month? A Latino history month? etc, etc. Seriously? why are blacks special? what makes them so abused that they get special recognition.

Today I saw an article in the LSJ (http://www.lsj.com/ will find specific link later) That talked about how hard blacks were getting hit by the mortgage crisis. I thought "oh and the rest of us aren't?".

You know what blacks and women are as about as equal as they are going to get. Don't believe me? look at the presidential race. Actually in some cases non-white males have additional advantages.

The only group right now that can really, really claim prejudice are the gays.

We need to stop things that promote people of gender, race, religion, or sexual orientation, and start promoting equality. We will never be equal as long as people say that we are not, and continue to promote that we are not equal and that they should have some advantage other than there own personal merit.