220 reputation
17
bio website
location Bratislava, Slovakia
age 30
visits member for 3 years, 2 months
seen Oct 10 at 21:22

Oct
4
comment Is creating subclasses for specific instances a bad practice?
@supercat – And I'm really not sure what you're trying to accomplish. It's not like I can go and get the OCP cancelled :D
Oct
4
comment Is creating subclasses for specific instances a bad practice?
Okay, but if you go with an argument based on "breaking the contract is technically possible anyway", then the only design principle you will ever need is throwing your hands up in disgust and going "bleep all y'all". And I'm not sure what I'm supposed to do with these contrived hypotheticals where your approach is "useful". Clearly you're not going to lose sleep over violating the OCP in that case, and I'm not going to lose sleep over you doing so either. (And I can hardly propose my own solution for a problem that vague, especially expecting you to just contrive of another complication.)
Oct
3
comment Is creating subclasses for specific instances a bad practice?
@supercat I won't argue "easier", but that doesn't necessarily mean it's "better" from a more rigorous standpoint. It might be common, but it seems like a violation of the OCP as the rule stands. (I'm not saying you're a bad coder if you don't follow all these principles slavishly, but they're backed by fairly solid reasoning.) And that pattern seems vaguely smelly / lazy to me – if the base class' implementation must be called, then the base class should ensure it does. If it's optional, perhaps the base class should instead be some sort of collaborator.
Oct
1
awarded  Commentator
Oct
1
comment Is creating subclasses for specific instances a bad practice?
@BenAaronson I'd say having virtual members that have an actual implementation is such a violation. Abstract members, or say methods that do nothing, would be valid extension points. Basically, when you look at the code of a base class, you know that it's going to run as-is, instead of every non-final method being a candidate for being replaced with something entirely different. Or to put it differently: the ways by which an inheriting class can affect the behaviour of the base class will be explicit, and constrained to being "additive".
Sep
11
comment How to deal with system “static” data in java
Extending a class just to get some "constants" is terrible practice. It's an abuse of inheritance and makes it harder to, say, use different values in a test environment.
Sep
11
comment How to deal with system “static” data in java
A configuration file, and/or a Configuration class - a shared instance of which is passed wherever needed. (Or both, initialise your Configuration class by reading a configuration file.)
May
14
comment Standard Java Error Reporting
@DavidWallace cat ~/Library/Logs/** /var/log/** /Library/Logs/** | xz | wc -c tells me all the logs produced on my system since whenever I bothered to nuke them compress down into 5MB. The user can live with whatever you produce. And standard practice is to funnel them into logs and inspect those whenever necessary, but if you're trying to roll your own integrated error reporting solution you're obviously not in a standard situation.
Oct
22
comment Ways to ensure unique instances of a class?
I'm reminded of this C++ FQA quote: "This tells us something about the intellectual diet of people calling trivial combinations of basic language constructs 'strategies' and 'patterns'." You need a function. This function will check some collection of previously created Xs and return one of those or create and return a new one or an exception. Seeing as you already know this much, I fail to see how asking for an enumeration of the various names for the same is productive.
Oct
14
awarded  Yearling
Feb
2
awarded  Nice Answer
Jan
24
awarded  Excavator
Jan
24
comment IDEs for dynamic languages - how far can you get?
Not sure about the overarching question, but you might want to take a look at the JetBrains IDEs. Their approach is "we already have a great IDE, let's make it work for $LANGUAGE". The problem with the ones you tried might have been taking the following approach instead: "$LANGUAGE doesn't have an IDE, someone should make one".
Jan
24
awarded  Critic
Oct
25
awarded  Editor
Oct
25
revised Newbie seeking advice on programming in general
added 841 characters in body
Oct
25
comment Newbie seeking advice on programming in general
Also, working on brand new systems isn't necessarily all it's cracked to be. Bugfixing might be frustrating, but it has a lot of advantages: what you should be doing is much clearer, the deadlines are more relaxed, and you learn how to work with others' code which is very valuable.
Oct
25
answered Newbie seeking advice on programming in general
Oct
22
comment Collaborative coding chat options
Since when does Skype not work on Linux?
Oct
14
comment What can I do to keep my skills sharp without the internet?
In general, "start a pet project" is also a good suggestion, if you can come up with one that won't require third-party libraries. Especially one with a different scope than what your day job requires. However, I wouldn't combine it with "learning a new technology", especially not Rails, because you could get stuck/frustrated without community support. Something with an obvious comprehensive body of documentation like dotnetland or iOS might be a better pick.