Thursday, May 22, 2008

Full Text Justification is Abysmal


I hate full text justification. It works ok for newspapers since their columns are not wide, and they typically do not use "big words". So, the difference from line to line between letters and words aren't noticeable. Also TeX and LaTeX seem to get it right, but that's because TeX and family obey typesetting rules that have been carefully tweaked, honed, and perfected over the past 500 years.

But then came WYSIWYG, and everyone from "HTML Programmer" (snort) through administrative assitant through CEO thinks they suddenly have insight into what looks better. And just add insult to injury, we get 1680x1050 resolution monitors with ClearType font smoothing and...

it   looks   like   I   printed    it     on         my     9     pin     Epson     dot     matrix     from     20     years     ago.


The problem is especially bad on technical blogs and Wikis since we techies DO use really big words; not because we're that smart (although some are, just not me), but because we tend to talk in code, and our code uses big words, or directories, or class names, or, or or... The result is certainly not unreadable, but very sophomoric in impression.

If you have a blog or run a wiki and can control these things, don't use full text justification. Yeah, it was cool in 8'th grade with Scripsit to see the blinkenlights magically put text to paper and spread it out to the edge, but these days it just looks like an 8'th grader wrote it. Using Scripsit.



(I'm not a Luddite, really.)




Wednesday, May 21, 2008

Lift Diary, Day 1

I'm trying to learn Scala, and /lift/. The ultimate goal really IS to learn something, but as a way to accomplish that, I'm going to use a website that I maintain (currently java, webwork, and ibatis) as a template. Rewrite that (or significant, not-necessarily-production-quality parts of it), and I'll consider it a success.

As I do various things along this journey, I plan on jotting them down here, so please forgive the inevitable sentence fragments, missing links, misconceptions, etc. This is more a jot pad of what I'm doing, as I do it, not a finalized tutorial for anyone following me.

So, on to it then.

* Download and install the latest Scala (2.7.1 final) at http://www.scala-lang.org/downloads/. I'm using Windows for this. Yeah, I know.

* Setup the path, etc.

* Try it out.


c:\tmp>scala
Welcome to Scala version 2.7.1.final (Java HotSpot(TM) Client VM, Java 1.6.0_05).
Type in expressions to have them evaluated.
Type :help for more information.

scala> object HelloWorld {
| def main(args: Array[String]) {
| println("hello, world")
| }
| }
defined module HelloWorld

scala> HelloWorld.main(null)
hello, world


Success, but I expected that.

* Download /lift/. What the deuce? You don't download lift, you let maven do it. (http://liftweb.net/index.php/HowTo_start_a_new_liftwebapp) Ok, no problem, I use maven roughly daily for my 'real work', so I'm ok with that.

I've used the command line below, all on one line, indents are simply for looks.


mvn archetype:generate -U
-DarchetypeGroupId=net.liftweb
-DarchetypeArtifactId=lift-archetype-basic
-DarchetypeVersion=0.8
-DremoteRepositories=http://scala-tools.org/repo-releases
-DgroupId=net.liftweb.hello
-DartifactId=liftdiary


Not mentioned on the wiki, it asks for a version, then asks for confirmation for some properties its set, then completes.

(I've asked permission (since I'm kind and polite) to edit the wiki, so I can just set things right as I find them, rather than gripe about them here. Also, I've asked David if he wants me to just wiki-ize this whole experience somewhere ON the lift wiki. We'll see how that goes.)


* mvn install jetty:run

Works fine. Now to figure out how to make my OWN web app, and not blindly follow the "do this, do this, do this" pages.

Sunday, May 18, 2008

Culture Clash with Python

I first looked at Python around 1997, for reasons lost to my ever failing memory, but already being a rather big perl-head by then, I didn't go much past the "Hrm, neat" stage.

I've since decided to give it a real go and am studying a bit from online sources. On one hand there are aspects I really like (large extensive library, big support, stable; and even some aspects of the Python "way", since sometimes, but not always, TMTOWTDI is a PITA.

