Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
cessor
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
1.
▲
by
cessor
1y ago
It's easy to make Django react to "Accept-Language" headers, I love how the LocaleMiddleware supports it out of the box [1]. I implemented automatic language detection to show either German or English content and was surprise
2.
▲
by
cessor
5y ago
I agree 100%. Even if you don't need it, these lines don't hurt you, but most of the time, the additional model is put to good use. I usually add metadata, such as additional timestamps, flags, tags, custom user settings, consent
3.
▲
by
cessor
5y ago
I'd love to hear your criticism of django, issues you encountered and problems you have solved :) > My real criticism of Django is that, at long last, I think it's starting to look dated. Actually, that is something I found rea
4.
▲
by
cessor
5y ago
Your're right, I felt the same way in that the article is clickbaity. I found that django's naming scheme for migrations is good enough; here are some real ones that I pulled out of my current project: migrations/0006_a
5.
▲
by
cessor
5y ago
The author names three 'harmful' defaults: 1. Relying on implicit SQL queries 2. Using the default User model 3. Using automatic migration names 4. Relying on automatic database table names 5. Using multiple tiny apps 6. Dumping a
6.
▲
by
cessor
5y ago
Does your employer pay for your technical skillset and your labor, or do they pay you for sacrificing your mental health? I don't think self-care is unprofessional, and deciding to leave is perfectly fine. Professionalism means being a
7.
▲
by
cessor
5y ago
This is judging a fish on it's ability to fly. In other words, it is judging an object oriented program on its ability to resemble top-to-bottom sequential execution style programming, while ignoring that the language is commited to a
8.
▲
by
cessor
5y ago
Yes, 40sec on firefox for "essential cookies only"; accept all is instantaneous.
9.
▲
by
cessor
5y ago
I don't use a debugger. When I have a problem that I need to narrow down I state my hypotyhesis of what is going on in some kind of unit test and narrow it down that way. I am currently working on a Python/Django project of around
10.
▲
Ask HN: Is “Hacker News” becoming “News”?
4 points
by
cessor
5y ago
|
2 comments
11.
▲
by
cessor
6y ago
you mean... like irc?
12.
▲
by
cessor
6y ago
When using it like this, the interpreter opens a new namespace where the variables are bound. The x is declared in the outer scope, so it can't find it. However, you can ask python to keep searching vor the name `x` in the closest oute
13.
▲
by
cessor
6y ago
I feel the same way.
14.
▲
by
cessor
6y ago
True. But given that the difference in implementation appears to be arbitrary, the real differene between oop and fp must be evaluated in the domain of empirical research regarding their ergonomics. If one matches your natural thoughtpatter
15.
▲
by
cessor
6y ago
How do you model changes in state over time? (i.e. effects and processes?)
16.
▲
by
cessor
6y ago
How much great learning the student could have done if he had not been insulted and physically abused by an impatient "educator".
17.
▲
by
cessor
6y ago
True. Python taught me that.
18.
▲
by
cessor
6y ago
> Checking the validity of the data is only necessary once. Exactly, which is why a class is the perfect singular location to place it. The object itself is just a pointer, the method doesn't get copied around, so object appear to
19.
▲
by
cessor
6y ago
I will admit that I don't know what "linear types" or "affine types" are. Your answer makes me feel like I am trying to convey an idea for which you have the perfect formalism / meta vocabulary. It might be tha
20.
▲
by
cessor
6y ago
> What happens to your OpenConnection object then? It raises an exception. This interrupts the normal flow of things and asks you to deal with the problem asap. If necessary, the handling code then could try to reconnect or abort. If de
21.
▲
by
cessor
6y ago
Members in Python are never private. Variables that are supposed to be used internally only are marked with and underscore, but that just conveys intent and isn't enforced by the interpreter/runtime. But you can emulate private da
22.
▲
by
cessor
6y ago
The term information hiding used in this thread is very confusing (to me, at least). I believe David Parnas introduced it in 1971 to mean that a program's design was sliced along shared units of concerns (things that vary together) rat
23.
▲
by
cessor
6y ago
This circles back to my original argument. Here: def adder(x): def add(y): return x + y return add add_five = adder(5) add_five(10) How is that different from: class adder: def __i
24.
▲
by
cessor
6y ago
It's not so much about "I need that later", but to start thinking about a program differently to begin with. If you think about the things that "are" rather than what should happen in what order, you get the chance
25.
▲
by
cessor
6y ago
If you limit the scope of usage, the old wallet should be garbage collected as soon as you have the new one. If you don't want to rely on that, or the point in time when gc happens is important or you're dealing with sensitive dat
26.
▲
by
cessor
6y ago
That sounds very plausible. But then, is OOP vs. FP an argument about verbosity in syntax to achive the same thing eventually?
27.
▲
by
cessor
6y ago
Funny you should mention that. For my (disclaimer:unfinished) PhD I did a literature survey including 17.000 publications from 1960 to 2018 in order to find a definition of object-oriented programming that would allow us to improve on our f
28.
▲
by
cessor
6y ago
Object without state but with functions is just a namespace. But that depends on how the language implements it.
29.
▲
by
cessor
6y ago
I like it. It gives you (f)actual private fields in python, as title and name can't be accessed via the instance variable of f. That also works in JavaScript: function Fraction(a, b) { this.value = function () {
30.
▲
by
cessor
6y ago
Here is how to disable it: # pylint: disable=too-few-public-methods
More ›