Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Slashdot Log In

Log In

[ Create a new account ]

dthable (163749)

dthable
  (email not shown publicly)

Weeeeeeeee

Journal of dthable (163749)

[Python] What's with all the semicolons?

Friday March 30 2007, @01:57PM
Programming
I'm looking at the /. journal extraction script written in Python and I keep seeing lots of lines that end in semicolons. Example:


        def getIndexItem(self):
                # create a summary of the entry
                digest = self.body[:self.DIGEST_LEN].replace('\n', '');
                digest = self.HTML_STRIP.sub('', digest);
                digest = digest.replace('>', '').replace('

When I learned about Python and started to work with it, I was told not to use the semicolons. In fact, I thought that was illegal. Is the parser just throwing them away? Does it have any purpose other than making those C programmers happy?

The /. Book Reviews

Monday February 12 2007, @02:59PM
User Journal
Is it just me or has every book review ended with "this book is useful for the experienced individual as well as the beginner. No geek should be without."?

What's the point of reading reviews if everything that comes along is great? Tell me what books also suck so I don't walk through a book store any buy one of those.

Book reviews - actually useful or marketing pimps on /.?

Java Is Dead. Long Live The Queen.

Friday February 09 2007, @03:41PM
Java
...or something like that. I read the following front page article on Java being a dead language. While I won't go as far to kill anything this afternoon, I do have to agree with Mr. Eckel that Java is unpleasant to C#. After working for 5 years in a Java environment, I actually found C# fun to program and always wondered why Java didn't have the same features.

I found myself envying three C#isms - type safe generic support, the "all data types are objects" mentality and C++ style code orginization.

The first to features do away with a lot of casting syntax. The damn java.util classes always manipulated elements as Object and for good reason. A list is generic. Give the list something to hold on to and it will. Yet, the lack of generics made this more error prone and just messy code. Cast an element coming out of a list and you get an exception. Type the expression into an IDE and it will tell you that you're getting an object, not a Widget.

I know Java added generics with Java 5, but it looked like it was more of a preprocessor than a fundamental design decision built into the type system. This creates a new issue where I have a SuperWidget and only want to create a list that can hold SuperItems. If I want to use generics I end up opening the list up for everything. If I pass things around as a SuperItem, I still have casting hell. This might seem too picky but think about how many times you have some generic process that should only be applied to a certain class of items. C# ends up implementing generics and keeps them type safe.

I also don't know how many times I've butted up against code that uses the primitive int type versus the class Integer type. Did you ever try to work with a Map using a primitive data type? I just hate having to type Integer.getInt(foo) into my code all the time.

Ok, the last one is a personal preference. I like to combine lots of stuff into one file. It just makes sense that I add a few loosely related classes into a single source file. Not close enough for an inner class but not separate enough for a new source file.

Just remember, opinions on programming languages are like a$$holes. Every one has one and they all stink.

I Swore I Would Never Do Long Distance Relationships

Thursday January 25 2007, @07:00PM
User Journal
but here I am. Basically, my girlfriend got transferred to Seattle for at least 18 months. She leaves next week but I need to stay in town and finish up my education (graduate in May!).

To make matters more complicated, I've been working on a Wisconsin business plan competition. If I win, that means nice chunk of state funding as long as the business stays in Wisconsin. On one hand, I'd really like to win and work on this web application full time without part time work to get financing. But things would be easier if I just threw the contest and then move out with her once I graduate. It's starting to remind me of the first relationship I was in and I threw away some good things for something that didn't work out in the end. I don't want to make that mistake again.

I've been trying to be the strong boyfriend. I want to be the one there for her to lean on, cry to when things get difficult, and support her and this great opportunity that she has. Yet, I find myself growing depressed as that date grows closer. Tonight, someone is coming by our place to give her a moving estimate and it's going to be strange listening to them talking about what to take and when. Even my parents are worried that this is going to come between us and they really like her. It's just a lot to add into the rest of my life right now.

I just hope that I can make it.

JavaScript Is A Pain

Tuesday January 16 2007, @04:24PM
Programming
Does anyone have a good reference, book or website, that contains information on programming pages with JavaScript. All I can seem to find are references that want to explain what a variable is and don't touch on the different IE vs. NS api.

This is more frustrating than that time I tried to learn brainf*ck.