There is one aspect though that just really clashes with me; the community is VERY quick to point out how you're wrong. It doesn't matter about what, it's just you're wrong. I've found that most of the time, I am, but there's this absoluteist tone that I sense that makes me completely understand why the community has the "Pythonista" term applied.

For example, if you want to join a list with a delimeter, the way to do that is like so: string_delimeter.join(<list, tuple, etc.>) # i.e. ", ".join([1, 3, 4, 7, 10])

Ok, that's just a bit backwards from what I'm used to. I want to join THE LIST with the delimeter. It's a small cognitive dissonance, but it's there. When looking at the FAQ about this, it says ... I'm wrong. No, that's not what I want to do. The exact quote is:

The second objection is typically cast as: “I am really telling a sequence to join its members together with a string constant”. Sadly, you aren’t.

Well, yes, yes I am. Like I said, a small nit, but it could have been phrased in less absolutist verbiage, (and the counter example of "split" is inconsistent with what it's saying, but I digress). Ok, so I get past that. (And there is another less odd looking, but less "OOish" way of doing that if I find I can't stand it. So Python ISN'T just 1 way to do it for everything after all!)

So, playing around, I wonder what happens when I try to join a list, err, sorry, "telling my delimeter to iterate my list and insert itself" (rolls eyes), when it contains the equavalent of a null, namely Python's "None".

", ".join(['a', None, 'b']) # => a,,b?

Nope. Exception. Ok, I can accept that None has no default conversion to a string, and I can accept that there's no easy way to do it (Is there? If there is, IRC folk didn't know, and told me I was wrong for even deigning to ask), but I find this behavior a bit irritating. What was the result when I mentioned this? Not that I'm expecting the wrong thing (I am), or even that I was quick to jump the gun to find this irritating (I was), but rather, I don't find it irritating. Excuse me? I'm pretty sure that I do. "Nope, you don't."

Then there's the PEP standard that calls for no more than 80 character lines. I've been programming professionally awhile, and 132 was all the rage almost 30 years ago. There does seem to be some debate about this, and going over my latest java project my line length averages 37 chars (over some 100k lines of code) so I doubt this would really affect me in any meaningful way, and too, I doubt I'm going to be putting any code into Python's already outstanding standard library, but the discussion around it was just what I've come to find out as typical.

I happened to come into IRC when this debate was going on, and although it was mostly good natured, one of the reasons for 80 is that anything over 80 is unreadable. Not, "*I* find it hard to read over 80 character lines.", or even "GUIDO hates it", but >80 is just absolutely unreadable, for anyone. Questioning that, or even mentioning that YOU can do fine with 132, 150, 180, 250 character lines just about has you burned at the stake since you obviously do not, and cannot float like a small stone.

Lastly, and this is probably confirmation bias, but whenever I come across a blog post comparing, contrasting, teaching, explaining, or anything with a programming language, there is almost inevitably the "Why don't you try it in Python?", "X sucks, you should do this in Python", "Python does this all better, see?" set of bleats and whines. It is the same tenor as the nice young men in their white shirts and black ties coming to my door trying to push their version of God on me. Actually, now that I write that I DO realize that what I'm feeling with some of this community has strong similarities to fundamentalist religious methods of conversion. Hrm, interesting.

So, I'll continue learning as I do find the language very interesting, although I haven't really found it to do things in any sort of way other languages cannot with as much or more expressiveness.

Friday, May 16, 2008

Absurd

Some time ago, a company I've recently (1.75 years ago) left was bought by another. This all happened after I left, so it didn't affect me other than it directly affects friends that are still there. One of the acquiring company's MO's is to do an immediate 30%-40% headcount reduction (or so I am told).

True to form, they announced the RIF in the department I was in, and soon after noted who will stay (very few) and who will go (very many) and who will be doing the jobs of the people they let go (outsourced).

The other day, someone realized that the company's business is financial in nature, and it was against [the law, company policy, a regulation] to allow this personal financial data to leave the US borders. The solution? NOT fire the people that were going to do those jobs? Oh, but no! They instead decided to bring ONshore the OFFshore employees to do these jobs, and pay them about the same as the people who already knew how to do it.

Cost savings, indeed.

Discuss.