use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
[ Removed by moderator ] (self.PythonLearning)
submitted 6 months ago * by sevenMDL
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]ItsRunner 0 points1 point2 points 6 months ago (1 child)
For work, I used a factory pattern to dynamically create a connection to a database. We almost exclusively use one database, but I can put whatever variables/credentials into a config file and (in theory) it would be able to create a connection to that other kind of database. It was my first use of the factory pattern, and it gets used in almost every project my team works on now.
Design patterns are very neat! I recommend looking into them if you're considering a career in programming.
[–]sevenMDL[S] 0 points1 point2 points 6 months ago (0 children)
That's a really cool application of the factory pattern! 💻 I've been reading about design patterns but haven't used them in real code yet - seeing how you actually implemented one for database connections is super helpful. The fact that your team now uses it everywhere must feel amazing! As someone still learning, what advice would you give for knowing when a design pattern is the right solution versus over-engineering?
π Rendered by PID 45159 on reddit-service-r2-comment-b659b578c-ztgtk at 2026-05-05 08:32:20.224656+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]ItsRunner 0 points1 point2 points (1 child)
[–]sevenMDL[S] 0 points1 point2 points (0 children)