Hello world!

public void beginBlog(int integrity, char character, float inCyberSpace, double trouble) {

    blog myBlog = new blog(‘The Musings of Marc Evans’, 42);

    firstPost = myBlog.newPost(true);

    firstPost.title.print(‘Hello world!’);

}

The question is, will no value really be returned?  We can only wait and see…

Advertisements

About marcpevans

I'm a composer, and a graduate student at UC Santa Barbara. This blog contains my philosophical musings on music and on other things. If you want to actually listen to my music, you can find it at www.marcevansmusic.com. Welcome! :)
This entry was posted in Uncategorized and tagged . Bookmark the permalink.

3 Responses to Hello world!

  1. Mr WordPress says:

    Hi, this is a comment.
    To delete a comment, just log in, and view the posts’ comments, there you will have the option to edit or delete them.

    • marcpevans says:

      Thanks so much for this timely and useful information, Mr WordPress! I must say that I am honored to receive a comment from you yourself — you must be a very busy man.

  2. Depends on how “meta” you want to get about it. I’m not completely sure what language this is but quickly judging from the syntax maybe it’s Java? (if it’s not some automatically-memory-managed-language like Java then you clearly have a memory leak xD)

    …Not that that matters too much. But usually, depending on your machine architecture, there’s a particular register that the return value of a function gets placed in (assuming the function isn’t inlined). Since this function has no return value, nothing will get written to that register, but that doesn’t mean it doesn’t have ANY value whatsoever. It might just probably have some garbage, or whatever was there before. Of course, you could argue that it doesn’t matter because nothing will ever read from there and therefore it doesn’t really “return a value”…I’m pretty sure you can’t use void as an rvalue for instance, so you couldn’t assign it to a variable, etc.

    Of course, it also really depends…because if you look at your functio–er…I guess I should say “method” since we’re in Java…but if you look at it, none of the parameters are actually necessary. So maybe a smart compiler would figure that out, and notice that your method has no parameters and no return value, and would take that as a sign to inline the method (though I’m not quite sure how inlining works in Java, especially with non-static methods). In which case, this wouldn’t even be a method at all, so there’s no way you could even have the concept of it “returning” something.

    ***note: this might not all be 100% factually correct. I’m a CS major, and a coder, but I’m definitely not a super-hacker who knows all of the details about obscure machine-level things like this.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s