You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
- About the "No Side Effects" you say "This is a very uncommon behavior among software languages" - I am a bit surprised at this. Can't Java and C# do this today? What languages do you know that has to have side effects when calling a function?NoChance– NoChance2012-09-12 02:59:59 +00:00Commented Sep 12, 2012 at 2:59
- 3@EmmadKareem It's not a question of whether you can write a program without side-effects; as you noted, you can do this in Java or C#. It's whether the default is side-effect free, and whether there is compiler support for this. In Java you cannot, for example, tell the compiler "this method doesn't have side effects". This in turn means the compiler cannot warn you when you're breaking the rules!Andres F.– Andres F.2012-09-12 03:27:43 +00:00Commented Sep 12, 2012 at 3:27
- @EmmadKareem I'm not saying it's impossible to write C# or java without side effects (though extremely rare), rather I'm saying that very few programming languages have strict policies built into the language that segregate functions with side effects from those without.Jimmy Hoffa– Jimmy Hoffa2012-09-12 03:34:03 +00:00Commented Sep 12, 2012 at 3:34
- It would be great if Java had a @NoSideEffects annotation to put on a method to tell the compiler to enforce no-side-effects for that method. In my own code I like to think it's common for methods to have no side effects. Sure, some methods have to be mutators in a language like Java, but many don't. Especially if you prefer immutable objects in your designs.GlenPeterson– GlenPeterson2012-09-12 04:08:54 +00:00Commented Sep 12, 2012 at 4:08
- Jimmy Hoffa and @AndresF., thanks for your clarifications.NoChance– NoChance2012-09-12 04:12:14 +00:00Commented Sep 12, 2012 at 4:12
| Show 5 more comments
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. design-patterns), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you