356 reputation
18
bio website phresnel.org
location
age
visits member for 3 years, 6 months
seen 3 hours ago

"Clean code is strange. It costs you nothing, yet it pays back doubly and triply."

quote me and make this famous, damn

"I made strange code But surprisingly it works"

user3402740 (catch string vlaue c++) [are you user3402740 and want another name placed below the quote? contact me!]


Do not post "Try this:"-answers. Rather write "That's because ..."-answers.

"Try this:"-answers are either lies, because the answerer knows what it/she/he posted is working, but misuses the word "try"; or they indicate inprecision or lazyness on the answerer side. However, they always indicate a lack of empathy and foresight.

The hints may or may not work, but usually only help for the moment, but not in the future, when the questioner asks a related question she or he doesn't even recognize as related.


Give a man a fish, you feed him for a day; teach a man to fish, you feed him for life.


Jul
24
answered How should I remember what I was doing and why on a project 3 months back?
Jun
24
comment Is there a benefit in compiling your code as you go along?
Hmm. Just want to say that a well written C++ file should not take more than a few seconds for compilation. If it's longer, it's a smell for bad code. And if it's so big that make has problems, I would argue that the application is too monolithic. "My" make never had problems, and afair not even when compiling Linux.
Jun
13
comment Is there a more intelligent way to do this besides a long chain of if statements or switch?
@jwenting: Is it relevant? But even if: One can construct valid examples, like for example a Java/C#-Interop Helper Library, or have a look at Java for .net: ikvm.net . The language is always relevant. The questioner may not be looking for specific languages, he/she may have committed syntax errors (accidentally converting Java to C#, e.g.), new languages may arise (or have risen out the in the wild, where there be dragons) -- edit: My previous comments were to dicky, sorry.
Jun
13
comment Is there a more intelligent way to do this besides a long chain of if statements or switch?
@jwenting: It's also valid C# syntax, and I bet there are more languages.
Jun
13
comment How can my team avoid frequent errors after refactoring?
Ironically, if the Refactoring book by Fowler is read properly, one knows that testing is an integral part of Refactoring.
May
3
comment How can I learn to effectively write Pythonic code?
I would argue that your specific sorting example is not pythonic. Why reintroduce reordering with a lambda if you can just print(sorted(l, reverse=True)), which additionally explicitly tells the reader what's going on. I would find your first example disputable, too. It's two assignments compressed into one; it's okay, but I wouldn't call it very Pythonic. Readers have to look longer at what it does than compared to having two assignments.
Mar
31
comment Not getting paid for hours you've worked?
Considering your use of secret abrevations, there was a certain chance that I am right :P
Mar
30
comment Not getting paid for hours you've worked?
Thanks! It's sometimes not easy to follow all abbreviations of you native english folks.
Mar
21
comment Is better Show() + Hide() or SetVisible(bool visible)?
C++ does not have properties, but it does have free functions, so you can extend the class interface without adding new member functions, i.e. with a lower degree of coupling.
Mar
5
comment What are the problems of bringing C++-like const into a language?
@RobY: Lol :) I actually only recently began introducing JavaScript and some of those frameworks into my toolbox to pimp up my portfolio. It actually came to my surprise I didn't dislike it, and that I even liked it. Prototyping really makes for, well, rapid prototyping; as does weak typing and such :D
Mar
5
comment What are the problems of bringing C++-like const into a language?
@RobY: I love both systems, actually. Python and C++ are too different in their idioms, I love both. I also love the Haskell way. I have good arguments for and against all systems, but this would blow this comment section. // after reading your comment: Imagine my face red coloured :D Yours, however, is impressive, too.
Mar
5
comment What are the problems of bringing C++-like const into a language?
@RobY: I realise you were not talking about mixing C and C++, but just C in itself. I am afraid I have not enough knowledge about C const to debate with you :)
Mar
5
comment What are the problems of bringing C++-like const into a language?
@RobY: You have to trust the API documentation and use const_cast, iff it tells you it won't update the object (for that exact reason, const_cast was introduced). const_casting just for fun and modifying the object then leads to undefined behaviour, if applied upon an object that was declared const. If you cannot trust an API, or if you have a policy of forbidding const_cast altogether, introduce local copies. That's another reason for having nicely separated units and working bottom-up.
Mar
5
comment What are the problems of bringing C++-like const into a language?
@RobY: I am not sure what/whom you are addressing with latter and former. However: After that afternoon walking through the code, you should have learned you should refactor to const-correctness bottom-up, not top-down, i.e. start in the innermost units, and work your way up. Maybe your units were also not isolated enough, instead being tightly coupled, or you've fallen prey of inner systems.
Mar
5
comment When am I justified in using a License?
@JohnGaughan: I agree with the ideal here, but I would think "for learning purposes" is just too broad. E.g., I could study some code over and over, and then just rewrite it for my evil commercial app.
Mar
5
comment Are compilers used outside of development?
@Jan: That's nice. Your definition of developer makes half of my family Real Software Developers.
Mar
5
comment What happens if computer crashes after giving commit command
I would have added "If the transaction is neither complete nor naught, the DBMS is simply not ACID compliant", otherwise +1.
Mar
5
comment What are the problems of bringing C++-like const into a language?
Your second bullet is not correct. In C++, there are three/four ways to declare a reference/pointer, wrt. constness: int * mutable pointer to mutable value, int const * mutable pointer to const value, int * const const pointer to mutable value, int const * const const pointer to const value.
Feb
26
comment Why are scientific programming languages so weird?
@Gangnus: I finally realise there is a thin line between pure maths and pure information science, if any. I accept your initial suggestion regarding secondary school math; thx for my This Week's Enlightenment :) Really interesting to see a mathematical definition of assignment (I am not sure if we should remove comments; they contain some very valuable informations and misconceptions)
Feb
25
comment Why are scientific programming languages so weird?
@Gangnus: Actually I know these. However, I fail to see how 'S → ...' is equivalent to a mutation-assignment. I see them more as a set of rules, such that when you apply S -> SS upon Foobar, we get FoobarFoobar, yet the rule itself is still the same. They transform the input, but themselves remain unchanged.