Friday, October 27. 2006Programming TheoremsComments
Display comments as
(Linear | Threaded)
>For every 1.6 billion dollar buy out, there are 1.6 million start-ups in garages digging their own websites.
LOL.
Wait, that's like $1,000 per pathetic garage-up. If I through enough latvian chinese argentines at the problem for $6.78/day, I'm sure it will pay off.
Excuse me, I'm from Latvia. 6.78x20 = $135/month. That's like a phone bill here. Good luck finding someone for that pay
Yeah I'm from Argentina and a developer income starts from $10 up, that's $80-100 per day.
He's probably American, all the countries are third world to them. Also, this comment is worse than his.
I like it! Particularly the Perl thing, it's so true ... which is a good thing because the alternatives are things like BASH and I'm no fan of shell scripting!
I don't like Python, I like my whitespace to be meaningless
The problem with Perl is, most non-whitespace parts look meaningless to other people or the coder after 5 days.
Only if it's badly written. Perl can be as obtuse or as obvious as you want.
Which is entirely the problem.
Don't like ugly Perl code?
Don't write ugly Perl code.
If only I could go back in time and tell this to the people who have left me with ugly perl code. That leads me to another one:
The Ugly Perl Code Paradox: The probability that any comment about having to deal with ugly Perl code is responded to with the phrase: "don't write ugly perl code" is approximately 100% for fresh code, 80% for existing code, and 75% for existing code that you did not write.
Java: Write once, debug anywhere
Perl: Write once.
....yes because every routine you write in perl would work the same on every machine.....because all versions of perl are the same, and all file structures and permissions are the same on every system
I'm not a pythonista, but I have written a bit of it. I was concerned about the whitespace, too, at first, but after using it for just a few days I found that it wasn't a problem at all. It didn't trip me up and only rarely annoyed.
So if significant whitespace is the only barrier to investigating Python, I'd highly encourage you to reconsider.
Ever tried Haskell's "layout" style? It's the most infuriating thing ever. At least Python doesn't care what my tab stop is set to. Haskell will blow a nut unless it's set to 8 (or you get freaky with the space bar).
Hmm. I've never had a problem with Haskell layout. Maybe I'm doing it wrong, or maybe I just set my text editor to not use tabs. Either way, it works easily for me.
Use "et" mode in vim. or any other decent editor.
I was cleaning up some PHP today, when it occurred to me how much I love significant whitespace. I had to go line by line and tab out every block of code so I could see all the nested if/else statements.
Sure, its nice to end a block with braces, but they don't help you see the code, they're just another piece of punctuation to screw up. With python you can easily see where each block begins and ends, and that means that means you are one step closer to understanding what someone else has written. It's very important, and it helps you write better code, even in languages where whitespace isn't significant.
The single biggest thing you can do for your productivity is to switch to an editor with proper syntax highlighting and autoindentation.
And a matching-curly-brace feature.
...which won't work with Python.
You can do this with most languages, it just in those very same languages you're not forced to, allow one to choose the most appropriate spacing to present the code in the most readable style possible (or in a random style as seems to be the trend with many developers). This is very useful for unavoidably long lines or to tabulate similiar lines, such as when 'chop' formatting long method parameter lists. I assume this is not possible in Python?
Agree strongly.
Python makes you indent your code THE WAY YOU OUGHT TO INDENT IT ANYWAY.
The probability that a mention of Python will spark a debate about Python's significant whitespace is 1.
I need to point out the stupidity of the C++ tokenizer, where a template declaration like "class MyTemplate" has a mandatory whitespace. OMG, C++ sucks. That's why real pedants code in C.
Um, it's only whitespace. Does air bother you in they same way? Wouldn't you rather your breathing was meaningless?
Seriously though, you should be using whitespace anyway. Python merely enforces the obvious.
Name one language that has the feature in which whitespace is meaningless. Perl? no. Java? no. C? No.
Don't believe me? Go write a program (if you can!!) get it to run (if you can!) then go insert a space between every non-space character. Run it now. "I like whitespace to be meaningless" is the cry of the idiot. Congratulations!
re "whitespace meaningless"...
What that phrase usually means is that between any two tokens of the language, any number of whitespace characters is allowed. An identifier, for example, is a token, so there is no implication that you can insert whitespace inside an identifier.
Fashion Jewellery Online Store.Wholesale and Retail.www.aypearl.com - Wholesaler of fashion handmade jewellery, beaded jewelry.thousands of fine-quality jewelry with exacting wholesale prices,all the world can enjoy best service from us.
The probability that any blog article left more than a few days receives spam is one
The probability of any mention of Perl bring about a comment on Python is 1.
>Every 5 minutes you spend writing
>code in a new language is more useful >than 5 hours reading blog posts about >how great the language is. so true!
> Every 5 minutes you spend writing code in a new
> language is more useful than 5 hours reading > blog posts about how great the language is. That's good, but I like this, too: Every five minutes you spend writing code in a new language is more useful than five hours writing blog posts about how great the language is.
Actually, writing blog posts can be really useful when learning a language, depending on how you do it.
If you just do a lot of handwaving and bullet points, yeah, it's useless. But if you actually post code, normally you have to clean it up and check it carefully (especially in a language you're just learning). You possibly even think of other code to write that would make your post more complete. If you're just fiddling around with coding in a language, turning it into something you can publish for others to read is like a release cycle, and it can add discipline to your coding. Of course, your mileage may vary.
Every 5 minutes that you DON'T have to spend learning a new language allows you go be really productive in the language you already know. I LOVE writing web databases in Visual Foxpro since 1996.
CSV: oh yeah! ... and if you're not careful you end up starting your own company based on the CSV parser you built!
Esoteric Languages:
Every 30 lines of code you write in an obscure language reduces your average co-worker's ability to understand any code you write in any language by 0.5%.
If only, Adam , if only.
I think 30 lines of Haskell/Scheme / Lisp/ Arc /Erlang would reduce my colleagues ability to understand the code by about 70%. Thankfully I don't write in any of those languages. Des
In any language.
Your .net and Java code begin to on the features of your favorite non-mainstream language. Once you know they exist, you can't help but use them. "Why did you use recursion?"
>Your .net and Java code begin to on >the features of your favorite non->mainstream language.
>"Why did you use recursion?" Adam makes a good point here... all of a sudden noone can understand your C# unless they go and learn lisp first...
Recursion? Sheez. Recursion is so...basic.
Don't get me wrong, I only started using it much about half a year ago. And yes, it was because I spent some time working through Structure and Interpretation of Computer Programs (which uses Scheme). But it's not the Scheme language, it's the core C.S. principles, and recursion is where the book starts. Once I started using it, a lot of my more-complicated programs got a lot simpler and shorter. If somebody can't wrap their head around recursion, they need to get up to speed, far as I'm concerned. I've got a lot more I still have to get up to speed on myself. But if a colleague makes good use of closures or monads and it makes his program more elegant, well doggone it, I'm gonna dig into his code and learn his techniques so my programs can be better too. I have no patience for people who complain that other people's code is too advanced for them. How bout we learn from each other, instead of trying to code to a least-common denominator.
Why do people assume that one must learn a functional programming language to understand the concept of recursion? It's simple if you view it as a reduction and combination (split the task, solve the smaller tasks, join them together) instead of trying to keep track of every variable's value in every call, yet I've met many programmers who try to do exactly that!
To me, there's little excuse for a programmer not knowing how to use and recognize it, and none at all for refusing to learn it.
Ever heard of the SAS Macro language (www.sas.com)?
That one is really an "obscure language" (in all its acceptances)
Dead on. I've gotten into the habit of using function objects to emulate closures in C++, and all the people who I work with just look at me funny for coding stuff like that.
For every XML interface using DTD there will be at least a colleague trying to DDT you..
"For every 1.6 billion dollar buy out, there are 1.6 million start-ups in garages digging their own websites"
LOOOOOOOOL Now that's sadly true. It's like when monkeys touch themselves coz they can't find other ones to do it for 'em
>The likelihood of Perl being involved
>in a system is directly proportional >to the length of time the system has >been in maintenance. That would make the total probability infinite. :p
> For every Architecture Astronaut out there,
> there is at least one coder who thinks that > being "Agile" is a perfect substitute for foresight. That would be an Architecture Gibbon, then.
"Some people, when confronted with a problem, think 'I know, I'll use regular expressions.' Now they have two problems." -- Jamie Zawinski
> "Some people, when confronted with a > problem, think 'I know, I'll use regular > expressions.' Now they have two problems." > -- Jamie Zawinski
Only for those who don't know regular expression syntax To paraphrase Isaac Asimov, if knowledge got us into trouble, it is not through lack of knowledge that we can get out of it....
The Macro Paradox:
Imaginative thinking is the best way out of a hole. The biggest holes are dug with imaginative thinking.
The Macro Paradox 2:
Macros are written to express programs for a project in a more comprehensible way than the vanilla language alone. Code using macros is less comprehensible than the vanilla language to programmers outside the project.
As time progresses, an Enterprise integration project will eventually use all databases known to man.
In final stages, that includes doing payroll and airline schedule in Access Macros.
These aren't original, but I love them anyhow:
"Profanity is the one language all programmers know best." "If it is useless, it will have to be documented. If it is useful, it will have to be maintained." "If we built our buildings the same way we build our software, the first woodpecker to come along would destroy civilization."
Learning programming languages:
LOL i think i was doing that for quite a while
blood spilled in the conscript is blood saved in the war of development
"If you don't gosub a program loop you'll never get a subroutine."
from Red Dwarf. Also works as a life theorem.
Most of these theorems are easily recognizable from elsewhere, but only one of them (Fitt's Law) has any kind of attribution at all---hardly "a list of rules [you]'ve come up with lately." Shameful.
It's always the anonymous folk who act like dicks.
Where exactly was my material easily recognised from? Probably a page that has ripped off the contents of this page. I have accredited the only rule that seemed to previously exist, and even then my statement of it is unique. So in short, shut up you absolute tool.
"For every 1.6 billion dollar buy out, there are 1.6 million start-ups in garages digging their own websites"
LOOL.. right!
I have read most of "your" experiences elsewhere... When you use other peoples quotes, please refer to the source.
Hi Mike,
Unless you have a source that you think I copied, please shut up. If you think it will help, google for any of the above quotes, and see what comes up (hint: you'll get links to here, and people quoting me).
I also have seen just about all of these in other places - without attribution. I can certainly say that I've seen most of them without ever coming to this page before.
"Every 5 minutes you spend writing code in a new language is more useful than 5 hours reading blog posts about how great the language is." This one is a bit over the top, but has truth in it. If you are reading bad blog entries, it's true, but if you are reading about Erlang from Joe Armstrong, however, that's a different story.
"I also have seen just about all of these in other places - without attribution. I can certainly say that I've seen most of them without ever coming to this page before."
Donald, I wrote these, on October 27th 2006. They are not plagiarised from anywhere. I wrote them. IF YOU WANT TO ACCUSE ME OF PLAGIARISM, PLEASE SUPPLY A SOURCE THAT I PLAGIARISED You may well be thinking you read all these 6 months ago, but that makes sense, I WROTE THEM MONTHS AGO.
>I have read most of "your" experiences
this is very odd... what is mike's problem? Des is an original and creative writer -- so it's pretty foul to accuse him of plagiarism. Not often you see rude trolling like this on a blog -- it usually belongs on a forum. best of luck to you Des.
Indeed. Credit where credit is due. If anyone doubt's Des' abilities as an original author they should have a read of the other articles on this blog. If anyone wants to go further and actually make accusations they really should at least back up their accusations with the source from which Des is supposed to have plagerised these things.
But.. But... But...
"Error: Unknown Error" How can you have an error and don't know what it is? AAAWW Man, this is really freaking me out !!! TheDigitalHippy
Funny stuff. I like it. Just thought I'd drop a line and say so.
If you Latvians worked more than 20 days in a month you might make more money.
How about:
A true software guy will spend an hour writing a script (python/perl/bash whatever) to do a job that could have been done by hand in 10 minutes, just on the off chance that he/she might need to do something similar again someday
Thanks for the insights.
However you may want to consider changing your styles, as blue on black is hard to read. Keep up the good articles. Frank
On procreation and programming:
Programming is like sex... if you're not careful, you'll have to support it for life. Not mine, but I thought worthy of the list. I got it from a friends IM status message 2 years ago.
i`m latvian, i work 5days in week as php coder and dont complain about money
I like your aphorisms, but they aren't theorems. A theorem is a proposition PROVEN true on the basis of a set of axioms.
I think Des is asserting that he's found these aphorisms to prove true over the course of time... i.e. in the case of CSV files, it could be said that "for any given set of 10 CSV files, parsing errors will occur in 9 of them using Parser X." Another axiom referring to CSV files could be "without proper construction, any given CSV file is simply an undecodable string." Also "any document format that blends structure with content is asking for trouble."
Based on those axioms, it's arguably factual that the theorem regarding CSV files is true. Hence while you haven't shared Des' experiences, which led to the formulation of these theorems, you cannot, without the expression of the underlying axioms, debate their veracity. Besides, this is a silly document for fun... don't take it quite so seriously.
Every perl user that boast about "good perl code is absolutely readable" will not like python because it demands properly indentation.
We will only be free when the last java coder is hang on the guts of the last perl coder
I believe that what you have written is new and funny. I found a lot of the comments funny as well. However I can honestly say I have read variations of this for many years. In books even. Google is not the repository of all human knowledge (at least not yet).
Joe,
There are 2 things that annoy me about your comment. Firstly you're posting practically anonymously, and secondly you're not really saying anything. You have read "variations" of my writing in books? What books? Where? As far as I know, there are no "100 funny programming stories" books, at least not in my local stores. Whats really irritating about your comment is that you keep it at such an abstract level, that it holds true for any writing. I have seen many "variations" of Jerry Maguire in the cinema, but I wouldn't go accusing it's screenwriter of copying. I've read many variations of Cop Chases Killer detective books, but again it's not plagiarism. If you reckon I'm posting someone elses stuff, say whos it is? 1000+ diggs, 100,000 visitors, and no-one has a source yet? Does this not seem strange?
If he really wanted them, he would have built them himself.
yeah
Hello
I can't be bothered with anything these days, but shrug. I just don't have anything to say recently. G'night
CSV: oh yeah! ... and if you're not careful you end up starting your own company based on the CSV parser you built!
|
About:
My name is Des, I'm the UX Lead and COO of Intercom, a fantastic CRM & messaging tool for web sites and web software. |
Setting the read bit does not necessarily make your code readable — Jonas jonasbn Nielsen If you build it, they might come. If you have a nice website they might stay. If you offer a free service, they might use...
Tracked: Oct 31, 13:47