17 December 2022
13 December 2022
Is it possible to run multiple VMware guests Using Free VMware Player?
Press Ctrl + R
Enter 'vmplayer'
04 December 2022
Why is web programming looked down amongst programmers?
Why is web programming looked down amongst programmers?
Web programming is awful. Hear me out:
- You’re usually forced to code in multiple languages
- Many of those languages have serious flaws and limitations
- The sands are constantly shifting as browsers, libraries, etc. change, often without discernible improvement
- Mysterious problems caused by near-invisible factors, sometimes outside your control, are frequent (e.g. strange proxy behaviour; caches)
- Very basic things arrive late and broken (I remember web developer friends’ excitement about finally getting sockets and a canvas to paint on)
When I meet a developer who likes web development, I assume that’s the only kind of development they do and they’re probably inexperienced. This could be my prejudice, of course; maybe client-side web development is better these days (I wouldn’t know; I’ve been avoiding it for years).
Web development is also a bit like Visual Basic programming in the 90s in that the bar to entry is very low (it’s easy to build something), but the standard of developer required to produce a really good result is extremely high (it’s very difficult to build something good). As a result, there’s an awful lot of really terrible code out there, written and maintained by developers who have no idea what good software design looks like. Software built for the web is not often built for a long life, and there’s a worryingly high tolerance for:
- Poor user experience (making things look great rather than making them work well)
- Poor stability (just hit refresh; don’t use the back button; clear your cache and try again)
- Poor performance (I swear, some web developers have no idea what ‘fast’ really means on a modern computer, and never test on a machine over 5 years old)
- High resource consumption (never mind, it’s just the client machine’s resources being wasted)
- Very poor maintainability (we’ll build a whole new one before we make significant changes to this one anyway)
I try not to look down on anyone though. Anyone can learn any kind of development, and getting tribal about technologies and disrespecting people who like things we don’t isn’t productive.
03 December 2022
Advantages of map function in Python
Does Python still need the map() function?
In the following situation, i.e. working with multiple itarables (lists, etc.), using map function may be the best approach. It is both the most readable and the most efficient.
...
Above, we applied map()
for a single iterable, but we can use as many of them. The function
will use them based on their index, that is, first, it will call the
callable for the first elements of the iterables (at index 0); then for
the second; and so on.
A simple example for this:
>>> def sum_of_squares(x, y, z):
... return x**2 + y**2 + z**2
>>> x = range(5)
>>> y = [1, 1, 1, 2, 2]
>>> z = (10, 10, 5, 5, 5)
>>> SoS = map(sum_of_squares, x, y, z)
>>> list(SoS)
[101, 102, 30, 38, 45]
>>> list(map(sum_of_squares, x, x, x))
[0, 3, 12, 27, 48]
...