6,474 reputation
32047
bio website
location Poland
age 33
visits member for 3 years, 6 months
seen yesterday

Software engineer with a few years of professional experience, skilled in C# and Java (I've done some work in PHP as well). Microsoft Certified Technology Specialist in Windows applications.

Also active on: http://stackoverflow.com/users/168719/konrad-morawski

My profile on LinkedIn: http://pl.linkedin.com/pub/konrad-morawski/a6/129/b07


Polish equivalent to StackOverflow: http://devpytania.pl/

My profile there: http://devpytania.pl/users/1672/konrad-morawski


Dec
24
comment Development on Android without using Java
@FaizanRabbani well, Kotlin is not supported by Android out of the box, but it interops with Java, so it is a native app after all - while that's not the case of Ionic or PhoneGap. If you don't even like the fact that you need Kotlin compiler & plugin for this to work, then well, the choice is pretty narrow, and it's only Java for SDK. You can use C++, too, but that's for NDK and not for typical software development. As the official docs put it: "In general, you should only use the NDK if it is essential to your app—never because you simply prefer to program in C/C++" - bit.ly/1fSbhs8
Dec
24
comment Development on Android without using Java
@FaizanRabbani from the scratch in what sense?
Dec
24
comment Development on Android without using Java
Noone can tell you 100% :) Out of my experience, it works all right, but I encountered some class loader problem trying to run a unit test that used both Kotlin and Realm.io. Realm works as an annotation processor, so there must have been some nasty interference between both. This sort of stuff. Regular unit tests were fine. In other words, it seems to work fine for the standard technology stack, but if you need some specific framework or a lib, better make sure that it plays nicely with Kotlin. I would prototype the app first. What is one man's edge case, could be a dealbreaker for another.
Dec
24
revised Development on Android without using Java
added 650 characters in body
Dec
24
revised Development on Android without using Java
added 650 characters in body
Dec
24
answered Development on Android without using Java
Dec
24
comment How do you unit test a function that clears properties?
@DocBrown but what follows immediately after this rhetorical question is: I guess we'd wish to have it in order to (...). And thanks. Well, that's the problem about this type of tests: since they have to mirror the implementation in order to work in the first place, they're not that much of a safety net
Dec
24
comment How do you unit test a function that clears properties?
@DocBrown sure thing. Btw I didn't write it in a mean or patronizing way, just to clarify ;) I could have mentioned the source of this notion in my answer, but there were only two at the time and it seemed much more visible than now...
Dec
24
comment How do you unit test a function that clears properties?
@MaurycyZarzycki I wrote that tests should cover logic. That's the basic litmus test of whether something should be unit tested (and that's not my original idea, but one coming from reputed experts such as Roy Osherove). I never wrote the reverse: that just because some code doesn't contain conditional statements, testing it is of no use. In fact, right now I'm writing unit tests verifying corectness of some raw SQL :) (for an Android project that can't use an ORM, because of some non-standard requirements about the db it uses)
Dec
24
comment How do you unit test a function that clears properties?
@MaurycyZarzycki - "at the very least a simple unit test will protect you from accidentally modifying any established functionality" - did I not acknowledge that in my answer? "I guess we'd wish to have it [the test] in order to protect ourselves against the scenario in which you're adding another property to the class, but then forget to reset it in your reset function." I don't mind a downvote, there's no pleasing everyone, but it seems that at best you've only skim read my answer.
Dec
24
comment How do you unit test a function that clears properties?
@DocBrown ctrl + F and "singleton" would quickly reveal where I got this crazy singleton idea from :) Not in the code above, but the OP mentions this contraint in comments under Cramps's answer: "My example may have been a little too simplistic, but the object is a singleton (Angular service) that is injected into multiple controllers"
Dec
23
answered How do you unit test a function that clears properties?
Dec
23
comment How do you unit test a function that clears properties?
...because of the dogma that unit tests should only have 1 assertion - that's a bit over the top in my opinion. I'd say that unit test should - preferably - only have assertions that verify one type, or one aspect of behavior (and not just everything one could think of). It ensures that one bug doesn't hide other bugs. But it doesn't mean that there must be literally one assertion per test and no more.
Dec
21
comment readability vs shorter code in returning from function
Further, the first isn't any more readable - well that's opinion-based again, personally I do often find it more readable, depending on the context of course. Also it's somewhat more convenient for debugging; I can set a breakpoint and preview the returned result more easily.
Dec
19
comment Unit testing and reality
It's a good question and valid concerns (though I didn't understand the last bit about string transformation), but while I didn't downvote, I flagged it for closing. Why? 1. I feel that it's way too broad (at the very least there's two questions asked at once, each of them deserving a book) 2. It's so basic and generic that it has been already tackled many times on this website. I would suggest that you search for similar questions (and answers) here, read up, and then get back to the subject with more specific doubts, like, perhaps, focusing closer on your mocking example.
Dec
18
comment Are all magic numbers created the same?
@Mehrdad: Mathematical constants can't change - that's true, although sometimes the precision of their approximation can change. That's why we typically use a Pi constant rather than 3.14, or 3.14159 or... yeah, that's the point :)
Dec
12
comment Productivity using .Net WPF for large ERP (LOB) desktop applicatons ~1500 forms\dialogs
@M.Dudley we can agree to disagree. I worked with WPF for three years; I could never get over how needlessly complicated it is, or its use of magic strings (resulting in lack of type safety and weirdest exceptions), or having to repaste the whole control template to modify the view of a standard control, or... Paul Stovell doesn't really have a monopoly to notice these shortcomings. That's just one example: stackoverflow.com/a/4120034/168719 - see the title of the question and what the highest voted answer is :) I said it all in my comment below it.
Dec
11
comment Productivity using .Net WPF for large ERP (LOB) desktop applicatons ~1500 forms\dialogs
While WinForms is obsolete, I would say that XAML is half-baked and actually rather awful; as somebody put it, it makes the hard trivial and the trivial hard : ) And what's worse, it is not improving: paulstovell.com/blog/six-years-of-wpf
Dec
8
reviewed Approve Why is the hashCode method usage of HashSet not specified in the API?
Dec
7
revised Adding non distinct elements to a dictionary
added 91 characters in body