Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 21218

Java is a high-level, platform-independent, object-oriented programming language originally developed by Sun Microsystems. Java is currently owned by Oracle, which purchased Sun in 2010.

-1 votes

Why is using an optional preferential to null-checking the variable?

In Objective-C, all object references are optional. Because of this, code like you posted is silly. if (variable != nil) { [variable doThing]; } Code like the above is unheard of in Objective-C …
Daniel T.'s user avatar
  • 3,073
2 votes

Calculated properties in OOP

The Uniform Access Principle tells us that: All services offered by a module should be available through a uniform notation, which does not betray whether they are implemented through storage …
Daniel T.'s user avatar
  • 3,073
6 votes
Accepted

Creating a calendar/planner program. Confused about OO logic?

The basic class in such an app will be an "Appointment" or "Event" class. It will contain the date/time and place of the meeting, who will be there, whether a reminder alarm should sound, whether the …
Daniel T.'s user avatar
  • 3,073
0 votes

Should I follow "dependency inversion principle" rule even if I need one type only and don't...

You don't need an interface for User to derive from. User is effectively plain old data. However, you should have an interface for your ShowUserInfo class because it provides a side effect that you wi …
Daniel T.'s user avatar
  • 3,073
1 vote

JSON API or Plain JSON

I'm currently dealing with a SOAP API and it's corresponding WSDL. After looking over the JSON API specs. I get the impression that they are trying to be a WSDL equivalent for REST JSON servers. Like …
Daniel T.'s user avatar
  • 3,073
1 vote

Avoiding side effects in immutable class constructor

You say that you don't want to move the projectsDAO.fetchProjects out of this constructor because then "... almost all of the logic would have to be done before the constructor is called..." but it se …
Daniel T.'s user avatar
  • 3,073
14 votes

How to eliminate a if-else block which is used to determine behaviour according to a boolean...

You say, "... this implementation only moves the if-else from inside to outside" as if that's no big deal but in fact the second example moves the if check closer to the code that knows what the boole …
Daniel T.'s user avatar
  • 3,073