General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
Lawrence D’Oliveiro
Fireship
comments
Comments by "Lawrence D’Oliveiro" (@lawrencedoliveiro9104) on "Fireship" channel.
Previous
8
Next
...
All
Java is just way too wordy and convoluted. One example is the whole “Selector” mechanism for managing nondeterministic I/O. It’s something like 4 different classes and I don’t remember how many dozen methods. For comparison, Python sums it all up in its “select” module, where you only need one class with just a few methods.
1
@CottidaeSEA So is there some simpler alternative to the “Selector” mechanism now? Enquiring minds would like to know.
1
@CottidaeSEA Just look at the APIs I mentioned, and compare them.
1
@CottidaeSEA In Python I can wait on a file descriptor with just 3 calls: * Create a poll object * Register my FD * call poll.poll(), with or without a timeout. Try doing the equivalent in Java.
1
@CottidaeSEA Show us some code to demonstrate how you do FD selection.
1
Even Microsoft won’t use Dotnet for anything important ...
1
@Vexxel256 Electron is for lazy programmers who don’t care about their users.
1
Actually tar will automatically recognize the compression format when extracting, so “xvf” should work on all compressed tar archives.
1
Most download tools and protocols very quickly acquired the ability to resume interrupted transfers, precisely to get around this problem.
1
Sounds like this is why Microsoft created git-lfs.
1
Not just strings, but any value of a sequence type can be multiplied by an integer to perform replication.
1
@CottidaeSEA And laziness, too, is one of the three programmer virtues, according to Larry Wall. This is the kind of code I had to add to narrow down the query interval (×2, this one for the lower limit, another similar one for the upper limit): limit = eval_expr \ ( conn, "min(artwork_timestamp) from" " (select max(timestamp) as artwork_timestamp from" " artwork_stats inner join artworks on" " artwork_stats.artwork_url = artworks.artwork_url where" " artworks.artwork_url in (%(artworks)s) and timestamp <= %(since)d" " group by artwork_stats.artwork_url)" # minimum of latest sample for each artwork that is not after since % { "artworks" : ", ".join(sqlite.format_sql_value(a) for a in prev_timestamp), "since" : since, } ) if limit != None : where.append("timestamp >= %d" % limit) ♯end if You can see why I avoided doing it until it became necessary.
1
@CottidaeSEA The triply-quoted strings introduce spurious whitespace. Suddenly the query doesn’t look so neat.
1
@CottidaeSEA I also consider readability of the query itself.
1
@CottidaeSEA You don’t like the way I write my code. So sue me.
1
@DjoumyDjoums Code performance generally follows a pareto distribution. Find and speed up the performance bottlenecks, and that improves things overall. As in my example.
1
@adamestrada7610 Still only Python 3.7!? Because the current oldest upstream-supported version of Python is 3.8! Are Microsoft providing their own support for 3.7? (Somehow I doubt it.)
1
Including instil feelings of inadequacy in the Emacs-envious.
1
I was able to do a database dump from old MYD files by starting an instance of a compatible-version MySQL server in a container.
1
Nevertheless, an IDE still has the “project” concept, and you have to go out of your way not to use it. Emacs doesn’t have that concept at all.
1
Bloomberg Finance did a presentation at a Python conference a few years ago, where they demonstrated how they create quite amazing-looking custom dashboards for their users inside Jupyter notebooks. They even open-sourced the add-on toolkit they use to do it.
1
Yes. For example, I saw a PHP password algorithm using MD5, which sounds bad. But it iterates the hash 8000 times, which is good. Not suitable for cryptographic message hashes, but good for password hashes.
1
Python lets you “import «fullname» as «nick»”, to shorten the references a bit without resorting to wildcard imports. Has C++ got that feature yet?
1
With single-character names, you can adopt conventions like implicit multiplication. E.g. instead of “a × b”, you can just write “ab”. That doesn’t work with longer names: how would you know that “widthheight” is supposed to represent “width × height”?
1
@miguelguthridge With maths formulas, the structure tends to be more important than the pieces, and the ability to manipulate that structure, e.g. to solve for different variables, is also important. In short, concentrate more on “derivation” than “memorization”.
1
@miguelguthridge Try it and see.
1
Idempotency is particularly important for resource-disposal routines. The canonical† example is free(3) https://man7.org/linux/man-pages/man3/free.3.html : when given a NULL pointer, it does nothing and returns no error. I go into more detail about why this sort of behaviour makes it easier to write robust code here https://github.com/ldo/a_structured_discipline_of_programming . †Did you include “canonical” in your list? Get your definition from here http://www.catb.org/jargon/html/C/canonical.html .
1
1:27 That should be “$nums[1]”. 1:34 And that should be “$friends{'Larry'}”. Welcome to Perl syntax. Does it make sense yet?
1
SQL is de rigueur for interfacing to just about any RDBMS. Even the non-relational ( née “NoSQL”) DBMSes are now adopting some form of SQL as their query language.
1
They have to get it via a trusted channel somehow. It’s not a large amount of data.
1
1:32 This is one aspect of PHP’s language design which shows what happens when you only think about things part way. Understandably, they did not want to copy the Perl (mis)feature of implicitly declaring all variables as global unless specified otherwise. So they decided that all variables would be local unless specified otherwise. This turned out to be a nuisance for global data like “GET” and “POST”. So they decided that built-in globals would become “superglobals”, visible everywhere without having to be declared global. Too bad about not being able to do the same with your own globals! Python adopted a different, admittedly slightly more complex rule: assigning to a variable would automatically create it as local, unless declared otherwise; but you could refer to an existing global/nonlocal variable without having to declare it (provided you did not also try to assign to it).
1
@blackplaydoh3522 Java-only programmer?
1
@marcasrealaccount Yuck.
1
@blackplaydoh3522 Couple of convenience examples, from C++: typedef std::map<RegionCode, IDType> RegionCodeTable; /* mapping from region code to name ID */ typedef RegionCodeTable::const_iterator RegionCodeTableLister;
1
@The Adjudicator What do you think an “enterprise” like Facebook runs on? Hint: they created their own variant of PHP, called “Hack”, with their own high-performance implementation, the HHVM.
1
3:23 Spot the false equivalence between the C++ and Python code ...
1
@xrafter The OP did say “archiving a folder”, not “archiving a single file”.
1
Because building an IDE on top of such a bloated framework as Electron is perhaps not such a smart idea ...
1
Embittered Visual Basic fan speaking?
1
Different parts have different licences. You can build it without any non-free parts.
1
@matthewboyer4212 Depends on whether you prefer a licence that guarantees the same rights to the recipient of the software that the giver has, or not.
1
@matthewboyer4212 Copyleft has been described as a kind of “copyright jiu-jitsu”, where you use your adversary’s strength against him.
1
@matthewboyer4212 I would. And I’m not the only one. Linus Torvalds said deciding to release the Linux kernel under the GPL was the best decision he ever made. You don’t like it, you know what you can do.
1
@matthewboyer4212 ∗Yawn∗
1
@matthewboyer4212 Like I said, you know what you can do.
1
Trying to automate a GUI never really works that well.
1
Other countries also have the number-one cause of death of their children be by gunshot wounds, right? ... Right?
1
3:29 Here’s the funny thing: in Python, “everything is an object” is true even more so than Java: the latter has “primitive” types which are different from “object types” or “reference types” (can’t remember what they’re called). For example, in Python, “int” values are objects with methods like any other objects, while in Java they are “primitive”, and you need to have “boxing” and “unboxing” mechanisms to convert between “int” and the “Integer” object type. And yet, Python manages not to devour all your RAM the way Java does. Why not?
1
LO Writer can open multi-hundred-page documents without choking.
1
Anybody remember what happened to WebSQL? That failed for an interesting reason ...
1
Previous
8
Next
...
All