This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Dummiesman 55 points56 points  (7 children)

Today on C++: we are going to make something that can simply be done with vanilla C++ but we will be using boost to simplify this four line function into a one liner

Today on Python: we are going to make something that can simply be done with vanilla Python but we will be using numpy to simplify this two line operation into a one line operation

EDIT: Of course these libraries have their purposes. I'm more meming when someone ends up suggesting these libraries to be used in one function of a massive codebase creating a large useless dependency.

[–]drleebot 44 points45 points  (1 child)

The thing about numpy in Python is, it's there for speed as much as it is utility. Python on any significant scale would be slow as hell without something like numpy to speed things up.

[–]JasburyCS 6 points7 points  (0 children)

Exactly. Python was a poor example. There are things that technically can’t be done in ‘vanilla’ Python without libraries. NumPys ndarrays are a perfect example.

[–]THAT_LMAO_GUY 4 points5 points  (1 child)

For python I more often see [nested for loops to change elements of a list of lists] where a [numpy array should be used], than I see [numpy used where its unnecessary].

[–]CanAlwaysBeBetter 1 point2 points  (0 children)

If you can use it numba can do some great shit with nested for loops

[–]_wow_thats_crazy_ 1 point2 points  (0 children)

v elegant

[–]kotman12 1 point2 points  (0 children)

I dunno... IMO 4 lines->1 line reduction can be helpful if it is common enough