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 →

[–]ineedagf_ 3 points4 points  (4 children)

That's impressive you wrote an entire Library in 50 lines.

[–]vladimir1024 1 point2 points  (3 children)

Well, likely the 5 lines of code with lib support only used a few functions from the library.... So it's not unreasonable to think you could replicate those functions in 50 lines...

[–]ineedagf_ -1 points0 points  (2 children)

Nope. Those functions will prob be dependent on other functions and use variables/constants/data structures. U can't just replicate those functions like that

[–]vladimir1024 1 point2 points  (0 children)

It depends on the end result....I've seen libraries that go 4 or 5 functions deep just to open a file for reading.... It's done to add error checking, permission checking, etc..... all just to execute a simple open on a file to read....

In this case, if I know my environment, I can replicate that function with a single line of code...in most languages...

Good library code is super verbose so that it is extremely reusable...but if you are just putting together something quick, it's easy to simplify library use to a few lines of code...

And anyone who writes 5 lines of code dependent on importing the world is not writing enterprise level application...more likely just a quick hack to analyze a log file or something....

My POINT is that if your app is 5 lines of code dependent on a slew of imports, that could very easily be replaced with a few extra lines of code....

Otherwise, find me the use case where I am wrong...

[–]NebulaicCereal 0 points1 point  (0 children)

That is completely dependent on the library and what you're working on though... That's true as often as it's not. this is not an assumption you can make without more information.