187 reputation
5
bio website andreparames.com
location Portugal
age
visits member for 3 years, 6 months
seen May 14 at 11:25

Jul
3
comment Why do most programming languages only support returning a single value from a function?
@BlueRaja-DannyPflughoeft: the difference has practical implications, though. The fact that a tuple is "one thing" means you can assign both values to a single variable by mistake (e.g. username = GetUsernameAndPassword()). In a language with real multiple values, such as Go, that's marked as a syntax error.
Mar
15
comment Error handling - Should a program fail on errors or silently ignore them
@Dokkat: the point is to not continue with wrong values, which will give a wrong solution (garbage in, garbage out). Crashing does fix the issue: it forces the user to either provide different inputs or pester the developer the fix their program ;)
Oct
13
comment Are there any design patterns that are unnecessary in dynamic languages like Python?
@pepr: I know those examples, but they're irrelevant the firsts are just the result of __repr__ and the disassembler is an irrelevant implementation detail of CPython, which doesn't affect Python-the-language. Functions were part of Python earlier than objects were. When was that? The first publicly available version of Python used objects extensively. Besides, yes, the language has changed, so what? OO programming can be done in the C language; however, it does not make it an OO language. But functions in Python are implemented as objects. They're instances of the FunctionType class.
Oct
12
comment Are there any design patterns that are unnecessary in dynamic languages like Python?
@pepr: It's your prerogative to use the definitions you prefer, but that's not the common definition of syntactic sugar; rather, it's any construct that "can be removed from the language without any effect on what the language can do". For example, I can re-implement functions in Python using classes. I can't re-implement objects in Python. I also cannot agree that a language should be judged by how a novice programmer (in the language) perceives the syntax. I do agree that there's a need for something like unbound functions, and that's why Python emulates them.
Oct
12
comment Are there any design patterns that are unnecessary in dynamic languages like Python?
@pepr: the unbound functions in Python are just syntactic sugar. What you're really doing is creating an object with that name and adding a __call__method to it, which contains the actual code. When you call the "function", you're really calling its __call__() method. Example: def myunboundfunc(): print "hello" myunboundfunc.__call__() #outputs "hello" You can even replace that method: myunboundfunc.__call__ = lambda: "frog" ; myunboundfunc() #returns "frog" It's much like Smalltalk, which had "unbound" code blocks too (they were really their own objects, just like here).
Aug
3
comment How many types of programming languages are there?
@ErikReppen: No, they're still declarative. They're not programming languages, though.
Jul
27
comment Are unit tests really that useful?
@nubm: Well, that's not what the case studies have found.
Jul
27
comment Are unit tests really that useful?
@ErikReppen: care to expand? Are they worse than the average development team? (I frankly don't know).
Jul
26
comment Are unit tests really that useful?
@nubm: According to case studies at Microsoft and IBM, unit tests actually speed up your total development time. stackoverflow.com/questions/3756796/…
Jul
25
comment Stability vs Reliability
@m3th0dman: Chad also said the application restarted itself instantly, so obviously it's fault-tolerant (something in the application has to be restarting itself).
Jul
25
comment Are there any design patterns that are unnecessary in dynamic languages like Python?
@MartijnPieters: But len is an instance of the builtin_function_or_method class. It even has methods, e.g. len.__repr__() or len.__call__() (and the latter is the one that is actually run when you can len(obj)). That it is implemented by the core seems an irrelevant detail to me.
Jul
25
comment Are there any design patterns that are unnecessary in dynamic languages like Python?
@MartijnPieters: len is an object that acts on other objects. How is that not OOP? It's just a different syntax, that's all, and you can use the same in your own classes by implementing the call method.
Jul
25
comment How to distribute a web app (that's hosted by the customer)
For licensing, and since you want the client to pay a monthly fee, you should probably just sign a contract that specifies that. Get a lawyer to write one that fits your needs.
Jul
25
comment How to distribute a web app (that's hosted by the customer)
CC is not generally recommended for software. And the version you linked to can only be used in non-commercial settings, which I'm thinking meetamit's clients will not be too happy about. Besides, it doesn't ensure that the client needs to pay a monthly fee for using the application, which was specifically required by meetamit.
Jul
25
comment Stability vs Reliability
@m3th0dman: Erlang programs are considered reliable, not because they are infallible, but because they consist of many concurrent processes (not OS processes) which can fail without compromising the program as a whole, which is designed to handle those failures.
Jul
25
comment Open Source Project: Company to register copyright
Unless you want to force other contributors to assign their copyright, I don't see why would keeping your own code under your name be alienating; it's how almost all open source projects work.
Jun
26
awarded  Editor
Jun
26
revised Moving from mock to real objects?
Added source highlighting tags
Jun
26
suggested suggested edit on Moving from mock to real objects?
Jun
20
comment Is there a difference between “self-plagiarizing” in programming vs doing so as a writer?
+1 the example is irrelevant; the point on how the author may not be the copyright owner is very relevant.