Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
User Journal

Journal: Rant: Why i hate Java (simple, old debate) 4 4

Why do i hate Java? (And C too.) retardedNames, case sensitivity, offsets treated like indexes. These are examples of where programmers had good ideas but then unfortunately designed them into a language.

0 is not a number. A number represents a quantity and 0 is not a quantity. You don't declare an array less one because 0 is a number. However, it is treated as a number for convenience. Why then refer to an index in an array with 0 first? Okay, okay, i know. It's because the variable is just a pointer, and the index is really an offset. So then why use an offset to index an array? Seriously. In how many cases do you treat the offset as an index. And in how many do you treat it like an offset? I thought so.

Then there's the whole = vs ==. Debate over whether = should set or compare is understandable. Personally, i would never have used = to set, because most people use it to demonstrate equality. Not to test it, but to demonstrate it. As in any math equation we teach children. With that in mind, i would think it was more likely to be used to test equality rather than set it. Furthermore, pick the odd operator out: =, +=, -=, *=, /=. ^=. Yeah, yeah, those are for convenience. But how many times have you mistaken the double-character operator for anything else. Yes, but they have another operator that makes it obvious. Exactly. Isn't == obviously setting without an operation. x += y adds y to x then sets. x -= y subtracts y from x then sets. So, x == y should equal y to x then set. Slightly bumpy because it sets x to y and not vice versa, but its really easy to understand. And, earlier languages did it with :=. Same thing.

BASIC used = for both. Noone used LET outside of teaching. Regardless, context defined it anyway. Context is not available in Java because it allows you do do nifty things like increment an array offset while setting it. So, no context. Of course, this leads to bugs and the niftiness is often considered bad practice, but isn't it cool that we can do it?

I've seen absolute morons coding in BASIC. But never once had i seen them use = to do what they didn't intend. You know why? Because its impossible! Context rules. On the same note, i've read about talented programmers who made the mistake in C(++).

Prefix and postfix ++ and -- are a little different. They are not obvious (until you know what they do), and other than errors in logic, they are used as intended. They break context, per se, but that is what they are designed to do. Applying this to the poor = sign is just plain ridiculous.

Seriously, why are these things done when they are counterintuitive, prone to bugs, and bad practice? Were the designers brain dead, or just 31337 h4x0rz that hadn't grown up yet? Or, is everyone so blind to this because they never made this mistake.

Okay, the languages weren't designed inasmuch as they just ended up being used. But why? Was it because the pros outweighed the cons? Or was it because programmers actually like this nonsense?

User Journal

Journal: Leveling up with python 2 2

