Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Stupid Journal Entry

FortKnox (169099) writes | more than 10 years ago

User Journal 17

Stupid random writings of a tired, bored, yet terribly busy coder.Stupid random writings of a tired, bored, yet terribly busy coder.

Some mock about Em crying from previous journal entry.

cancel ×

17 comments

Sorry! There are no comments related to the filter you selected.

Insert (1)

Em Emalb (452530) | more than 10 years ago | (#7905681)

ribald yet amusing Josh sucks story here.

Re:Insert (1)

SamTheButcher (574069) | more than 10 years ago | (#7905710)

Ribald? Juicy!

Re:Insert (1)

blinder (153117) | more than 10 years ago | (#7906131)

Where is 5 am anyway? I kinda sorta miss your widdle troll... naw... take that back. no i don't.

Re:Insert (1)

SamTheButcher (574069) | more than 10 years ago | (#7906184)

He made an appearance in Em's journal just yesterday, I think. That's what reminded me of "juicy".

Which was kinda funny, but that was about it. But it does seem to be someone in the circle.

Re:Insert (1)

mekkab (133181) | more than 10 years ago | (#7906666)

Hmmmm, mekka B hasn't posted in a while... implication? Or internet castration?

Re:Insert (1)

SamTheButcher (574069) | more than 10 years ago | (#7906940)

CASTRATION!

Correlation?

Didn't Sandler Do Something Like This? (1)

Cliff (4114) | more than 10 years ago | (#7933754)

Correlation?

Concentration...
...Contention...
...Frustration...
...Alienation...
...Humiliation...
...Affliction...
...Mutilation...
Asexualization!

-cm

(I wish this code would do .... indentation...)

Re:Didn't Sandler Do Something Like This? (1)

SamTheButcher (574069) | more than 10 years ago | (#7933946)

Cajun Man!

Brilliant. Thanks for my biggest smile today, Cliff. :)

Gratification. ;)

Reply (1)

FortKnox (169099) | more than 10 years ago | (#7905762)

with link to definition of ribald [reference.com] .

Insult my own ignorance.

Re:Reply (1)

Em Emalb (452530) | more than 10 years ago | (#7905882)

Pithy reply (complete with misspellings) stating my own superiority.

Ok, then... (1)

dmorin (25609) | more than 10 years ago | (#7905916)

You're a java geek, right? Here's two questions to occupy your brain:
  1. For private properties (i.e. properties that are only used internal to a single class) do you still give them private getters and setters? I say yes for several reasons:
    • It keeps one in the habit of providing getters and setters for when they are vital, kinda like using your turn signal even when there are no other cars on the road to see it.
    • It's more readable to me because I don't have some code that uses getFoo() and some that uses m_blah.foo.
    • It is one less exception/complication. I can say "All my properties have gets and sets." Although I admit this one is philosophical in nature.
    • It gives you an opportunity to encapsulate logic related to getting and setting, such as a single place to do null checking or array bounds.

    My coworkers just beat the heck out of me in code review for it, saying that it's a giant waste. Their argument is that it is basically overkill, too much typing, too much to read, thus hard to do as well as hard on your peers.

  2. A harder one. What's a good design pattern for using JSP to build things other than web pages? I have many instances where I want to generate content (mostly emails of various sorts) but I hate not having the power of JSP as my templating language. I want to set something up, web service style, that would enable me to say "Hitting this url with these params will build and send the appropriate email." Of course the return stream from the URL could be the actual email, but I don't want dat because I want to email from a server machine, not from the client I executed my batch from. I also want to log it to the database.

Re:Ok, then... (1)

mekkab (133181) | more than 10 years ago | (#7906209)

I can only answer 1.

Getters and Setters are the door way between the private and the public. So they aren't necessary. However, this all brings up coding standards.

It's more readable to me because I don't have some code that uses getFoo() and some that uses m_blah.foo.


Thats poor programming and should be stamped out at inspection.

It gives you an opportunity to encapsulate logic related to getting and setting, such as a single place to do null checking or array bounds.
This is the strongest argument. And This has nothing to do with OO- if there is some large amount of trickery interms of determining a unique key from some input, GOOD PROGRAMMING states you should have a getKeyFromData() routine.

However if its just an array, writing
myLocalVariable = myArrayOfKeys[ inputData ];
is simple enough.

As for your coworkers claim of it being a giant waste- is it? Whats the overhead of the function call? Does java optimize simple things away? How many milliseconds does this add to execution time?

As for being hard on coworkers to read, I think thats BS. It may just add clarity by dividing how much "work" you do in each line of code.

Re:Ok, then... (1)

FortKnox (169099) | more than 10 years ago | (#7906357)

1.) Sure, I don't see anything wrong with it (especially since most ide's can put the accessors in for anything). But, for me, having underscores and m_ stuff in your variables dirties the place up to hell. I hate prefixes/postfixes for that kinda stuff.

2.) I always use the MVC pattern (Model View Controller). If you use it correctly, the view should only contain JSP based info on displaying the pages. Therefore, in your view package, you'd have a "jsp" package for displaying JSPs, and a package for (as an example) email, where you setup information to be sent in an email. To 'force' yourself into the MVC pattern, use struts [apache.org] as your framework.
This doesn't really answer your question fully, but I've made apps where its a client-server app with a webpage and they all use the same common classes, and used struts for the whole thing and only needed a jsp package, a client package, and a server package in the view parent package and everything worked peachy.

But to answer your question a little better, there are mail servers you can setup in webapps (like tomcat), so once you hit 'send this email', you can do it all serverside, not clientside. You may also want to check the project 'velocity' which is kinda a templatey framework most people use for JSPs, but can do other stuff...

Re:Ok, then... (1)

dmorin (25609) | more than 10 years ago | (#7909434)

2) I dont think anybody ever understands me on this one. I want to build the content of my HTML email using all the exact same code, rules and framework that I use to generate web pages. Therefore I would like a way of saying "Call this JSP, then take the output from it and store it in an email body." Everything I've read says that this is impossible, that the only thing a JSP can write to is the original request's stream. I'm trying basically to subvert that.

imagine this as the last post (1)

subgeek (263292) | more than 10 years ago | (#7906332)

imagine this post arriving in this journal in a day or two and that no one read it because no one was posting in this JE anymore.

And now for something completely different... (1)

robi2106 (464558) | more than 10 years ago | (#7907121)

You mentioned getting a card for your system with the intenet to play Deus Ex II: IW and I found a review of a new card (nVidia) that is pretty slick. Check it out over here [guru3d.com]

jason

In Soviet Russia, MT's reply reads YOU! (-1, Troll)

MonTemplar (174120) | more than 10 years ago | (#7907136)

Nuff said! :-)

MT.
Check for New Comments
Slashdot Login

Need an Account?

Forgot your password?