If the convention in Python is to capitalize classes, why then is list() not capitalized? Is it not a class?

Yes, uppercase-initial classes are the convention, as outlined in PEP 8. You are correct that many builtin types do not follow this convention. These are holdovers from earlier stages of Python when there was a much bigger difference between user-defined classes and builtin types. However, it still seems that builtin or extension types written in … Read more

How do I initialize classes with lots of fields in an elegant way?

You can either use a constructor or a builder pattern or a variation of the builder pattern to fix the problem of having too many fields in your initialization step. I’m going to extend your example a bit to prove my point of why these options are useful. Understanding your example: Lets say an Offer … Read more

Does functional programming mandate new naming conventions?

In a functional programming paradigm, people usually construct abstractions not only top-down, but also bottom-up. That means you basically enhance the host language. In this kind of situations I see terse naming as appropriate. The Haskell language is already terse and expressive, so you should be kind of used to it. However, when trying to … Read more

Where do you keep Constants used throughout your application?

I’d put each constant into the class or interface it’s most closely related to (e.g. because it will be use by its methods). A very seductive but ultimately very foolish idea is to have one “constants class” (or interface) that contains all constants used in the application. This looks “neat” at first glance, but is … Read more

Wrapping chained method calls on a separate line in Intellij for Java

Small disclaimer: this is IJ 14.4, it’s possible that in later versions it may have been changed/renamed/etc, but it should be there somewhere nonetheless Go to Settings -> Editor -> Code style -> Java and select the Wrapping and Braces tab, then scroll to Chained method calls. Check the little combo on the right of … Read more

Tabs vs Space indentation [closed]

Getting tabs to look right depends heavily on the configuration/choices of all the software the source code might be displayed or printed by. If you have a restricted set of such software and find that’s not a practical problem for you, that’s great – go for it if you see value. But, be aware that … Read more

Should I prefer private member functions, or functions in an unnamed namespace? [duplicate]

In the semi large projects where I usually work (more than 2 million lines of code) I would ban private class functions if I could. The reason being that a private class function is private but yet it’s visible in the header file. This means if I change the signature (or the comment) in anyway … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)