How do you decide whether to use a library or write your own implementation

General Decision Before deciding on what to use, I will create a list of criteria that must be met by the library. This could include size, simplicity, integration points, speed, problem complexity, dependencies, external constraints, and license. Depending on the situation the factors involved in making the decision will differ. Generally, I will hunt for … Read more

Clean architecture – where to put input validation logic? [closed]

I think many developers do that in Presentation layer, specifically in ViewModel/Presenter/Controller (not in Activity/Fragment/View!). My approach is to put that logic in Domain layer. Why? Is it presentation logic or domain logic? Presentation logic is something you decide “mapping render model”, “format of render model”, “how to render”, “what color, what size, which text”, … Read more

The “Should be easy for a junior developer to understand” argument [closed]

I highly disagree. Junior developers will end up being Senior developers. How? By encountering advanced topics that aren’t taught in school. My code base now makes heavy use of Inversion of Control containers. I would never revert my code to the old way because a junior developer had issues groking IoC. Instead I would take … Read more

SVG: Use Attributes or CSS to style?

I arrived here because I was trying to remember whether attributes or styles have greater precedence. This is one practical reason why you’d want one over another. Attributes get applied as “presentation hints”, as if they were the first of the cascading style sheets. In other words, this gives them lowest precedence. Thus the precedence, … Read more

How to customize / style a UIPopoverController

This is possible starting in iOS 5.0 by subclassing the abstract class UIPopoverBackgroundView and assigning your subclass to the popoverBackgroundViewClass property on your UIPopoverController instance. Unfortunately there is no tintColor property as the popover needs to use images for it’s arrow and border in order to achieve smooth animations during dynamic resizing. You can learn … Read more

Tabs vs Space indentation [closed]

Getting tabs to look right depends heavily on the configuration/choices of all the software the source code might be displayed or printed by. If you have a restricted set of such software and find that’s not a practical problem for you, that’s great – go for it if you see value. But, be aware that … Read more

What kind of prefix do you use for member variables?

No doubt, it’s essential for understanding code to give member variables a prefix so that they can easily be distinguished from “normal” variables. I dispute this claim. It’s not the least bit necessary if you have half-decent syntax highlighting. A good IDE can let you write your code in readable English, and can show you … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)