8,970 reputation
63681
bio website
location
age
visits member for 3 years, 6 months
seen 4 hours ago

0x2B | ~0x2B


1d
comment Why lambda/closures expressions came so late to C++?
@ThomasEding: Maybe the concept of a closure has been adapted lately to accommodate the C++ view. In the commonly accepted notion a closure extends the lifetime of captured variables. See e.g. the discussion under "Implementation and theory" in en.wikipedia.org/wiki/Closure_(computer_programming)
1d
comment JUnit3 and JUnit4 in the same project (but different module)?
What do you mean by end-of-life? If a framework is mature and does not need maintenance, everybody is free to use it as long as it fits their needs.
1d
reviewed Leave Open What natural language has the advantage when it comes to programming?
1d
reviewed Leave Open Need an example of a real backlog task or how elaborate must it be?
1d
reviewed Leave Open Reducing Valgrind Findings (uninitialised value)?
1d
reviewed Leave Open Is checking return values always required?
1d
comment Why lambda/closures expressions came so late to C++?
@Jörg W Mittag: I am not sure if they did much research related to RAII and closures. AFAIK, in C++ a closure works somewhat like an object that captures variables passed to its constructor and assigns them to its fields. If such variables are passed by reference, then the fields will point to invalid memory locations as soon as these variables have been disposed of. Then, invoking a method on that object that accesses those fields can crash the program. A closure that captures expired variables will have a similar behaviour. IMO the safest approach it to capture only smart pointers.
1d
comment Why lambda/closures expressions came so late to C++?
@Doval: "a closure forces the variables that were closed over to stay alive for as long as the function does": This is true in most languages: you can capture a variable from its lexical scope and keep it alive as long as the closure lives. In C++ it is different: if you capture a stack variable by reference and invoke the closure after you have exited the parent function, you get a crash. So, with C++ you cannot do common FP tricks that involve passing closures around at will: you can easily cause a core dump if you are not careful enough.
1d
comment Why lambda/closures expressions came so late to C++?
@DeadMG: C++ lambdas are more general than Delphi's but also less safe: they can crash the program if invoked too late, which is against the common intuition closures have in most other programming languages. But without a garbage collector in place you either have unsafe closures (C++) or restricted ones (Delphi). See also programmers.stackexchange.com/questions/189856/…
1d
comment Why lambda/closures expressions came so late to C++?
Closures have become popular in recent years thanks to languages like JavaScript and maybe C#, and to the FP-hype (I am a big fan of FP, but IMO there is also a FP-hype going on). IMHO they are out of place in C++, and they are difficult to get right, but everybody must have closures nowadays.
2d
comment Functional programming for loop side effect
+1. Among the advantages of using high-order functions such as takeWhile, fold, filter, map, (i.e. declarative style) is that you also stop thinking in terms of "Compute something by destructively updating memory locations". In this way, the result does not depend on the history / exact sequence of the computation steps.
Dec
23
comment Non-Object Oriented Programming in Object Oriented Language
"It doesn't mean if you use non OOP approach you can never upgrade your project but then it would be a tedious thing to do.": OOP helps to extend your project when most extensions involve adding new classes (e.g. adding new widgets to a GUI). When most extensions involve adding new operations, then a procedural design can be more effective.
Dec
23
comment Why is *declaration* of data and functions necessary in C language, when the definition is written at the end of the source code?
@user31782: Writing a small snippet and compiling it with -S (if you are using gcc) will allow you to look at the assembly code generated by the compiler. Then you can have an idea of how return-values are handled at run-time (normally using a processor register, or some space on the program stack).
Dec
22
comment Is there a stronger stress on management than on technical education in recent years?
@Doc Brown: The argumentation in Spolsky's article does not look too far from my observation: Instead of training developers to improve their thinking, companies train them to organize their work better. Of course, I find both aspects very important, I just find it curious that one is privileged. Maybe it was discovered that it is more efficient to improve management than to improve education. I would like to know if there are studies about this, or a school of thought that promotes this.
Dec
22
comment Is there a stronger stress on management than on technical education in recent years?
Suppose I have problem X and ask for advice. A methodology answer would be: try to implement a solution using TDD or BDD. A conceptual answer would be: look at streams / lazy lists, you will probably find a suitable solution. Approach 1 suggests a solution method, approach 2 suggests an abstraction that can solve the problem. My feeling is that in the recent years developers tend to look more for better solution methods than for better programming abstractions / concepts.
Dec
22
comment Is there a stronger stress on management than on technical education in recent years?
@rwong: Another very interesting reading. Thanks! No, I was not referring to it. I am referring that I happen to discuss more often about the how to organize my work (e.g. upfront design versus incremental design, or using design diagrams versus not using them, use TDD versus writing tests in a less systematic way) than about which programming techniques to use (e.g. use a memoizer, use a lazy list, avoid mutability, etc).
Dec
22
comment Is there a stronger stress on management than on technical education in recent years?
So your thesis is that "software engineering (organizational) aspects are considered more important for software development than "computer science" (technical) ones?
Dec
22
comment Is there a stronger stress on management than on technical education in recent years?
Thanks for the interesting references, but I do not understand how they relate to my question. Do you mean that we are in phase 2 for some new software engineering ideas, and therefore other aspects of programming are temporarily considered less important?
Dec
22
asked Is there a stronger stress on management than on technical education in recent years?
Dec
22
revised Implementing internal own authentication
edited title