Skip Navigation

InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)
Posts
6
Comments
50
Joined
1 wk. ago

  • In the case of this gist, it’s premature optimization. Generally it’s necessary cuz new implementations come along often.

    That sounds terribly inexperienced. That's exactly what updates to code are for. You cannot manage all kind of, sort of similar but different libraries with one code base. It would be horrific to even consider it.

  • By embedding the class, creates a limitation that prevents abstractions or other implementations of each component. Imagine every suggestion in this conversation thread is another variation with a separate implementation.

    If the user wanted to create a new FoldableDockWidget with a different title bar, they'd extend the FoldableDockWidget class and override the Titlebar method in their extension of it. I understand your point, but isn't it over optimisation?

    The widget class belongs to the FoldableDockWidget class until it doesn’t. Then a refactor is needed.

    One line of instantiating code. I can't imagine where or how the custom title bar would be used outside of the Foldable Dock Widget class though. That's probably the real reason why I made it a sub class. Not how I'd do it in other languages, but in Python? I'm trying it out!

    Hardwiring a particular implementation of the Windowing python wrapper is necessary. They have slightly different implementations. If something magically new comes along, then, the code is updated. Again, over optimisation here which is unnecessary.

    The code in the process guard is just sample code to demonstrate use of the class. No big deal. It's separate to the class and not to be imported because.. this is a gist of sample code!

  • Thanks for the compliment! Python isn't my first language and it's difficult to be able to switch style from one language to another!

    I always find it difficult to choose when to use ternary statements. Sometimes, for something quick and simple, I will, otherwise I'll be explicit. This is more of a readability issue than anything else. And I find the ternary statements quite verbose compared to other languages by using the words if/else rather than shorthand symbols.

    You're absolutely right about the set_float_icon and corresponding method. Coding's an iterative process and that's a byproduct. I think set_float_icon() along with complimentary methods like set_docked_icon(), set_minimize_icon(), set_restore_icon() etc may be easier to use / remember wtf it does in six months time!

    Thanks for the black / ruff suggestion. I've never heard fo them, but I'm about to go look for them.

  • Thanks for your response.

    should never embed classes within other classes)

    Why is this? I have to admit that coming from other languages, it feels dirty, but is there a pythonic good reason for this? The class 'belongs' to the FoldableDockWidget class, so I figure it's the best place to put it.

  • Thanks. I wondered why I instinctively text-transformed the title of the widget to uppercase! I commented it out thinking perhaps it doesn't look grammatically correct! Reduced the font size a bit and I think it looks a heck of a lot better now!

  • python Python @programming.dev

    Critique This! A Simple Qt Dock Widget which enables the whole widget to be 'folded' to use less screen space

  • I get this, but an IDE should be invisible and grow as you do and not require you to learn lots of janky things before it becomes a little bit useful for you.

    Need the basics, great, here they are. Don't understand some advanced feature? Well the IDE has it here, but it isn't in your way, mess with it as and when you want. It'll still be there.

    I don't think one IDE does everything for different languages and its ok to swap editors depending on your workflow, your project and your ever-changing skillset.

  • mechanical_keyboards Mechanical Keyboards @programming.dev

    What's your favourite keyboard switch and why?

  • You can do it in launch.json.

    Exactly, what a god-for-saken horrid solution! I'm all for JSON configuration for really low-down dirty stuff, but for something as simple as this? Eugh, no! Refactoring in Pycharm is fine as far as I can tell, never had any issues with it.

    VSCode/ium is fine for single-file python or other such simple stuff, but not for big projects and was an instant deal breaker for me. I hated pycharm when I first started using it, but as I get more used to it, it's way more usable and has some nice little features, so I'll stick with it for now.

    I get VSCode from a product marketing point of view and understand why it was created, but I wish it wasn't. One size fits all never works out in the long-term

  • case of a model M

    I'm absolutely confused as to why not other manufacturer has adopted a little lip at the top of the keyboard above either the number or F keys to rest a pen. It was made in the days when scientists had their pen in one hand, log book on the desk and keyboard in the other hand. A place to rest the pen was necessary. It's 'still important today!

  • I’m using ch57x-keyboard-tool to configure it

    Great! I've bought similar without the dials (I wish I didn't have to pay extra for the stupid LEDs) and was hoping there was something open sourcey to configure it with rather than their dodgy codebase for the same reasons you list!

  • python Python @programming.dev

    Is it ok to post code (~250 LOC) for critique here?

    mechanical_keyboards Mechanical Keyboards @programming.dev

    So... is the IBM Model M the greatest keyboard ever created? Or has that phase passed now?

    linux Linux @programming.dev

    Go buy a linux book at a charity shop or a library sale!

    programming Programming @programming.dev

    Do you use a macro keyboard for shortcuts? If so, what for and what size?