$ py
Python 3.4.3 (default, Jun 14 2015, 02:11:57) [MSC v.1800 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> dat="http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingMFA.html"
>>> print(dat.split("/"))
['http:', '', 'docs.aws.amazon.com', 'IAM', 'latest', 'UserGuide', 'Using_ManagingMFA.html']
>>> print(dat.split("/")[1:])
['', 'docs.aws.amazon.com', 'IAM', 'latest', 'UserGuide', 'Using_ManagingMFA.html']
>>> print(dat.split("/")[2:])
['docs.aws.amazon.com', 'IAM', 'latest', 'UserGuide', 'Using_ManagingMFA.html']
>>> print(dat.split("/")[3:])
['IAM', 'latest', 'UserGuide', 'Using_ManagingMFA.html']
>>> print(dat.split("/")[3:-1])
['IAM', 'latest', 'UserGuide']

I hadn't ever used the python REPL to work on a bit of code, but it sure makes exploring the slicing notation easier.

User Journal

Journal: How to counteract rm -rf / in a few easy steps.

first off be prepared, have killall rm in innocent looking names on the systems you protect. one for every letter of the alphabet if you can take the time to do that, but failing that having wget will allow you to download killall to any directory your on, assuming you have a network machine with the capabilities of sharing killall, or a comparable program.

User Journal

Journal: Chronicle: Yesterday's bike ride

Rode my bicycle yesterday for exercise, with intent to go to Meijers (The name, Meijer's Thrifty Acres, which people colloquial called "Meijers". The name has changed, removing the need for the possessive "s." Kids and sticklers now use the new name.) I did go there, stopping off at the Royal Oak Post Office en route.

The post office is a nice one. I used to have a PO Box there. They've since added inner doors to replace the gate locked at nighttime. The doors look nicer when closed, i guess, but also makes it look more office-like during regular business hours. The bike stand/rock was missing outside, so i used the railing on the accessibility ramp. It goes around like a hairpin, but gets more narrow in middle of the second half. Well, if whoever uses it can use the more narrow part, using the side of the excess shouldn't be an issue, should it?

Anyway, they're slow, but what government office isn't? When the guy two in front of me went up (without being called, to wait for the returning clerk, who asked if he was actually next when she came back) the guy in front of me went moved up. The line at the office is not straight. There is the counter and an open area for standing and leaving, then an island with a flat top and forms on the side. The line forms on the other side of the island and around the bend, where people usually wait to be called. So, both people in front of me were facing perpendicular to the direction i was facing. When two-in-front went up, one-in-front walked forward. I turn and got behind him, and he moved up just a little further. Obviously, he wanted room. So be it. I figured he might not kike Jews, so i didn't stare at him either. That is, i made sure to look away from him. He did his business and left. I needed only a minute, so i was out relatively quickly.

As i was beginning to ride away on my bike, he commented (while unlocking his car?) to me, "I never saw a rabbi on a bike before." I smiled and kept on riding. I still don't know what he meant by the statement or why he considered me a rabbi. Mayhap, he doesn't get out much. :)

Before i even got to Meijers, i was pooped, and realized i really needed the break before i could ride home. The stop at the post office elongated my trip more than expected, and i wasn't ready for that much exertion this summer, yet. I took my time in the store, including checking out the Italian section, and getting Turkish sun dried tomatoes. I may go back and grab some of the Pomi products (they had two, iirc) to see if they are that good.

On my way home, i evoked the same responses as usual. People stare at me biking. I think people stare at all bikers, or better put, intruders on their domain. Anyway, as i was riding down one street, i saw two boys playing a couple(?) blocks ahead. The first went inside. Seemed normal. I don't know if he saw me or not. The second saw me and ran inside too. Nope, not inside. As i passed by, i saw him hiding behind a bush. Did he think i might curse him or was he just afraid or shy? I wish could go back and ask. Or maybe watch a video online with comments. Hmm... bike cam, anyone? :)

User Journal

Journal: Chronicle: Warm office, but what can i do? (2) 2 2

Well, two ladies came by in response to the request, at least one of which looked like she was dressed for dinner. I ignored them when they first walked by until they specifically asked for my attention. I had no idea that was normal business attire and really didn't think they were there for me.

Well, they have no half walls and no wall would make the desk fall down. I said i'd be willing to give up that part of the desk, but it didn't look like that was an option. We discussed the closed vent and i mentioned that it bothered other people in the past and i didn't want to bother them now. As they continued questioning, my neighbor piped in with her past experience. Finally, they suggested they would have an engineer look at the vent. I tried making a joke by telling them they could attach a pipe to the vent and put it down my back (which wouldn't bother anyone else...) One of them forced a small giggle. I don't even need retrospect to realize it was poorly timed. My mistake was to not appreciate that no comment is better than a bad one.

As they spoke i realized the were standing and i was sitting. Not being their superior, etiquette would demand that i stand, and stand i did. It's not something i always remember to do, as so many people do not. This etiquette in not a gender thing, but a respect thing. Sitting while other stand and speak to you is considered haughty (or inconsiderate, at the very least), or so i have been taught. A lot of people either disagree or just don't care.

I did bring in a thermometer today, changing the battery with a March 2015 expiry. It was 74+ all morning. When they left i looked again and saw it got lower, Right now its 72.5. Weird.

[I used the word "as" too much. Also i need to work on flow, as opposed to a collection of related statements.]

They are called computers simply because computation is the only significant job that has so far been given to them.

Working...