Another TextMate Issue

26 Mar, 2007 1635 by phoebus

TextMate’s parsing for symbols and code folding is broken. It fails with many slightly-nonstandard brace arrangements, and even fails if there is a tab depth difference between closing and opening tags in XML. In addition, it’s symbol list only works correctly about half the time, although I haven’t spent the time yet to figure out under what cases it is [un]successful.

So far in my BBEdit/TextMate showdown, BBEdit is staying slightly ahead, with its fully-working symbol detection, perfect folding, and generally more powerful menus. While most of the functionality in BBEdit is duplicated in various TextMate bundles, all that functionality is then in one huge menu; not exactly the best interface for an efficient workflow.

Still, TextMate has a superior plugin (bundle) architecture and much more extensive code completion. If they can work out some of these issues, TextMate will pull ahead as my editor of choice. As it stands, I use TextMate for most of my general editing, and BBEdit for serious programming.

Tags: , , , ,

Posted in Software, Coding | Printer-Friendly Version Printer-Friendly Version | No Comments »

Finally

09 Mar, 2007 0700 by phoebus

I’ve been writing XML, XSLT, and PHP all night. It’s sleep time, folks.

Tags: , , , ,

Posted in Personal, Coding | Printer-Friendly Version Printer-Friendly Version | 1 Comment »

Raise your hand if Java ate your parents!

05 Mar, 2007 0210 by phoebus

This Java-related blog has been dead for a couple of years, but still definitely worth a read. Check it out!

Tags: ,

Posted in Coding, Links, Humor | Printer-Friendly Version Printer-Friendly Version | No Comments »

Why Java Sucks - Part 1

04 Mar, 2007 2141 by phoebus

Java is not my favorite language. Despite a fairly robust class library, and some nice constructs, it has some serious problems. This first post will be about specific language “features” (or lack thereof). The next in the series will be a bit more general.

Update: my buddy JK, who commissioned this little screed, pointed me toward this guy, who says pretty much everything I do here, and more. I swear, I hadn’t even read this before when I wrote this list. I guess it just goes to show how glaring some of these langage oversights are, huh?

  • First one good thing: no free(). QED. Now on to the bad things.
  • No Macro system - I realize that the C Preprocessor is in many cases the Root of All Evil, but still, it has a lot of great uses, especially for things like easy conditional compilation.
  • No inline functions (admittedly not a serious issue for modern compilers). I mean, seriously, why is this not here?
  • Schizophrenic basic types: int and Integer, byte and Byte, etc. I know that Java sacrificed much of its usefulness on the altar of the Gods of OOP, but it just needs to pick one or the other; primitives or objects. I’m not going to say which it should be, but it should be one or the other.
  • The preceeding point also leads to some issues because primitive != Object. If a function expects an Object, and I try to send it a byte, the compiler with give me an error in 1.4. In 1.5, it will automatically box the byte in a new Byte object, which quite possibly violates my reason for using bytes in the first place (memory overhead, perhaps?).
  • byte is unsigned. Since when does anyone working with a type called ‘byte’ want it to be unsigned? Of course, this means that if you want to loop through the values of byte as say, array indicies, you have to normalize them first.
  • The inability to use non-Unicode Strings. Sometimes you know there will be no non-ASCII characters, and you’d really like to save a little memory. At least, I know I would.
  • No printf(). Most languages have realized the incredible utility of this particular functional construct, and include it in a similar if not identical form. I’m not asking for total duplication of the feature set, but things like field width and format specifiers just rock out, you know? (Update: I see now that 5.0 added PrintWriter.printf())
  • No typedef. This is an extremely handy keyword. If I want say, longs, to represent something in particular in a Java class, I can’t really assert anything about them except for their long-hood.
  • Interfaces are a kludge created by someone who has it in for multiple-inheritance.
  • static methods are not class methods, even though Sun likes to pretend they are. No, they are global friggin functions. How do I know? Try overriding one in a subclass. Just try it.
  • Since new is the only way to allocate a new object, there are lots of tricks and optimizations that can’t be performed. I can see how a single allocation method might help the Write-Once, Run-Anywhere potential of Java, but frankly, that sucks as it is (see my upcoming Part 2 post).
  • The new generics in JDK 1.5 don’t allow you to use primitives as E types. WTF?
  • No function pointers/function references. And no, functor Objects are not a good way to accomplish this.
Tags: , ,

Posted in Coding | Printer-Friendly Version Printer-Friendly Version | No Comments »

