| bio | website | |
|---|---|---|
| location | Netherlands | |
| age | ||
| visits | member for | 2 years, 2 months |
| seen | Apr 9 at 15:06 | |
| stats | profile views | 48 |
Command line junkie.
Recall that intercaps [camelCase] became popular in programming languages that did not allow underscores within names, such as Pascal and Smalltalk. In using intercaps, one seems to be reverting to the early Middle Ages, when handwritten words were not separated, and thus flouting an important readability tool that is a thousand years old. 1
|
Jun 13 |
comment |
Should my source code be in UTF-8? You're making it seem as if ASCII vs. UTF-8 is a choice. When there are non-ASCII characters in a file, it isn't. When there are only ASCII characters, UTF-8 is ASCII. |
|
May 23 |
comment |
Working on someone else's code +1, refactoring without unit tests is a bad idea. |
|
Apr 20 |
comment |
Should UTF-16 be considered harmful? I think @Ringding is right, the Python example seems flawed. In Python 2, unicode('𝄞', 'utf-16') interprets the bytes of '𝄞' as a UTF-8 string and then decodes that to UTF-16; that obviously goes wrong. |
|
Apr 4 |
comment |
How to write functionally in a web framework Erlang's message passing ties in perfectly with functional programming: the objects that an actor receives will not be inadvertently modified by some other concurrent process. So, FP is good for message passing. As for functional data structures, there's a lot of ongoing research into making them more performant: cstheory.stackexchange.com/questions/1539/… |
|
Mar 27 |
comment |
Why do “Joke” programming languages exist? "very difficult to work with" -- you mean you've tried? |
|
Feb 11 |
comment |
Pseudocode for Brodal queue The original Brodal queue uses destructive assignment, so the Haskell version must have some modifications. |
|
Feb 11 |
comment |
Why do variables need a type? -1; strong/weak typing is orthogonal to static/dynamic typing. C is statically weakly typed; Lisp and Python are both dynamically strongly typed. |
|
Feb 11 |
comment |
Why do variables need a type? @sturdytree: quanticle is right. Static typing means that variables have types, so what you're asking for is a contradiction. |
|
Feb 11 |
comment |
Why do variables need a type? @sturdytree: if the variable is really untyped, i.e. you have dynamic typing, then the program rather than the compiler will detect the error because type checking would occur at runtime. This is in fact what happens in Python: if you call a non-existent method, an AttributeError exception is raised. |
|
Feb 11 |
comment |
Why do variables need a type? @sturdytree: you would get that last warning if your compiler does type inference, which I believe C# does when you use the var keyword. However, that still entails that the variable a has a type, you just don't spell it out anymore. |
|
Feb 11 |
comment |
Why do variables need a type? @sturdytree: suppose you have two unrelated classes Bar and Baz. If you mistype the last letter of Bar so that you construct a Baz instead, a compiler for a statically typed language would refuse to compile while one for a dynamically typed language would just go ahead and let the program crash and burn. |
|
Feb 10 |
comment |
Why do variables need a type? @sturdytree: as for "if it does not have a type, then it cannot be wrongly typed" -- as far as the language rules go, that's true. But the variable may still be assigned the wrong type from a semantic point of view, e.g. you mistyped a constructor name and the program still runs, but doesn't do what you want. |
|
Feb 10 |
comment |
Why do variables need a type? @sturdytree: I reassign variables to values with a different type all the time. For example, in Python, I often do things like f = open(f) where f is initially a string and after the assignment, a file object. |
|
Feb 10 |
comment |
Why do variables need a type? Still, dynamically typed languages can deal with this. In Python, one=1; print(one+one) prints 2. one="1"; print(one+one) prints 11. The SQLite example is more convincing, but the problem there is one of weak typing, so it's not really relevant to C#. |
|
Feb 10 |
comment |
Why do variables need a type? @CharlesSalvia: good point, added that to the answer. |
|
Feb 10 |
comment |
Why do variables need a type? Please explain the downvote. |
|
Feb 10 |
comment |
Why do variables need a type? @ChrisLively: I'm glad it's a matter of fact now. Please come by my workplace anytime to convince my Perl-loving colleagues ;) |
|
Feb 10 |
comment |
Why do variables need a type? I.e., Perl is not a sane language? :) |
|
Feb 10 |
comment |
Why do variables need a type? In Python, 1 + 1 always has the type int, but there's no need to declare that. The question is about why variables have a type, not values. |
|
Feb 8 |
comment |
Regulation of the software industry @JonathanHenson: but apart from the private aerospace/military industry, even companies like Facebook and many smaller ones are now capable of harming the (global!) public, because they store private information. Every now and then, an internet service leaks such info because some programmer didn't sanitize Little Bobby Tables' name. So there is a need for quality control (if not regulation) even in the non-safety-critical sector. |