1,753 reputation
1713
bio website
location
age
visits member for 3 years, 6 months
seen Dec 1 at 6:54

Sep
5
comment How can designing for inheritance cause extra cost?
@Ptolemy So you're saying that un-sandboxed code can defeat a sandbox? How is that news?
Sep
5
comment How can designing for inheritance cause extra cost?
@Cawas C#'s CIL is like Java bytecode, and in both cases there are runtime sanity/verification checks as execution begins. These checks include preventing final/sealed violations. Remember, this is about a trusted base platform running untrusted/sandboxed code, not about somebody creating their own hacked platform from scratch.
Sep
4
comment How can designing for inheritance cause extra cost?
@Ptolemy I suggest you re-read my comment. If the class (e.g. String) is immutable, then by definition you can't "use a handle to the same object and make public calls to change its data", can you? All the public calls are read only. The whole point of sealing is to prevent people from changing that!
Sep
4
comment How can designing for inheritance cause extra cost?
If String was unsealed, you could make mutable String instances. If that isn't terrifying, you're not thinking hard enough about how it could be both a source of bugs and a source of security-holes. Sealing is therefore an important feature when it comes to creating the core runtime and libraries, even if it sees limited use at the application-level.
Sep
4
comment How can designing for inheritance cause extra cost?
Also security is a reason to use it! Consider a sandboxed application trying to access a file. The sandbox might test the filename-strings, but what if an attacker could send you a mutable String and then they mutate it after the security-check but before the I/O? I believe that type of scenario is why Java's String is marked final (similar to sealed) and I bet the same logic underpins some C# decisions.
Sep
4
comment How can designing for inheritance cause extra cost?
Also security is a reason to use it! Consider a sandboxed application trying to access a file. The sandbox might test the filename-strings, but what if an attacker could send you a mutable String and then they mutate it after the security-check but before the I/O? I believe that type of scenario is why Java's String is marked final (similar to sealed) and I bet the same logic underpins some C# decisions.
Aug
30
comment Avoiding boilerplate in PHP classes
If you have too many classes, then templates/macros are the answer. If you have too many arguments to a single class' constructor, then it may be time to reconsider how you are creating instances of that class instead.
Aug
30
revised Two components offering the same functionality, required by different dependencies
added 32 characters in body
Aug
30
revised Two components offering the same functionality, required by different dependencies
added 35 characters in body
Aug
30
answered Two components offering the same functionality, required by different dependencies
Jun
6
awarded  Yearling
Oct
5
revised What are some really simple rules to keep a PHP codebase organized?
added 671 characters in body
Oct
4
revised What are some really simple rules to keep a PHP codebase organized?
added 147 characters in body
Oct
4
answered What are some really simple rules to keep a PHP codebase organized?
Jun
15
awarded  Nice Answer
Jun
6
awarded  Yearling
Jun
5
answered Is it bad practice to use <?= tag in PHP
Feb
3
comment Unit-testing of inherently random/non-deterministic algorithms
Regarding the "random table" approach, you can also use a test-implementation that contains a "reversible" number-generating algorithm. This allow you to "rewind" the PRNG or even query it to see what the last N outputs were. It would allow much more in-depth debugging in certain scenarios.
Aug
19
comment How do I transition from a large enterprise to a small startup?
My experience going from "10-person startup" to "300-person company" was great: I could focus on good code instead of being randomized every day with some new emergency or "customers on server X think it is slow" complaint.
Aug
17
answered How do I transition from a large enterprise to a small startup?