10/11/05

Permalink 08:44:48 pm, Categories: Technology, Programming, 973 words   English (US)

Languages

11 Oct 2005 Update: The answers are now posted. Select the area after C#: or VB.Net: to see the answers. Originally posted 12 Mar 2005.

A friend and I have had numerous discussions on the merits of VB.net and C#. One of the points I've attempted to make during these discussions is that because VB.net uses more natural language keywords, you have to remember less things. He seems to believe that the keywords that C# uses are the ones that come natural to him anyway so my point isn't really valid. In poking around the net I came across a few examples that I think may help me in making my point. Maybe it will work, maybe it won't.

Classes:
Let's say you are creating a class. You don't want other programmers to be able to create an instance of this class. You only want other programmers to be able to inherit from your class. What keyword would you use in C#? How about VB.net? Which one seems more natural?
C#: abstract VB.Net: MustInherit

Now you want to create a class but want to make sure that it is only used by other programmers by creating an instance of the class. Other programmers are not allowed to inherit from your class. What keyword would you use in C#? How about VB.net? Which one seems more natural?
C#: sealed VB.Net: NotInheritable

Now that we've created our class, lets move on to...

Methods:
You've created a method as a shell that you want other programmers to implement in their class. They've inherited from your class and you want to make sure they override the functionality of this shell method. What keyword would you use in the method declaration in C#? How about VB.net? Which one seems more natural?
C#: abstract VB.Net: MustOverride

You're now creating a method that you want to make sure works the way you coded it and doesn't get overriden by a programmer inheriting from your class. What keyword would you use to keep them from overriding your method in C#? How about VB.net? Which one seems more natural?
C#: sealed VB.Net: NotOverridable

Misc. oddities:
Now lets move in to an area that is just weird. Lets say you have a variable that you want to be shared between all instances of a class. What keyword would you use in C#? How about VB.net?
C#: static VB.Net: Shared

Now lets say you have a variable that you want preserved between calls to a particular method, but don't want it shared between instances of the class. This one deserves a bit more explanation. Lets say you have a class called Count that has a method called Add (yes, this is kind of a weak example and you probably would never do something this way, but bear with me). Add has the variable in it that you want preserved called Total. Add increments the Total variable and returns it's value. You create an instance of Count called Hits and another instance of Count called Views. You call Hits.Add 2 times, then call Views.Add 2 times then call Hits.Add 3 more times and call Views.Add 1 more time. The last time Hits.Add is called, it returns 5. The last time Views.Add is called, it returns 3. What keyword do you use when declaring the Total variable in C#? How about VB.net? Which one seems more natural?
C#: Don't think you can do it VB.Net: Static

Conclusion:
The answer to which of the above keywords is more natural is subjective. One person may think one way is more natural while another thinks the other is more natural. If you've been programming in one language long enough, the keywords are going to be so ingrained in your head that they're second nature to you. What I'm trying to point out here though, is if you didn't know what the keyword was to do one of the above tasks, could you type in three or four guesses in to the VS.IDE and stumble upon the right keyword?

On the other hand, if you are looking at the code someone else wrote in one of these languages and you see the keyword used in one of the above examples, will you be able to tell what it means or will you have to look it up? Again, if you have the keywords already memorized, then you're not judging whether they are more natural or whether you can tell what they mean when first exposed to them. I learned some keywords in C, C++, Perl, etc.. that I knew by heart at the time. I've since forgotten a good bit of them. If I went back and looked at code that used those keywords, I MIGHT be able to remember what they meant but I would probably need to look it up. I believe that if I didn't code in VB.net for the same period of time and then went back and looked at old code, I would have to look up a lot less keywords than I would in C# or the other languages listed above. That, to me, says that VB.net's use of keywords is more natural.

You may have noticed that I didn't give any of the answers to the questions of what keyword you would use for the above scenarios. I'm going to let this post sit here for a while before I add that in. When I do add them in I'll add them in a way that hides them until you want to see them. If you don't know what keyword to use in some of the above examples, make 4 guesses for each language. When I post the answers, see how many of each language you got right.

Enjoy,

Check

Permalink

10/10/05

Permalink 04:58:42 pm, Categories: Exercising, 208 words   English (US)

Yourself Fitness

Yourself FitnessI've actually started exercising. Amazing isn't it? I started on 26 September 2005. I bought a game for my Xbox called Yourself Fitness. It's like a digital personal trainer. You do a physical challenge thingy with pushups, crunches, squats, and things like that and tell it how many you could do. It then recommends a workout plan for you and lets you set a workout schedule. Each day when you go in to the game, it picks a different target area (cardio, upper body, core body, lower body, flexibility). It then has you do aerobics to a different routine each time. I like it better than and exerice tape/DVD since it changed each day. I haven't got bored yet and I've done 10 workouts so far. I'm actually getting some definition in my legs and arms. I'm working on getting rid of the gut I've got from drinking Coors Light. :)

