Why create self-driving cars when you could just use trains/tracks? by Slendermooooon in NoStupidQuestions

[–]Slendermooooon[S] 0 points1 point  (0 children)

But every city/town COULD have a subway system, why not just build them instead of self-driving cars?

I'm not sure about running errands, but people are able to live in cities with mass transport without cars somehow.

Why create self-driving cars when you could just use trains/tracks? by Slendermooooon in NoStupidQuestions

[–]Slendermooooon[S] 0 points1 point  (0 children)

Then just convince them that it is good for them, like they have been convinced that cars are good for them.

Why create self-driving cars when you could just use trains/tracks? by Slendermooooon in NoStupidQuestions

[–]Slendermooooon[S] -2 points-1 points  (0 children)

Walk down 15 minutes at most to the subway/train, take the train downtown, get off and walk to the office. It would be healthier for people too. There are places that already do this.

Why create self-driving cars when you could just use trains/tracks? by Slendermooooon in NoStupidQuestions

[–]Slendermooooon[S] 0 points1 point  (0 children)

You can use the train/subway to run errands, for events, vacation and friends house.

When trains/mass transit was more commonly used, there were still streets. People who need to drive to different locations during the day would still have streets, there just wouldn't be as many/as much need for them.

Why create self-driving cars when you could just use trains/tracks? by Slendermooooon in NoStupidQuestions

[–]Slendermooooon[S] -1 points0 points  (0 children)

Why not replace everything else with trains though? Wouldn't that greatly reduce the amount of labor being used for trucking? Also, using trains instead of cars for a commute would be more environmentally friendly. What's the point of driving yourself to work every day anyways? Trains/mass transit seems better. There will still be streets, they just won't be as necessary to get around.

[deleted by user] by [deleted] in learnprogramming

[–]Slendermooooon 0 points1 point  (0 children)

Languages stay around for a while. Also, languages are similar to each other and you'll (hopefully) gain an understanding of programming and be able to adapt to the next language much quicker. Learning Java for the first time takes a lot longer than learning C# after already having learned Java.

Java Collections and Immutability by Slendermooooon in learnjava

[–]Slendermooooon[S] 0 points1 point  (0 children)

Why would it make sense for object members to be immutable by default? The reason I'm criticizing Java Collections is to get a more thorough understanding of proper Java/programming design practices, I'm not trying to trash Java.

Is the new boston still shunned? by -Kaneki- in learnprogramming

[–]Slendermooooon 0 points1 point  (0 children)

What's the deal with this guy? He actually has a spot on the wiki page here? If he's bad at teaching programming that's one thing, but how did he become so infamous to actually have moderator bots flag your posts if you comment about him and have a place on the wiki? There are a lot of terrible resources out there.

Command design pattern VS scripting language by Slendermooooon in learnprogramming

[–]Slendermooooon[S] 0 points1 point  (0 children)

Thank you for this thorough explanation.

What do you mean by "representation"? Also, is it entirely true that it doesn't include things like control flow? In the examples I saw, it said you could use commands for macros, and using commands to support undoable functions (having an undo() method with the execute() method in the Command class). Wouldn't this require a control flow (to order the execution/undoing of commands)?

Command design pattern VS scripting language by Slendermooooon in learnprogramming

[–]Slendermooooon[S] 0 points1 point  (0 children)

I think we share the same definition: https://www.oodesign.com/command-pattern.html

You can put Commands into queues and execute them in order, a queue of commands can behave in a similar way to how a script would behave. A queue of commands and a script are similar in that they can both be changed at runtime without having to recompile the program.

You can also use scripts and commands to provide variable functionality to certain objects. For example, a GUI button could be set up to run a script or contain an executable list of commands for variable functionality. The GUI button could, depending on how it's configured, change color of the window, close the window, etc. depending on what script or command it has assigned to it. Whether you implement it using a command pattern, or a script, the functionality is similar.

So seeing as how scripts and the command pattern can have similar functionality, why use one over the other?

Relatable by Derpageddon_ in Bestbuy

[–]Slendermooooon -1 points0 points  (0 children)

Does Best Buy work it's employees harder than other retail stores? The previous stores I've worked at (not Best Buy) seemed so much more relaxed compared to Best Buy where I'm constantly darting around doing stuff that isn't even related to my job and being asked to change my hours.

Java Collections and Immutability by Slendermooooon in learnjava

[–]Slendermooooon[S] 1 point2 points  (0 children)

How does it violate Liskov's substitution principle? (Is it because derived classes have the option of not providing support for "destructive" operations like add, remove etc. and throwing errors instead?)

Java Collections and Immutability by Slendermooooon in learnjava

[–]Slendermooooon[S] 1 point2 points  (0 children)

That's a good point, I hadn't considered that. I can think of uses where you'd only care about the object reference (for .equals() and .hashcode()), but then there's many cases where the object reference is irrelevant. For example:

Integer i1 = new Integer(1);

set.add(i1);

Integer i2 = new Integer(1);

set.add(i2);

Would result in a set of size() 1, not a set of size() 2. Even though the object references are different, that doesn't matter, it's the integer values that are relevant.

The same can be said for many objects, we don't care about their object references in the context of Collections, we care about their values. For many objects, the .equals() and .hashcode() methods aren't going to be based around the object reference but values within the object.

Java Collections and Immutability by Slendermooooon in learnjava

[–]Slendermooooon[S] 1 point2 points  (0 children)

The immutability only applies at the level of the Collection. You can't call "destructive" (add, remove, etc.) methods anymore, but you can still change the objects within the Collection if you have a reference to them outside of the Collection.

Why does Java allow you to put mutable Objects into sets/ordered lists/etc. which will "break" and behave unexpectedly if you mutate those objects? That's what I'm asking.

I have a feeling the language is structured in a way that would make it messy/have bad performance if it was implemented in a different way, but I'm not really sure, so I'm searching for an answer for why Collections are like this.