| bio | website | |
|---|---|---|
| location | ||
| age | ||
| visits | member for | 1 year, 11 months |
| seen | 6 hours ago | |
| stats | profile views | 19 |
|
Jan 16 |
comment |
Is it a good idea to provide different function signatures that do the same thing? Kind of a duplicate of my question here (I now agree that it's a bad idea). |
|
Jan 16 |
comment |
I hate one of our coding standards and it drives me insane, how to process it? While I personally agree with your preference, this is really just a trivial detail that's not worth discussing at all. At least it is trivial assuming you're writing in a "normal" procedural/OO style; things look rather different if you make heavy use of very small local functions, which usually only makes sense in the form of lambdas. If supported at all, I reckon your standard doesn't forbid "inlining" the opening brace for those, does it? |
|
Dec 30 |
comment |
Why aren't user-defined operators more common? @dimatura: I don't know much about R, but it's custom operators still don't seem very flexible (e.g. no proper way do define fixity, scope, overloading etc.), which explains why they aren't used much. That's different in other languages, certainly in Haskell which uses custom infix operators a great lot. Another example of a procedural language with reasonably custom-infix support is Nimrod, and of course Perl also allows them. |
|
Sep 19 |
comment |
How can I really master a programming language? It's probably true that no one can really master a language like C++, but for somewhat minimalistic ones like Scheme it should be quite possible — as @SK-logic says, it's really the programming, in whatever language, that cannot be mastered, because the field of applications is infinite. |
|
Sep 6 |
comment |
Why is the concept of lazy evaluation useful? You need to stop thinking about "executing code" and start thinking of "calculating results", for that's what you really want in most interesting problems. Of course programs usually also need to interact with the environment in some way, but that can often be reduced to a small part of the code. For the rest, you can work purely functional, and there lazyness can make reasoning a lot simpler. |
|
Sep 3 |
comment |
Specific reasons for still using Subversion? A Git tutorial with homeomorphic endofunctors mapping submanifolds of a Hilbert space? I need to read that! But doesn't this rather apply to Darcs, which is written in Haskell (which I reckon endofunctor refers to) and inspired by quantum mechanics (hence Hilbert space)? I really can't see what Git and HG have to do with these things. |
|
Aug 5 |
comment |
What backs up the claim that C++ can be faster than a JVM or CLR with JIT? Not necessarily the end user, just the person responsible for installing the program. On the desktop and mobile devices, that typically is the end user, but these aren't the only applications there are, certainly not the most performance-critical ones. And you don't really need to be a programmer to build a program from source, if it has properly written build scripts like all good free / open software projects do. |
|
Aug 5 |
comment |
What backs up the claim that C++ can be faster than a JVM or CLR with JIT? "compiler optimizations that are appropriate for one machine may be completely wrong for another" Well, that's not really to blame on the language. Truely performance-critical code can be compiled separately for each machine it will run on, which is a no-brainer if you compile locally from source ( -march=native). — "it's a lower level of abstraction" isn't really true. C++ uses just as high-level abstractions as Java (or, in fact, higher ones: functional programming? template metaprogramming?), it just implements the abstractions less "cleanly" than Java does. |
|
Jul 2 |
comment |
Is it worth to learn Experimental Languages? Not that I would disapprove of learning D, but to someone who already knows statically typed, OO and procedural, non-low-level languages it's certainly worth more to learn a language that emphasises a different paradigm or is a bit closer to the metal. There's not much experimental about D, either. |
|
Jul 2 |
comment |
Is it worth to learn Experimental Languages? Where did you get "Haskell and ... have lost their popularity" from? |
|
Jun 27 |
awarded | Yearling |
|
Jun 12 |
answered | Is it ok to replace optimized code with readable code? |
|
Jun 7 |
comment |
If immutable objects are good, why do people keep creating mutable objects? Why do people keep using the Java language at all, if it is on one hand ridiculously uncompromising about "good style" of pure OO but does very little to even encourage style decisions that would really be useful, such as not using mutable state? |
|
May 27 |
comment |
Checking for emptiness of collections with (in)equalities - what's the best practice? For "<0"? Seriously? That pollutes your code with lots of branches that will most likely never be taken. |
|
May 25 |
comment |
Checking for emptiness of collections with (in)equalities - what's the best practice? For some containers an IsEmpty approach is not just faster than .Length == – the latter may actually be impossible! For instance in the case of lazy lists, which can be infinite. |
|
May 4 |
comment |
Is it bad practice to name an unused variable with a single underscore? "how do you know which one" you don't: that's exactly the point, you don't use the variable. So it also doesn't matter if _ is already used in an outer scope; that one will then be shadowed (or whatever your language does in such cases), but none of them is actually used anyway. |
|
May 4 |
comment |
Is it bad practice to name an unused variable with a single underscore? If you use it for filtering multiple returns, then it's just consequent to also use it for dummy function arguments. In fact, there's not much difference between the two: in pattern-matching functional languages, you may write let (a,b,_) = f(x,y,z) just as well as let f(x,y,_) = (g(x),h(x),g(y)), or whatever. — And, yes, it is often useful to have dummy parameters: not as the only definition of a function, but for a polymorphic function or one with alternative pattern-matched definitions it's often the natural thing to do. |
|
Apr 21 |
comment |
Why use an interface when the class can directly implement the functions? Do you call this a cast in Java? Urgh. It's a reference cast, or base-class-pointer cast as we'd call it in C++. Which does not actually cast the object in the sense that anything changes about its implementation (like when you cast a float to double), it just creates are more general pointer that can dispatch over the class hierarchy's vtable. IMO quite an important distinction. |
|
Apr 19 |
comment |
does one method overload an other, or are both methods “overloaded” But would then not every function overload its name, even if no other function has the same one? |
|
Apr 11 |
comment |
Is the phrase “never reinvent the wheel” suitable for students? Except if the 25th rewrite is a practise for some programming language you're newly learning. |