Heart MonitorI now have some hand weights and a heart monitor. There's been a few times where the heart monitor started beeping at me because I reached 95% of my maximum heart rate. I'm glad I've got it to tell me to slow down a bit before I give myself a heart attack. Well hopefully I'll keep posting about this. Gotta run.

Permalink
Permalink 04:39:16 pm, Categories: Blogging, 64 words   English (US)

SPAM

I'm absolutly sick of SPAM on this site. In an effort to do something about it, I've upgraded to a new version of b2evolution, disabled trackbacks and pingbacks, and you now have to register to leave a comment. Hopefully this will allow the time that I spend here to be used posting instead of performing maintenance until I'm sick of it. We'll see.

Permalink

04/28/05

Permalink 08:30:57 pm, Categories: Technology, Programming, 276 words   English (US)

Visual Studio 2005 Beta 2

Oh my gawd! They finally changed this. This is something that has irritated me in every version of Microsoft HTML editor I ever remember using. When you are in design (WYSIWYG) mode and you press the Enter key, what does it do? It puts jumps out of the current <p></p> tags and starts a new <p></p> paragraph. I don't want that. I pressed Enter. I simply want to drop down a line with a <br> tag. If we want to get picky about it, put a <br /> tag in there.

Well, boys and girls, they finally did it! I just created a little hello world type web app with Visual Studio 2005 Beta 2. I pressed Enter at the end of a line. IT INSERTED <br />!!! I'm so happy!

They've also added a feature that puts a green horizontal line next to all the lines of code once you've saved them. As soon as you've created a new line or modified an existing line, it changes to yellow indicating something that has been changed but not saved yet. Helps to visually depict what you've modified and what you haven't.

So far so good. Also, you can tell it that you want your project to be in the file system and it will let you run it and test it without having to have IIS or Cassini (sp?) installed on your machine. This last one I'd heard about but the first two items above are news to me.

If I get the time, maybe I'll post some more things as I learn them.

04/20/05

Permalink 01:28:50 am, Categories: Blogging, 29 words   English (US)

24

24 finally lost me. In a 24 hour period they've dealt with nuclear meltdown, Air Force 1 being targeted, and now a potentially missing nuclear warhead. Pick a freakin plot line already!

Permalink

03/16/05

Permalink 09:43:07 pm, Categories: Technology, 35 words   English (US)

144 Megapixels

Two New York photographers have come up with a method of taking pictures at 144 megapixels. Yes, one hundred and forty four megapixels. I wonder how long it will be before this is used for porn. :)

Permalink

03/01/05

Permalink 12:50:33 am, Categories: Entertainment, 95 words   English (US)

24

I think 24 may have finally lost me as a viewer tonight. The first few seasons were great and had a plot that worked well. Lately though, it seems like they have a lot more filler than they used to. It's like half of the show is now devoted to trying to make the show last for 24 hours when the plot only takes four or five. That added to the HORRENDOUS technobable they use on the show is really turning me off. Maybe they can win be back but I don't know. I'll let ya know.

Permalink

02/28/05

Permalink 01:32:57 am, Categories: Entertainment, 218 words   English (US)

77th Academy Awards

I just finished watching the Academy Awards with the host, Chris Rock. He brought up a good point that was meant to be a joke: There's no acting at the academy awards. He meant to show that there's singing at the grammys, dancing and singing at the tony's, but no acting at the oscars. He's more correct than I think he meant to be. These are professional actors and actresses who are presenting the awards. Their job is to read and learn a script and then read it on camera. THAT'S THEIR JOB! Why on earth can't they do that at the OSCARS? Every one of these idiots get's on stage and reads (poorly) from the teleprompter their two or three sentences that they say before they announce the nominees. Couldn't these idiots learn their lines ahead of time? Isn't that what they do for a living? Maybe that's why they make so much money. Your average idiot could memorize and perform three sentences in about 15 minutes. Maybe these idiots take 8 hours to get three sentences correct. It's just hard to believe that these people who perform memorized lines for a living have to read their lines for the oscars off a teleprompter and do it with less acting ability than someone performing in an elementary school play.

02/27/05

Permalink 02:59:42 pm, Categories: Blogging, 39 words   English (US)

New Home

Here I am at my new home. I'm using b2evolution as my blogging software instead of blogger. It's MUCH easier to upload images now and it uses basic html for formatting. Maybe I'll actually blog more often now. :)

Permalink

10/14/04

Permalink 09:07:53 am, Categories: Technology, 61 words   English (US)

Google Desktop Search

Google just released a beta version of their Google Desktop Search Download. I've installed it on my machine and waited for it to index it. This thing is unreal. Searches come up instantly. Now I can find stuff on my computer quicker than ever before. I will no longer be opening Windows Explorer to find files. Google Desktop Search is HERE!!!

Permalink

:: Next Page >>

Check's Ramblings

| Next >

March 2010
Mon Tue Wed Thu Fri Sat Sun
<<  <   >  >>
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        

Search

Categories


Linkblog

Misc

Syndicate this blog XML

What is RSS?

powered by
b2evolution