GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    array :java: :void: :php: (array@fosstodon.org)'s status on Thursday, 10-Aug-2023 21:01:51 JST array :java: :void: :php: array :java: :void: :php:

    I like #Python. It was the first programming language I tried, it had a reputation of being easy to learn and yeah, it was. What I don't really understand is how it has become so popular (# 1 in the TIOBE index...) and pervasive (you find it in areas where it seems like logic for a scripting language, but in others where you wouldn't bet for it too). It shines where it shines, but aren't really there better options in some of the niches it is being used for?

    In conversation Thursday, 10-Aug-2023 21:01:51 JST from fosstodon.org permalink
    • Embed this notice
      clacke (clacke@libranet.de)'s status on Thursday, 10-Aug-2023 21:01:49 JST clacke clacke
      in reply to

      @array There really is very little you need to go outside python for, so people don't.

      Scripts? Check.
      Well-factored applications? Check.
      Static type-checking? These days, check.

      It really is a wide range, and while it is not too performant, most of the time your code is waiting for I/O or a human. When performance is actually needed, heavy calculations go into pandas and numpy and on the other end things like protocol parsing go into gunicorn and starlette.

      Python's got you covered. Best language for almost nothing, good enough language for almost everything. More boring than Ruby, less line noise than Perl.

      In conversation Thursday, 10-Aug-2023 21:01:49 JST permalink

      Attachments


    • Embed this notice
      Sotolf (sotolf@social.linux.pizza)'s status on Thursday, 10-Aug-2023 21:01:54 JST Sotolf Sotolf
      in reply to

      @array Python gets used by a lot of non-programmers, (Data-scientists) and the like, because it's easy to write stuff in, so I think that is a part of it. It also early got good bindings to Machine Learning Suites, which did propel it forward, I think python's popularity has a lot to do with the libraries that is available to it, it's the thing that makes me want to try it out again some times :)

      In conversation Thursday, 10-Aug-2023 21:01:54 JST permalink
      clacke likes this.
    • Embed this notice
      clacke (clacke@libranet.de)'s status on Thursday, 10-Aug-2023 21:02:09 JST clacke clacke
      in reply to
      • chsh -s /usr/bin/pwsh $USER

      > package names

      Every language has either wild package names or a community so small that only one person wrote an html parser and can call it "html".

      > solving problems through syntax

      Every language except Lisp and friends.

      > PEP 8 linter

      Run your code through the "black" formatter. It's nice to write code your friends can read. Every language should come with a style checker and a formatter.

      > different versions of pip for every Python version

      That's how they coexist. If you don't like it you can instead my-python-version -m pip.

      > conflicting solutions

      Pick a set that suits you. I enjoy using pyenv+pip-tools.

      > package management is horrible

      It installs stuff and dependencies and struggles with the same tradeoffs and intrinsic complexities as any package management system.

      > "Pythonic" code is meaningless

      It's nice to write code friends can read.

      > only know Python

      It really is a very good hammersawscrewdriver. I would love an excuse to use one of the other languages I learned, but I don't have one.

      > non-standard nomenclature

      CS calls these abstract data types lists and dictionaries. Programmers mix them up with implementation details and call them arrays and hashtables even when they're not.

      > quotes in Python

      Yes, they are different from bash. Just different arbitrary rules.

      > pass things by value

      Don't? I admit sometimes I would like to have more immutable types to make sure code I call behaves, but it's seldom a real problem in practice.

      > GCC knows you want to import screencapture.h

      What? No it doesn't unless you include.

      > 4 SPACES

      Arbitrary conventions are arbitrary. Please follow conventions. It's nice to write code friends can read.

      @a13cui @array

      In conversation Thursday, 10-Aug-2023 21:02:09 JST permalink
    • Embed this notice
      chsh -s /usr/bin/pwsh $USER (a13cui@emacs.ch)'s status on Thursday, 10-Aug-2023 21:02:10 JST chsh -s /usr/bin/pwsh $USER chsh -s /usr/bin/pwsh $USER
      in reply to

      @array I have a harsher opinion of Python than other people (as in I believe it is, and excuse my advanced Ancient Albanian Sign Language, dogshit). Python is lucky it can access C and Fortran because otherwise no one would use it in any scientific context. To rapid-fire the shit I hate about Python:

      • The package names are so inconsistent (PyPy, PyPi, NumPy, SciPy, SymPy, PyGtk, Pyglet, PyGame, SQLAlchemy, BeautifulSoup...)
      • It loves solving problems through syntax and badly-written abstractions instead of using the language itself
      • Good luck making a program that doesn't make the PEP 8 linter trigger-happy
      • You need different versions of pip for every Python version (go right now to your terminal and do ls /usr/bin/pip{2,3}* 2>/dev/null) and there are multiple conflicting version management solutions (pyenv, venv, poetry...)
      • The package management is horrible (shit, it makes CPAN look like something God sent from the heavens)
      • "Pythonic" code is meaningless and mostly means you copy obtuse shit from SO (you might as well copy Perl too)
      • A lot of Pythoners seem to only know Python and are unwilling to learn everything else because for them everything is a nail
      • The same people love to use non-standard nomenclature for shit already established in the CS community (they call arrays "lists", they call associative arrays/hashes "dictionaries" etc.)
      • Wait until you play with quotes in Python
      • You have to work hard to pass things by value (the most reliable method so far is a=copy.deepcopy(b) because not all objects have .copy())
      • if you do something like gcc -o screencapture.exe screencapture.c -lscreencapture, GCC knows you want to import screencapture.h, but in Python if you do the same thing it wants to import the local code first (glhf if you have a screencapture.py file...)
      • Even though the docs also accept tabs, PYTHONERS SCREAM AND WANT 4 SPACES!!!! Nothing else allowed.

      This is as much as I can write in 2k chars.

      In conversation Thursday, 10-Aug-2023 21:02:10 JST permalink

      Attachments


    • Embed this notice
      Sotolf (sotolf@social.linux.pizza)'s status on Thursday, 10-Aug-2023 21:02:12 JST Sotolf Sotolf
      in reply to
      • clacke

      @clacke @array That's an extremely good summation of python, I like it a lot :)

      In conversation Thursday, 10-Aug-2023 21:02:12 JST permalink
      clacke likes this.
    • Embed this notice
      clacke (clacke@libranet.de)'s status on Thursday, 10-Aug-2023 21:02:13 JST clacke clacke
      in reply to

      @array *shrug*

      I know 20+ languages. My colleagues don't. Or if they do, not the same ones. Except Python.

      In conversation Thursday, 10-Aug-2023 21:02:13 JST permalink
    • Embed this notice
      array :java: :void: :php: (array@fosstodon.org)'s status on Thursday, 10-Aug-2023 21:02:14 JST array :java: :void: :php: array :java: :void: :php:
      in reply to
      • clacke

      @clacke Yeah, it's really pervasive. And very good at what's good, as I said, I like it too. It's just the point that you raise, "best language for almost nothing", that brings me some doubt. As in, why not just use "the best tool for the job", when there are arguably better options in some domains? Using Python for *everything* sounds just a bit... Lazy, I guess? :P

      In conversation Thursday, 10-Aug-2023 21:02:14 JST permalink
    • Embed this notice
      bignose (bignose@fosstodon.org)'s status on Thursday, 10-Aug-2023 21:02:15 JST bignose bignose
      in reply to

      There is great momentum in a community that already knows a language and wants to *do work* with that. (i.e. that is not primarily programming, but merely *using* programming to achieve some other goal.)

      So, those people will reach for what they already know, which in this case is #Python; and if it is good enough, then other niche special-purpose tools don't even get investigated.

      A special property of Python is impressive support for so many use cases; people try it, it just works!

      @array

      In conversation Thursday, 10-Aug-2023 21:02:15 JST permalink
      clacke likes this.
    • Embed this notice
      clacke (clacke@libranet.de)'s status on Thursday, 10-Aug-2023 21:02:33 JST clacke clacke
      in reply to
      Your prototype *will* be put in production. You have two choices:
      - Expect that and embrace it
      - Make sure the prototype is as close as you can get to 100% useless for production
      In conversation Thursday, 10-Aug-2023 21:02:33 JST permalink
    • Embed this notice
      clacke (clacke@libranet.de)'s status on Thursday, 10-Aug-2023 21:02:34 JST clacke clacke
      in reply to
      • geraldew
      @geraldew @array Put it in production, work on the next problem that isn't already solved. =)
      In conversation Thursday, 10-Aug-2023 21:02:34 JST permalink
    • Embed this notice
      geraldew (geraldew@fosstodon.org)'s status on Thursday, 10-Aug-2023 21:02:36 JST geraldew geraldew
      in reply to
      • clacke

      @array @clacke all the more reason to see its position as a very good prototyping language. Perfect for demonstrating what the final program should do, much of how it can work and good enough to use until the "production" replacement is completed.

      In conversation Thursday, 10-Aug-2023 21:02:36 JST permalink
    • Embed this notice
      clacke (clacke@libranet.de)'s status on Thursday, 10-Aug-2023 21:02:37 JST clacke clacke
      in reply to
      • tychosoft
      • chsh -s /usr/bin/pwsh $USER

      @tychosoft @a13cui @array Yes, breaking changes are a real annoyance with Python.

      At least people starting today won't have to suffer the big bang breaking change of Python 3, but the lesson learned was instead "let's break small things every 'minor' release".

      In conversation Thursday, 10-Aug-2023 21:02:37 JST permalink

      Attachments

      1. No result found on File_thumbnail lookup.
        python.at
        This domain may be for sale!
    • Embed this notice
      tychosoft (tychosoft@fosstodon.org)'s status on Thursday, 10-Aug-2023 21:02:39 JST tychosoft tychosoft
      in reply to
      • clacke
      • chsh -s /usr/bin/pwsh $USER

      @clacke @array @a13cui for me, I liked Python the language, but hated the deployment model and breaking changes. To get consistent development and production you often had to turn to virtual environments and could not depend on the "system" python. This was especially true when many distros still bundled python2 but everything needed to be in python3 as demanded by real world users. Ruby bundler felt cleaner than that, and ruby could be monkey-patched with language feature backports.

      In conversation Thursday, 10-Aug-2023 21:02:39 JST permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.