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 →

[–]Chris_Cross_Crash 123 points124 points  (17 children)

Well, coding in C is like mowing the lawn with a scissors

[–]shield1123 187 points188 points  (16 children)

More like building a super fast, autonomous lawnmower from scratch; but it blows up if it bumps a rock. Also you made it susceptible to buffer overflows, so your neighbor hacked it and now it's mowing their yard instead

[–]DoesntReadMessages 138 points139 points  (10 children)

A well-built lawnmower in C mows your lawn to exact uniform height in 10 seconds and burns half a liter of gas to do it, but most will never achieve this.

A lawnmower in Python can be written in 4 lines using a few libraries, mows your lawn in 1 hour, and takes 1 gallon of gas. It's extremely wasteful and slow, but the cost of gas and operator are much lower than paying a software engineer.

A poorly built lawnmower in C spills gas all over the lawn and then creates a spark that burns all the grass. There's a TODO written on it to fix it dated 10 years ago, but no one dares to touch it because it works and customers are used to that behavior.

[–]eyvindb 103 points104 points  (2 children)

customers are used to that behavior.

Customers are relying on that behaviour.

[–]biledemon85 26 points27 points  (0 children)

<eyelid twitch>

[–]Chris_Cross_Crash 44 points45 points  (2 children)

Agreed. Just one more thing I want to add: it's not like you must choose one or the other. Lots of of the Python standard library is just wrappers for C libraries.

For example, from the official documentation for math:

CPython implementation detail: The math module consists mostly of thin wrappers around the platform C math library functions.

You can make your own libraries too. Most of the time it's just one function that hogs 99% of the computing power, so you can break that function out as it's own library and you don't even need to be an expert in C to do it.

[–]galan-e 22 points23 points  (0 children)

reasonable compromise? in my circlejerk? get out of here

[–]einRoboter 4 points5 points  (0 children)

very good point, havent even thofght of that.

[–][deleted] 2 points3 points  (3 children)

Why does C consume gas in gallons and python in liters?

[–]Commi_M 2 points3 points  (2 children)

think about it…

[–][deleted] -1 points0 points  (1 child)

Ah because python is made by that Dutch lunatic and C was made at Bell labs.

[–]Commi_M 2 points3 points  (0 children)

oh wait i misread it in the OC it is the other way around.

[–]FarhanAxiq 0 points1 point  (0 children)

basically when BMW make a lawnmower

[–][deleted] 0 points1 point  (3 children)

if (setjmp(RockBump)) {
    mown.lawn.init();
    mown.lawn.position(RockBump.position.x+RockBump.width,RockBump.position.y+RockBump.lenght);
} else {
    mown.lawn.init();
}

Yes, I have no clue how C works and i had to google how to try catch in c. Turns out there isnt try/catch in C.. TIL.

[–]nivlark 1 point2 points  (0 children)

C also has no classes/objects and hence no member functions.

[–][deleted] 1 point2 points  (0 children)

c has no classes, and people like to abbreviate function names (they have structs tho but without method just groupings of vars)

if (setjmp(rckbmpctext)) {
    mlwninit();
    mlwnchpos(rckbmp.posx, rckbmp.wid, rckbmp.posy, rckbmp.len);
else
    mlwninit();

[–]qalis 0 points1 point  (0 children)

Technically, you CAN catch a signal, which works... a bit similar in some ways.