11,428 reputation
11953
bio website
location Germany
age 21
visits member for 1 year, 11 months
seen Jul 6 at 14:06

Just another {Perl,Java,Python,Scala} hacker.

AFK until August.


May
20
awarded  Nice Answer
May
19
awarded  Nice Answer
May
18
answered Should I implement a function or a method?
May
18
answered Japanese Multiplication simulation - is a program actually capable of improving calculation speed?
May
17
comment Why is Java not 'pure' OOP?
you'd have to tell which types were primitive and which were not” – that's not a problem, because that would be a property of the type. The actual problem is which values are primitives (see your point about vtables). “you'd also have to ban inheriting from these” – again, not a problem: many languages incl. Java feature “final” or “sealed” classes that can't be inherited. “garbage collection” – primitives usually have immutable value type semantics, which means copies can be made at any occasion (like function calls). Remember: Java doesn't have pointers.
May
17
answered Why is Java not 'pure' OOP?
May
17
comment MVC 5 - Best practice for handling dates inside and outside the USA
Very relevant: en.wikipedia.org/wiki/Date_format_by_country – so figure out the user's locale and switch to the appropriate format (with a clear visual indication of the format you're expecting). Or just follow the ISO 8601 standard – it's the international standard for good reasons. Or sidestep the issue via a graphical date picker that does not require textual input.
May
17
comment Using a Simple/Static Factory vs. instantiating directly: new Thing() vs. factory.createThing() - what's the benefit?
@Prog Explicit instantiation should not be part of the API of a library – offer factory methods instead. This doesn't add much complexity but (if done correctly) saves you from having to deprecate classes in future versions. Internally, do whatever you like – you can always refactor this without changing the interface. You might still end up using some form of dependency injection – either in the form of constructor injection (which doesn't scale) or a full-blown factory (which isn't that much boilerplate). On the other hand, you probably ain't gonna need it.
May
17
comment Type Safety of Spray.io
See “Discuss this ${blog}” on meta for why this question doesn't seem to be a good fit here.
May
17
answered Using a Simple/Static Factory vs. instantiating directly: new Thing() vs. factory.createThing() - what's the benefit?
May
17
reviewed Leave Open Calling static method from instance of class
May
17
answered Calling static method from instance of class
May
16
comment What language do companies like NASA use to create their applications?
@HarryKitchener Not all programming has to do with GUIs. When I started learning to program I made some windowed applications with Java, but soon found the stuff behind the chrome to be more interesting. If I need an interface, I'll mostly offer a text-based interface via the command line or through a web page, as they are easier to implement.
May
15
awarded  Nice Answer
May
14
answered Lexer/Parser for multidimensional Languages
May
13
comment Do markup languages ​​have the equivalent concept of `semantics` that you can find in C or C++?
@user2485710 Required reading: The Chomsky Hierarchy, which explains different classes of grammars. Follow the links if you're unclear about a term.
May
13
comment Do markup languages ​​have the equivalent concept of `semantics` that you can find in C or C++?
@user2485710 a TeX document can change how it's lexed and parsed, so I think it's in the most complex class of grammars: Recursively Enumerable. In Markdown, indentation is relevant which makes it context-sensitive. This is also true for Python. However, indentation-sensitive languages can often pull a trick in the lexer to appear as if they were context-free. The nested brace language allows terms like ([]()) but not ([)]. It can be given by S -> '(' S ')' | '[' S ']' | S S | ''. This is context-free because the left side of the rule S -> ... only has one symbol.
May
13
comment Do markup languages ​​have the equivalent concept of `semantics` that you can find in C or C++?
@user2485710 grammars/languages can be classified by how complicated they are syntactically. Regular Languages are the most simple, and can be parsed by a simple state machine. Number formats such as 123.40E2 are an example. Context-Free Languages are more complicated, but they can be described by simple rules. Nested braces (()[{}]) are an example of such a language. Most programming languages use a pseudo-context-free grammar. Parsing rules in Context Sensitive Languages have to take surrounding rules into account. In English the indefinite article a/an is context sensitive.
May
12
comment Should I use initializer blocks in Java?
@SimonBarker look again – the { doStuff(); } on the class level is an initializer block.
May
12
answered Should event listeners be held in weak references?