Timeline for Is template "metaprogramming" in Java a good idea?
Current License: CC BY-SA 3.0
28 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 8, 2017 at 7:42 | comment | added | eis | @Neil I don't see the question saying it's about a (web)site. Java is used in a lot of contexts, embedded devices being one highly popular one. It might be doing just calculations, graphics processing, pretty much anything. | |
Apr 27, 2015 at 7:36 | answer | added | Display Name | timeline score: 0 | |
Jul 5, 2014 at 17:19 | history | tweeted | twitter.com/#!/StackProgrammer/status/485473067356131328 | ||
Jul 1, 2014 at 8:37 | comment | added | Neil | If it has come down to creating 12 variants of a method because it is called millions of times, something is seriously wrong here. Only sites like facebook receive millions of requests per second, and believe me, they do not throw it all on a single server and hope for the best. If the program is this fragile, then it is not a question of if but rather a question of when the overloading of this machine will be too much. There needs to be a systems administrator solution to this problem, not a programmer solution, assuming optimizations cannot be made in the program elsewhere. | |
Jul 1, 2014 at 6:54 | answer | added | Dr. Hans-Peter Störr | timeline score: 1 | |
Jun 29, 2014 at 14:05 | history | protected | gnat | ||
Jun 29, 2014 at 7:30 | answer | added | randomA | timeline score: 1 | |
Jun 25, 2014 at 12:49 | comment | added | SJuan76 |
To use the function, one specifies the "mode" and "paradigm" of operation. While without information enough to be sure, that phrase smells of "you should be using combination here" (v.g., one instance of a family of classes that define the "mode" behavior, and another of a different family that defines the "paradigm" behavior). Of course, without seeing the code it is just a guess.
|
|
Jun 25, 2014 at 11:06 | comment | added | Bakuriu |
" if they modify instead the programmatically-generated file"... create the file only when building from the "Makefile " (or whatever system you use) and remove it right aftter compilation finished. In this way they simply don't have a chance to modify the wrong source file.
|
|
Jun 25, 2014 at 5:53 | comment | added | user949300 | Naming the functions func1 ... func12 seems insane. At least name them mode1Par2 etc... or maybe myFuncM3P2. | |
Jun 25, 2014 at 5:21 | comment | added | hyde | Indeed, assuming there is a performance benefit now, without measuring is folly. Your goal could be, make sure code gets inlined and optimized by JIT. Another thing is, if it works and doesn't need maintenance, don't fix it. | |
Jun 25, 2014 at 1:31 | comment | added | Fengyang Wang | Thanks for the answers folks—consensus seems to be "do more tests", especially apropos profiling. I guess there's no easy way around that. Rewriting parts of it to be more conductive to modular testing is overdue anyways, and will be useful for other things too. I'll keep the tools you all suggested in mind. Again, thanks for all the help! | |
Jun 25, 2014 at 0:34 | answer | added | maaartinus | timeline score: 2 | |
Jun 24, 2014 at 20:47 | answer | added | user138623 | timeline score: -2 | |
Jun 24, 2014 at 20:18 | comment | added | Robert Harvey | This could sounds like it could have benefited from some parametric polymorphism (or maybe even generics), rather than calling each function by a different name. | |
Jun 24, 2014 at 20:04 | answer | added | Shivan Dragon | timeline score: 10 | |
Jun 24, 2014 at 18:36 | review | Close votes | |||
Jun 25, 2014 at 10:33 | |||||
Jun 24, 2014 at 18:29 | answer | added | mjfgates | timeline score: -1 | |
Jun 24, 2014 at 18:26 | vote | accept | Fengyang Wang | ||
Jun 24, 2014 at 18:16 | answer | added | Ordous | timeline score: 22 | |
Jun 24, 2014 at 18:16 | review | First posts | |||
Jun 24, 2014 at 20:21 | |||||
Jun 24, 2014 at 18:16 | answer | added | Mike Dunlavey | timeline score: 16 | |
Jun 24, 2014 at 18:14 | answer | added | Peter Smith | timeline score: 6 | |
Jun 24, 2014 at 18:14 | history | edited | Fengyang Wang | CC BY-SA 3.0 |
elaborate
|
Jun 24, 2014 at 18:11 | comment | added | FrustratedWithFormsDesigner | Then I think you need to do your own tests (I know you said profiling is tricky, but you can still do rough "black-box" performance tests of the system as a whole, right?) to see just how big a difference there is. And if it's noticable, then I think you might be stuck with the code generator. | |
Jun 24, 2014 at 18:10 | comment | added | Fengyang Wang | The old maintainer has convinced me that it would, despite some reluctance at first to believe several conditionals would slow things significantly. Refactoring would be easy since the original function still exists. | |
Jun 24, 2014 at 18:06 | comment | added | FrustratedWithFormsDesigner | If the performance hit is serious enough to warrant 12 versions of the function, then you might be stuck with it. If you refactor to a single function (or use generics), would the performance hit be bad enough that you'll lose customers and business? | |
Jun 24, 2014 at 18:00 | history | asked | Fengyang Wang | CC BY-SA 3.0 |