Gerenuk
Reputation
1,000
Top tag
Next privilege 2,000 Rep.
 Jun 9 comment Pick highest score sum, but at least X from each region Sounds good. It's about as far as I got, too :) Comparing regions can be done with early cuts too. But it seem in the end one has to try out most subsets of regions. Once you decide on which regions to include, the task becomes easy, of course. Still, would be interesting to know if there is a magic trick to avoid exhaustively checking most sub-selections of regions. Jun 9 comment Pick highest score sum, but at least X from each region How would you decide which region to include in step 3? You cannot take just the left-most highest score, since if you start a new region, you have to pick X at least. Jun 6 comment Pick highest score sum, but at least X from each region Seems valid, but how do you chose between 3a) and 3b)? 3b has X elements and is always larger than a single element from 3a. And is it possible to prove that the biggest sum (no.3) should always be included? Suppose I have X=2 and I want N=3 from `8A,7A,6B,6B,6B,1A`. I should go for 3xB (=18), but the minimum regions for X=2 told me to favor A. Jan 15 comment Is it always a best practice to write a function for anything that needs to repeat twice? Well, to continue one could say a hard-coded list is not going to appear in the middle of code and will be a variable anyway :) But right, I actually forgot that you can skip the braces there. Sep 27 comment Are dynamic languages at disadvantage for agile development? I think this answer addresses the key points of the question best :) Could you also elaborate on the importance of safe refactoring and reverse-engineering for agile development? I was assuming it played a very important role? Maybe it's less than I thought and tools for dynamics language are just good enough. Sep 25 comment Are dynamic languages at disadvantage for agile development? @WinstonEwert: Tools can be more friendly, but even if I wanted to write type inference by myself it would be quite tough?! It can even be impossible if the types are hidden behind logic or the executing code is missing? Type inference does not explode in computation time? I should definitely look at PyPy ideas then. It sounds exciting :) Finally for the actual question, would you agree that agile often requires solid type inference? (irrespectively of language tools) Sep 24 comment Are dynamic languages at disadvantage for agile development? What about reverse engineering then? Is Smalltalk different from Python with regards to typing? It seems a tough problem to deduce all types in Python and thus determine which which method are really identical and not just the same name. Sep 24 comment Are dynamic languages at disadvantage for agile development? @CaffGeek: Some often recommended books suggest to draw diagrams on a whiteboard, then code and finally reverse engineer code into diagrams for the next meeting. Aug 13 comment Sporadic unittests or TDD? OK, but now as you have experience with TDD, can you just do the nice coding and merely imaging you'd unit test? Just pretend you're testing and code such that it would theoretically be testable?! Aug 3 comment Sporadic unittests or TDD? @Kilian Foth: I didn't say I think the code is loosely coupled. I said I think the code is testable. And it's possible to imagine or even check automatically if code is testable. If code is a mess is a different problem. TDD might help you have programmers writing bad code but I do not consider this case. Typical bugs could be a special data combination that for example is missing in some look-up database. And documentation for your own code is easier and even better than plain tests. So unless you deal with weak programmers I don't see an argument for TDD. Aug 2 comment Sporadic unittests or TDD? I seems you do not mention any particular advantage of TDD over full testing? This is basically what I think for the moment. Of course the degree of coverage deserves attention. It seems if I add tests only to all classes I modify and on classes that depend on them, I should catch most bugs. So I would conclude selective testing hasn't been disproven (as compared to close to full testing which is essential in TDD)? Jul 31 comment Software design by pseudocoding? When I just start coding, sometimes later I notice that design-wise I could have factored out some code. While refactoring is OK, it still could have avoided it if I had seen on overview of all the code first and used some creativity. A graphical pseudocode view could present everything in one condensed graph. Is my mistake somewhere else? Jul 31 comment Software design by pseudocoding? @ElYusubov: Thanks for the explanation. It seems you also imply UML is more for presentation? For the actual design I don't put emphasis on it? In the end you propose 3 diagrams. Can they be made 1-to-1 with code to some extend. I mean on the opposite some things which work in diagram might not work with code - that I want to avoid. Jul 25 comment Are there any design patterns that are unnecessary in dynamic languages like Python? Great! That would be a spot on answer :) I wished everyone had grasped the question that clearly. Jul 24 comment Are there any design patterns that are unnecessary in dynamic languages like Python? @Jan: Sure. That's a true sidenote, but you are answering questions that haven't been asked. Nowhere I mention that I plan to construct a program of patterns only. I'm basically asking which pattern I can forget safely. Jul 24 comment Are there any design patterns that are unnecessary in dynamic languages like Python? That's certainly interesting. So which patterns in particular do you mean that one might forget about, because there are better ways in Python? Jul 24 comment Are there any design patterns that are unnecessary in dynamic languages like Python? Strictly speaking I didn't ask which patterns are necessary, but instead which are unnecessary, which is a logical difference. There is a difference between "you never need pattern A" and "you never need all of the pattern". Moreover, patterns provide ideas and a vocabulary. Before knowing patterns I refactored code a few times, and if I had known pattern before, I would have had my final idea earlier. So I wouldn't discredit knowledge about patterns. Jul 5 comment Why did visual programming never take off and what future paradigms might change that? Is this related to programmers.stackexchange.com/questions/152313/…? I believe there is a healthy intermediate language between pure source code lines and drag and drop. A language superior to both approaches. Jun 15 comment faster algorithm for finding all subsets @john: You a) didn't understand my algorithm written in non-technical terms which is exactly what you propose; and b) you still haven't solved the practical question of returning sets and not some encoded representation. Tech-talk alone is fruit-less. Jun 15 comment faster algorithm for finding all subsets I'd use an integer counter. In each iteration you iterate over all bits by checking if the number is odd/even and then you shift bits to the right (like divide by 2) and check again. This way you iterate over all bits of the counter and decide whether to include a particular element or not. The rest is up to you to find out ;)