|
I hate Web programming - the Web is a total mess
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP
|
|
|
|
|
ditto
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
But according to our management (and I assume not only to ours) and the users the only way.
|
|
|
|
|
Have you considered looking into Redux for state management?
We use it at work and I tend to make use of it on personal projects where I need to do anything complex between components so that I can maintain that complexity within state.
The downside is that it is another steepish "learning curve", the tutorials are good though - I found once I had everything wired up with Redux a lot of other complexities were solved for me although I am aware it's yet another thing to add and learn(I won't get started on Thunks which I have so far avoided on personal projects).
Also, another thing , TypeScript sits very nicely with React.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
I'm of the mind that beating up on web UI frameworks doesn't really need further justification, the term itself is a slur.
|
|
|
|
|
It makes me feel like a crotchety old English teacher.
def receive_message(self, client, client_address)
Yields "'function' object has no attribute 'receive_message'
And my first thought does not go to the code, but to the inanity of the error message.
1. Attributes are metadata. A function doesn't have attributes unless it's marked up. it has a signature, access modifies and storage class indicators.
2. Functions are not "objects". Functions are functions. A function as an object is called a "functor"
3. Am I really fisking a python error message right now?
And by then I've completely given up on the issue.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Hmmmmmmmmmmmmm.
Are you sure the message actually pointed to that line of code?
"In testa che avete, Signor di Ceprano?"
-- Rigoletto
|
|
|
|
|
Which release of python are you using? Do you have a choice of different implementations?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Dunno which release, and yes I have a choice of alternatives. I choose C#.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Great - now I've got Bob Geldof singing in my head!
🎵 Tell me why 🎵
🎵 I don't use Py-thon 🎵
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
It's nice that he does personal visits now. Has he fallen on hard times?
|
|
|
|
|
If he had, I'm sure he wouldn't be shy about asking people to give him their ing money.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Yeah, naming is hard especially when you're trying to be consistent.
In Python everything is an object, a "thing", and those things have "attributes".
- An attribute that holds a value is a variable.
- An attribute that is a function is called a method.
- An attribute that represents a value accessed by getters/setters is call a property.
So a function is an object and a parameter to the function object is, at its core, an attribute. But a class is also an object. And an instance of the class is an object. And operators are objects.
Naming is hard.
cheers
Chris Maunder
|
|
|
|
|
What a mess
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
honey the codewitch wrote: What a mess Have you ever tried SmallTalk? And really Python is not that difficult once you get used to its rules; it's just a bit different than some other languages.
|
|
|
|
|
I've seen SmallTalk - i think maybe in the late 80s early 90s? Been so long i don't even remember. Never tried it myself.
I'm biased against languages that pretend to be something they're not. I know it's silly of me, but JS and Python with their ersatz OOP (that's not OOP) just leave me with a bad taste in my mouth. I dislike it I think for the same reasons I dislike Turkey-Bacon. Turkey is fine. Bacon is fine. Everything would be fine if they'd just stay in their lane. Objects are fine. Associative arrays are fine. Associative arrays are not objects no matter how many functors you put into them.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
This sounds like me ranting that 'invite' is a verb not a noun, and 'alternate' means to switch from one option to another, and is not an alterative.
Damn kids these days...
cheers
Chris Maunder
|
|
|
|
|
I think you seem a bit impatient with Python. I find it useful for small quick things. For example string processing or web-scraping. And I do not give a toss whether they call it "object-oriented" or not. Lets call it stuff-oriented or whatevva.
However, on the OO topic... We who are firmly rooted in C++ have a rather strict definition of OO. There are other ways of looking at the term. I warmly recommend this article on the history of OOP (or "OOP"!). The grandfather of the term, Alan Kay, has said among other things:
“I made up the term ‘object-oriented’, and I can tell you I didn’t have C++ in mind.”
“I’m sorry that I long ago coined the term “objects” for this topic because it gets many people to focus on the lesser idea. The big idea is messaging.”
https://medium.com/javascript-scene/the-forgotten-history-of-oop[^]
"If we don't change direction, we'll end up where we're going"
|
|
|
|
|
I'm happy with C#'s conception of objects, and even Java's
What I don't like is ersatz objects that are effectively just hashtables keyed by the name of the member.
That sort of construct doesn't fulfill all kinds of object oriented necessities like polymorphism - not that you can't MAKE that work in a language like that, it's just not pretty.
It strikes me as Broken As Designed.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
I agree 100% that Python is not elegant from a pure CS point of view. But it is much more concise than C++ and cousins. You have to scroll less (!). We have discussed the benefit of non-scrolling (vs our old brains) in C-code before.
And it does have amazing libraries. I just does the job for small programs. Beyond a few thousand lines, it becomes a nightmare to maintain, mostly due to its total lack of type-safety.
"If we don't change direction, we'll end up where we're going"
|
|
|
|
|
I've discovered a whole new reason to love C# and that is source generators. But also, I've now gotten to the point where my C# CLI apps are as short and succinct as anything similar in python, through the magic of metadata and some code I wrote. Complete with using screens, defaults, etc.
I wrote something to parse a C header file and extract relevant information. From conception to testing to delivery in two hours, about a page and a half of C# code.
Frankly, I agree with Mr. Pfeifer below. I don't need Python, I've got solid tools as it is.
And no goddammned signficant whitespace!**
** funny thing about that.
I actually use minimization in my .NET projects[^]
I do it as part of an alternative to static linking which isn't really available with C#. To save space (sometimes a meg of whitespace!), and to deliberately obscure these files and prevent me from modifying them - rather than modifying the source that they are generated from. I've gotten out of sync before. This keeps me honest.
Python can't do that. In fact, python makes code generation itself a royal pain because of the pigheaded insistence of imposing indents on you.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Nice project! It is not within my aforementioned category of Python-suitable challenges ["small quick things"]. Peace.
"If we don't change direction, we'll end up where we're going"
|
|
|
|
|
It's not but for those I have my Program.Base code which makes writing say, a CLI app to wordwrap input files into an output file this easy:
using System;
using System.Collections.Generic;
using System.IO;
internal partial class Program
{
[CmdArg(Ordinal = 0)]
static List<TextReader> Inputs = new List<TextReader>() { Console.In };
[CmdArg(Name = "output")]
static TextWriter Output = Console.Out;
[CmdArg(Name = "width", Description = "The width to wrap. Defaults based on console window size", ItemName = "columns")]
static int Width = (int)Math.Floor((double)Console.WindowWidth / 1.5);
[CmdArg(Name = "ifstale", Description = "Skip if the input file is older than the output file")]
static bool IfStale = false;
static void Run()
{
if (!IfStale || IsStale(Inputs, Output))
{
foreach (var input in Inputs)
{
string line;
while((line = input.ReadLine()) != null)
{
Output.WriteLine(WordWrap(line, Width));
}
}
} else
{
Console.Error.WriteLine("Skipped execution because the inputs did not change");
}
}
}
That parses arguments, presents a using screen, all of that mess. This is how i do "quick things."
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Add some ego and rename self to myself.
|
|
|
|
|
I don't use Python because it solves no problems that I can't solve better with other tools.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|