My Programming Personality

01 Mar, 2007 2329 by phoebus

This is from The Programmer Personality Test:

My Type: PLSC

You’re a Planner.
You may be slow, but you’ll usually find the best solution. If something’s worth doing, it’s worth doing right.

While I disagreed with the description of the first answer to the question (”planning is best done as you go”, or some such), I don’t really agree that 75% of the time should be spent on planning either. I think I actually fall somwhere in between the two extremes, but this test doesn’t really allow for that.

You like coding at a Low level.
You’re from the old school of programming and believe that you should have an intimate relationship with the computer. You don’t mind juggling registers around and spending hours getting a 5% performance increase in an algorithm.

Anyone who knows me as a programmer know that this is absolutely the case. See An Ode to C a couple posts ago (which has been floating around Usenet for years).

You work best in a Solo situation.
The best way to program is by yourself. There’s no communication problems, you know every part of the code allowing you to write the best programs possible.

For projects that are not too extensive, I prefer to work alone. I don’t usually program in groups for class, or on my own projects. I just like to do things my way, I guess. But let me stress, I am not afraid to work in a group when that is the best option. It’s just that for most projects I do, it isn’t.

You are a Conservative programmer.
The less code you write, the less chance there is of it containing a bug. You write short and to the point code that gets the job done efficiently.

Conservative in life, conservative in code, I guess.

Tags: ,

Posted in Personal, Coding | Printer-Friendly Version Printer-Friendly Version | No Comments »

An Ode to C

01 Mar, 2007 0409 by phoebus

May your signals all trap
    May your references be bounded
All memory aligned
    Floats to ints rounded

Remember ...

Non-zero is true
    ++ adds one
Arrays start with zero
    and, NULL is for none

For octal, use zero
    0x means hex
= will set
    == means test

use -> for a pointer
    a dot if its not
? : is confusing
    use them a lot

a.out is your program
	there's no U in foobar
and, char (*(*x())[])() is
	a function returning a pointer
	to an array of pointers to
	functions returning char
Tags: , ,

Posted in Coding, Humor | Printer-Friendly Version Printer-Friendly Version | 2 Comments »

The Rundown

25 Feb, 2007 1907 by phoebus

So here’s the rundown of what’s been, well, going down:

  • Rewrote Bitstream and Huffman encoder/decoder in Java, now fully integrated with my image editor (download them from the code page)
  • Slept, finally
  • had an intense session with JK with lots of Dew, code, and good discussion
  • cleaned the apartment some

Tonight I have a study session for CS411, assuming that I manage to finish my CS421 homework. *Sigh* it never ends when you’re a CS major at UIUC.

Hopefully I’ll also have a chance to make dinner. I’m leading toward my mom’s classic marinara sauce recipe, which will be posted later if I manage to make it.

Tags: , , , , , , , , ,

Posted in Personal, Coding, School | Printer-Friendly Version Printer-Friendly Version | 1 Comment »

It’s Java Time

24 Feb, 2007 0443 by phoebus

I’ve re-written most of my C++-based Bitstream library in Java, ostensibly to allow better integration with my image editor, but in reality because I still can’t find my bug.

Tags: , ,

Posted in Coding | Printer-Friendly Version Printer-Friendly Version | No Comments »

Somebody Call the Exterminator…

23 Feb, 2007 0335 by phoebus

…I’ve spent 9 hours looking for one bug. I have literally nailed it down to 4 lines of code. The bug does not make sense. Nothing makes sense.

Goodnight.

Tags: , ,

Posted in Coding | Printer-Friendly Version Printer-Friendly Version | No Comments »

Delirious

21 Feb, 2007 2017 by phoebus

The world takes on a certain strangeness once you approach the 36 hour mark without sleep.

The Huffman Coding system that I’ve been trying to implement isn’t working. The tree structure sets up properly, but an attempt to print it out (and by extension, to locate particular nodes) segfaults, a strange occurance considering my minimal use of pointers. In an unusual twist, I haven’t been able to find the bug even after a couple hours of searching and experimentation. I think I’ve reached the point of diminishing returns on wakefulness (and possibly well exceeded it), so after dinner I am going to crash. Unless, that is, I have a breakthrough, in which case I may have to visit the gas station for another Dew infusion.

Tags: , , , , , , , ,

Posted in Personal, Coding | Printer-Friendly Version Printer-Friendly Version | 2 Comments »

« Previous Entries