I say this not because I don't believe he doesn't have an impressive intellect, but because, well, what if someone had his intellect, but worked in an Amazon warehouse due to circumstances outside of their control?
1,472 karma · joined July 15, 2013
I say this not because I don't believe he doesn't have an impressive intellect, but because, well, what if someone had his intellect, but worked in an Amazon warehouse due to circumstances outside of their control?
And even if it is "ordinary laziness", that doesn't mean that seeking confirmation of it something is ADHD or not is a bad exercise, if you can afford it. The lack of motivation also is a very good sign that the OP is heavily disconnected from their work, and needs to find another job or lifestyle, especially if it's this bad and they don't have ADHD.
If it is ADHD, then you have confirmation of a very helpful community and set of medical and psychological tools that you can apply, and you can ignore vast amounts of advice that just doesn't work for people with ADHD.
> Do we really need to go to a doctor so that we hear that we have a problem, and we might need medicine, to focus?
Modern society can be very inflexible if you're in the wrong spot, and don't have the ability to explain why the fit is so bad.
Lastly, many people who do have ADHD have been told that they are lazy or haven't lived to their potential their entire lives. They know they don't fit in. They pick over their brains, looking for ways to do better, trying ways to do better. They are, as a population, far more self-examined than the norm. They don't need your doubt, they have plenty of their own.
A smoothie vs a peach may well have different glycemic indices. Few people chew their few up to the extent that a bender will break it down. Also, how many peaches go into a smoothie, and how much extra sugar via, say, yogurt, or smoothie mix?
Syntax is a skill floor, but it's not anywhere close to a skill ceiling.
If you want rapid-fire example of the various forms a given language commonly uses, I recommend X in Y minute guides. Those show off the various bits of syntax for a given programming language, though without rigorously defining them as such.
Part of the reason that programming syntax is usually taught by example, rather than by formalism is that the formalisms for programming syntax, well, look like this: (cribbing from wikipedia).
program = 'PROGRAM', white_space, identifier, white_space,
'BEGIN', white_space,
{ assignment, ";", white_space },
'END.' ;
identifier = alphabetic_character, { alphabetic_character | digit } ;
number = [ "-" ], digit, { digit } ;
string = '"' , { all_characters - '"' }, '"' ;
assignment = identifier , ":=" , ( number | identifier | string ) ;
alphabetic_character = "A" | "B" | "C" | "D" | "E" | "F" | "G"
| "H" | "I" | "J" | "K" | "L" | "M" | "N"
| "O" | "P" | "Q" | "R" | "S" | "T" | "U"
| "V" | "W" | "X" | "Y" | "Z" ;
digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;
white_space = ? white_space characters ? ;
all_characters = ? all visible characters ? ;
Can you take that grammar and write 10 examples of valid statements from it, with no other context?vs, if I give you
PROGRAM ASSIGNMENTS
BEGIN
MYSTRING := "A STRING";
MYNUMBER := 123;
END
That gives you a much better flavor from looking at things.Ultimately, most programming languages should have defined grammars in their docs somewhere, but most devs use them by intuition, rather than formally.
The other thing, as well, is that it's one you get past grammar as a primary concern that you gain true fluency. And there are a lot of things that are higher level than grammar that can aid/hurt a program much more than the grammar constructs (like various patterns, know algorithms, schemes of organization for different types of projects, and so on). A mostly human-usable grammar is table-stakes these days.
If you have a specific language you want examples or a grammar on, let me know, and I'll see if I can find it.
(edited for formatting)
The stdlib is quite enough for basic CLI apps, especially when you use PEGs.
Janet's event loop also makes it very handy for issuing a lot of subprocess calls.
Janet has basic HTTP servers and clients, and there is an effort to shore it up there.
SQL is useful to know, but it's hardly necessary in today's world.
Godot has a little bit of a learning curve, but easily justifies it. I've made some games in it: https://yumaikas.itch.io/. Godot, for 2D games, for me, has been a force multiplier in terms of what I can get done in X hours. For Hobbyist work, that just means you can take on more ambitious projects without having to do as much groundwork.
Barring that, you could look into bindings in your language of choice to Raylib. I've used a tiny bit of it with Janet via Jaylib.
If Lua or Fennel aren't hateful to you, there's always Love2D, TIC-80, or PICO-8. But, tbh, I really recommend learning Godot.
Now, imagine that in the hands of someone with poor taste, or, even, just rather different taste than yours.
The balance I do like to strike is to use interfaces for any classes that interact with the outside world, and then have those faked out.
That way, I can use them to provide data to smaller units, or record that business logic recorded the data I expected.
Obviously this doesn't fix if the DB interactions themselves are correct, but it's a start.
MongoDB and LevelDB both support transactions, so I'd err on calling them databases myself.
I'd argue that a filesystem is a data store, rather than a database.
That, and some windows-heavy projects still have a large amount of Batch files.
That being said, I'm super glad to have access to it when I'm stuck on Windows for deploys or the like.
Which isn't to say that people can't use Pygame to good effect, but that you're working uphill with it a lot more.
Looking at other comments here, though, it sounds like newer versions of pygame stepped up significantly in terms of what can be done. Kudos!
Granted, it could be a case of a code base adapting to change poorly over time.
For C#, you can use type reflection to get the data or shape of a piece of code or a type (GetType and friends). That isn't super fast, and isn't intended to be.
The other major C# reflection API is Reflection.Emit, which allows you emit IL at runtime. The Emit->IL->JIT process is slower than executing the code outright the first time, but once you've done it, you can get code that's as fast as as if it were compiled from source. And, in the case, you might end up with faster code, since it allows you to do transforms on how the data is laid out and compiled.
Notably, the .NET regex engine exposes options for compiling the regex down to IL if it's going to be used a lot, so a library like Trill using reflection to accelerate code by vectorizing it, while keeping better ergonomics makes a lot of sense. You still pay the cost of compiling at runtime, since it's not a compile-time transform. Those do exist for .NET, in the form of Rosalyn plugins, but that's a bit more involved still.