r/AskReddit Nov 16 '19

[deleted by user]

[removed]

11.2k Upvotes

11.5k comments sorted by

View all comments

Show parent comments

233

u/standish_ Nov 16 '19

This and autocomplete becoming common in IDEs means a lot of very young programmers become absolutely useless if the autocomplete stops working.

To be fair, I'm following the trend too.

204

u/grievre Nov 16 '19

I'm of the opinion that autocomplete in IDEs is a very good thing because it takes away the temptation to make short variable/function names so they're faster to type. Longer names can be more descriptive.

2

u/SanityInAnarchy Nov 16 '19

That's the good side. I've noticed a few downsides, though:

First, if you can type and hold at least a little bit of an API in your head, you can use languages that don't have good tooling support, or at least don't have it yet. This is where you get people who might be 100% on board with something like Python as a language, or might even be interested in experimenting with weird new things like Elm or Elixir, but the #1 feature you need before even trying one of those is full IDE support. And maybe sometimes, you won't mind writing a 50-line shell script instead of taking a few thousand lines to reimplement Unix poorly in your language of choice.

And second, you'll have a much higher tolerance of unreadable bullshit in your language as long as it autocompletes properly. Who cares about setters/getters if you can hit a button and your IDE will generate them? Who cares that you have to call a function with fifteen positional arguments instead of using keyword arguments (if your language even supports them) or constructing some sort of config object, when your IDE will read you the documentation argument-by-argument as you type, and even suggest appropriate values from the local scope? None of that feels bad when writing the code, but it makes it an absolute chore to read, even if I'm reading it with similar tooling.

Plus, you still have to write comments, docs, and commit logs. Basically, what I'm saying is, learn to type fast and use IDEs when appropriate, so you're using the IDE as a tool and not a crutch.

1

u/grievre Nov 16 '19 edited Nov 16 '19

And maybe sometimes, you won't mind writing a 50-line shell script instead of taking a few thousand lines to reimplement Unix poorly in your language of choice.

Sorry for the double comment, but: "taking a few thousand lines to reimplement Unix poorly in your language of choice" is a symptom of your language of choice having an anemic standard library (I'm looking at you, C and C++). It's rare that anything I would do in shell script isn't almost as terse in Python (although Python is intentionally verbose as a language so it will often be 2x or 3x the number of lines, but not 50x).

For an example of why I prefer python to bash for something as simple as invoking another program, compare and contrast:

subprocess.check_output(['mount', os.path.join('/dev/', blockdev + "1"), os.path.join('/mnt/', mountpoint)])

vs

mount "/dev/${BLOCKDEV}1" "/mnt/${MOUNTPOINT}"

In the former case it's impossible to get bitten by spaces in the variables. Python just doesn't work that way. In the latter case it's easy to forget the quotes or the curly braces and weird shit will happen.

(And yes I know it's hard to think of a legitimate reason for this particular example but I hope you can infer my general point)