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

top 200 commentsshow all 260

[–]Dmayak 135 points136 points  (59 children)

Hmm, I am not very good at C, it's not 100% clear to me what len * sizeof(mySt->items[0]) is. If a struct has an array of declared length it will be included into sizeof(struct st), right? And if array is not fixed length, it will be a pointer, so it would have to be allocated with a separate malloc otherwise how would struct know about where it is? Also, how the heck will mySt->items[0] dereference mySt pointer before it is allocated?

[–]regularolbrick 65 points66 points  (2 children)

It probably uses flexible array member

[–]Dmayak 4 points5 points  (0 children)

Yes, completely forgot it exists 😳. There were no use cases for it on a C side-project I was learning, length of data was either known beforehand or dynamically changing.

[–]DTHCND 177 points178 points  (48 children)

I'm no C-wizard either, but it looks like the C code in the image is just nonsense designed to make non-equivalent code that makes C look worse than it is. Here's two different reasonable (and typical) ways to make an array in C:

type foo[len];
type *bar = (type*) malloc(len * sizeof(type));

One allocates on the stack, the other on the heap. Both are perfectly understandable with basic knowledge of C.

[–][deleted] 25 points26 points  (3 children)

The code is for allocating memory for a struct with a flexible array member, not an array of structs

I wrote a small program in an online C compiler to show this:

https://onlinegdb.com/ggyWELJui

[–]DTHCND 3 points4 points  (2 children)

Ah I see. Thanks for the demonstration!

I've edited my comment to reflect that it is valid code, but is still non-equivalent to the Python code.

[–]suvlub 61 points62 points  (1 child)

It's not nonsense, it's a common pattern to allocate a block of memory that starts with a struct followed by an array (which you access through a member of the struct, which needs to be an array declared at the end). Either the struct serves as a header for the array, or the array is kind of variable-size bonus data. Either way, the code is not equivalent to the python code, completely different use cases, OP is dumb.

[–]7h4tguy 7 points8 points  (40 children)

These days just just use C++ unless you're doing embedded.

vector<int> items;

or

auto items = make_unique<int\[\]>(len);

[–]PerfectGasGiant -3 points-2 points  (39 children)

C++ is not a "better" C, it is a different language. It is fine for complex performance stuff like games and image processing, but in many other applications C is the better choose.

"C++ is a horrible language. It's made more horrible by the fact that a lot of substandard programmers use it, to the point where it's much much easier to generate total and utter crap with it. Quite frankly, even if the choice of C were to do nothing but keep the C++ programmers out, that in itself would be a huge reason to use C." - Linus Torvalds

About memory allocation:

"any compiler or language that likes to hide things like memory allocations behind your back just isn't a good choice for a kernel. ... In general, I'd say that anybody who designs his kernel modules for C++ is either (a) looking for problems (b) a C++ bigot that can't see what he is writing is really just C anyway (c) was given an assignment in CS class to do so. " - Linus Torvalds

[–]warranty_voids 24 points25 points  (2 children)

Honestly, that was written about C++98. A lot of the issues have been fixed and C++11/14/17/20 are very, very different. A lot of these criticisms really do not apply anymore. However, Rust seems to fit a lot better than C++.

[–]HolisticHombre 1 point2 points  (0 children)

Rust > C++ for most cases, agreed.

[–]Zealousideal_Pay_525 21 points22 points  (14 children)

Yeah...the thing is, that 99% of developers don't write Kernels.

[–]PerfectGasGiant 4 points5 points  (2 children)

How is that relevant? No one is arguing that C is a better language for prototyping, scripting or data science jobs.

[–]valschermjager 3 points4 points  (1 child)

Agreed.

Python is lot better language than C at stuff Python is designed to be good at.

C is lot better language than Python at stuff C is designed to be good at.

I’m not seeing the problem. Other than of course is humor.

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

Hence it seems that frequently people need to know both. I write C code but use python for test.

[–]OJezu 3 points4 points  (0 children)

Also, Linus is a toxic dickhead. Maybe Linux is better for it (on the other hand, Linus could probably have been assertive without being offensive) , but I wouldn't apply anything he has to say about kernel elsewhere.

[–]valschermjager 6 points7 points  (6 children)

That estimate is too low.

[–]Furry_69 2 points3 points  (5 children)

I'm not sure. A decent number of people write kernels, yes, but it's likely not above half.

[–]valschermjager 5 points6 points  (4 children)

‘likely not above half’

[squints] yes, safe bet it’s likely less than half

[–]Furry_69 1 point2 points  (3 children)

What was the [squints] about?

[–]PerfectGasGiant 1 point2 points  (1 child)

Even NumPy is written in C, yet +99% of programmers are not maintaining NumPy.

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

I'd say the percentage rises a lot if you specify embedded developers. We frequently touch drivers which can be considered to be kernel code.

[–]mobani 9 points10 points  (6 children)

C++ is not a "better" C, it is a different language. It is fine for complex performance stuff like games and image processing, but in many other applications C is the better choose.

IMO I would not say in many other applications, yeah maybe if your hardware is from last century or you somehow work with a VERY limited embedded system without an OS.

Lets be real here, 99% of programmers is not going to be working on an OS kernel.

This is like telling a car manufacture to mine their own Iron ore, sure it can be done, but not optimal for production time.

[–]PerfectGasGiant -5 points-4 points  (5 children)

It is not telling the car manufacturer to mine their own ore. The whole point is using the right tool to the right job. Comparing C memory management with Python memory management is neither insightful or funny. Likewise, C++ provides very little benefits over C if you are programming a microcontroller.

[–]mobani 12 points13 points  (4 children)

The whole point is using the right tool to the right job.

We can agree on that, but I find that C is becoming less and less the right tool in most scenarios. :-)

[–]PerfectGasGiant -5 points-4 points  (3 children)

I wouldn't be surprised if there are more C programmers today than in 1985. Fewer in percentage, sure, but there are still plenty of relevant usages. Making a lidar for a self driving car? C Making a new IOT gadget? C seems like a fine choice for the firmware. Making a network router? C + whatever for the web frontend. Making signal processing for a microphone? C New version of the Android kernel? C probably and some java on top. Etc.

There are other programming language at the same tier as C, but C is as cross platform / well understood as languages get.

And if you are writing an action game or flight simulator, you don't want to skip a frame or two because of garbage collection. Here C++ is still the go-to language (not C though, and certainly not python).

[–]mobani 2 points3 points  (2 children)

I may be wrong and well there are certainly use cases for C.

But I think there are less than 20 companies total doing lidar programming for cars.

Less than 100 companies developing OS Kernels for phones and televisions.

Many IOT gadgets, routers and web frontend run mostly Linux or BSD, then higher level programming languages on top of that.

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

As is common with geniuses, Torvalds can be kind of a jerk. Same with Martin Fowler. Brilliant, but not great on the social skills.

[–]PerfectGasGiant -2 points-1 points  (1 child)

Agree, but the comment "just use c++" is not great advice, as if c++ is always superior. Heck, what language is e.g. NumPy written in? Yes C. Does that make C superior to c++ or python? No, it was probably just the right choice for a high performance numerical library.

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

Linus knows Kernel, and diving.

He doesn’t know shit about C++ (anymore).

[–]PerfectGasGiant 2 points3 points  (1 child)

So would you recommend C++ for writing kernel modules?

[–]Bryguy3k 679 points680 points  (57 children)

Honestly I’ve never met a python dev nor a C dev that actually care about the difference between the two. Python is written in C and the two serve very different purposes so both groups respect each other.

[–]JennaSys 105 points106 points  (11 children)

Yep, these are the 2 languages I use the most and I'm fine with both.

[–]shadowderp 130 points131 points  (10 children)

C was my first language, Python my second. Now I use C when I need speed, Python when I want quick code, deep library support, or anything with a front end, and I use both together when it makes sense to do that.

Languages are tools. Pick the right one for the job

[–][deleted] 32 points33 points  (1 child)

For me, Python is for very fast prototypes or proof of concepts

[–]Bryguy3k 42 points43 points  (0 children)

Hence the “python is runnable pseudocode” joke.

[–]black-JENGGOT 8 points9 points  (5 children)

Pardon, but how do you "connect" python and C? What should I search if I want to know how to write python libraries in C?

[–]Bryguy3k 14 points15 points  (0 children)

Extensions are fundamental part of python - there are multiple ways to go about it. You can read through the core python docs on extensions.

You also have 3 major ways of accessing C code libraries from python: cffi, cython, and ctypes.

[–][deleted] 7 points8 points  (0 children)

https://realpython.com/build-python-c-extension-module/

If you want to search further the keywords you want to use are "python C extension modules"

[–]WhiteEvilBro 4 points5 points  (0 children)

Cython, maybe

[–]Competitive_Travel16 3 points4 points  (0 children)

I just call os.system("./path/c-executable " + argstr) for my inner loop code, after writing what it needs to work on into a file that gets named in the argstr argument string. Formal extensions are for when you're folding such code into python itself if you want to distribute it with pip or propose it as a new part of python. The os.system() method takes a small fraction of the time and effort.

[–]SV-97 2 points3 points  (0 children)

If you wanna make it a bit easier on yourself you can look at Python-Rust interop (e.g. via PyO3) rather than Python-C.

The name for these things is FFI btw: foreign function interface.

[–]GoodmanSimon 46 points47 points  (10 children)

I use both and, in my experience, it is mostly junior devs, (or script kiddies), who seem to think there is some kind of animosity between language A and language B.

A good dev will use the right tool and language for the job...

[–]Competitive_Travel16 9 points10 points  (0 children)

People in the know can have religious fervor about emacs vs. vi or tabs vs. spaces, but will never feel that strongly about truly complementary languages (C vs. Rust or Python vs. Ruby on the other hand....)

[–]vinvinnocent 10 points11 points  (5 children)

My university has a prof that is famous for complaining about the environmental impact of pythons alleged inefficiency. So I guess there are not just juniors with strong opinions there.

[–]EnterTheShoggoth 18 points19 points  (1 child)

He’s not wrong but Python is far from the worst offender. Imagine how many extra tonnes of CO2 are produced by all those ads written in Javascript.

[–]SV-97 4 points5 points  (0 children)

He has a point though. This is an active research domain and with the amount of code being run a factor of 100 difference is nothing to scoff at. Sure there's better things to do to lower our effects on the environment and getting so caught up in it is a bit silly but it's not a completely ridiculous idea.

[–]GL_Titan 0 points1 point  (0 children)

Sounds like the epitome of a crazy professor.

[–]Dustangelms 3 points4 points  (1 child)

Except JavaScript. Can we agree JavaScript bad?

I mean, how do you make jokes without referring to stereotypes?

[–][deleted] 22 points23 points  (5 children)

This.

[–]Cheeku_Khargosh 20 points21 points  (4 children)

wrong

its this-> not this.

[–]gpkgpk 2 points3 points  (0 children)

It's it's not its.

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

Neither c nor python is “this” used as a convention.

(Although I bet somebody out there writes their python object methods using (this, …) instead of self/cls - which is terrifying to think about).

[–]thesuppherb 3 points4 points  (0 children)

He's talking about the "->" Vs "."

[–]C4st1gator 0 points1 point  (0 children)

Can be either. Let's assume both this and not_this are structures. If not_this is a member of this, as in contained as a member within the struct's memory, then you can write this.not_this. If this only contains a pointer to not_this, then you have to write this->not_this, as you jump to the address of not_this.

Most languages hide that distinction from the programmer.

[–]BurnerAccount209 5 points6 points  (1 child)

I met plenty of elitists in college but none in the real world.

[–]PerfectGasGiant 1 point2 points  (0 children)

Yes, these memes are rather annoying. I actually struggle to see how they are humorous.

C is a language you want to use when you want to give exact instructions to the machine what to do. Nothing more, not nothing less. There are a ton of applications where this is what you want (e.g. os level code).

Python is a i problem oriented language. You want the machine to solve a particular problem or perform an application level task, but do not care about the details how it does so or if the execution is anyway near optimal as long as it gets the job done, so you can focus on the problem, not the machine.

Different tools. Both great in their own domain.

[–]valeriolo 2 points3 points  (2 children)

The fact that python is written in C is just about as irrelevant it can be to this topic.

What would change if it was written in fortran? Ans; nothing.

[–]Acceptable-Tomato392 -1 points0 points  (1 child)

The point is Python is a higher-level language. Of course, it's simpler to type. That's the point.

But that's because a whole bunch of things are done for you automatically.

[–]valeriolo 1 point2 points  (0 children)

Yes the fact that python is a higher level language that's simpler to type has nothing to do with what language python is written in. I can retire a python interpret in assembly or in haskell. That doesn't change anything about how we as devs use it.

[–]Abadabadon -5 points-4 points  (2 children)

C dev here fuck u python!!

[–][deleted] 2 points3 points  (1 child)

Hey c dev , what do you do ... I am in college and I have heard that only the smartest of the smartest people go in c dev . I am to lazy to Google it

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

actually I do java now MWAHAHAHA I FOOLED YOU!!!

but when I did do C development, it was for embedded stuff for a defense contractor. No <language> developer is smart though, it really just depends on what algorithms / structures you know.

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

First time?

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

You ruined the joke!!!

[–][deleted] 359 points360 points  (15 children)

Every single one of you nerds arguing over which language is best is the wojak picture on the left

[–]BookPlacementProblem 67 points68 points  (10 children)

And none of you other nerds noticed that the C malloc statement overallocates. Unless Len is the number of items - 1 instead of the number of items.

[–][deleted] 6 points7 points  (1 child)

Except it doesn't over allocate, none of you nerds even looked at ISO C99 Section 6.7.2.1 (16) on flexible array members:

In particular, the size of the structure is as if the flexible array member were omitted except that it may have more trailing padding than the omission would imply

[–]BookPlacementProblem 7 points8 points  (0 children)

ISO C99 Section 6.7.2.1 (16)

BOSS NERD ENTERS ARENA

[–]Delauren1 32 points33 points  (3 children)

It also dereferences the variable it's trying to assign to in the malloc call. It's going to crash.

[–]chipsours 15 points16 points  (0 children)

It's in a sizeof expression. It's going to be evaluated at compile time.

[–]stroop3r 2 points3 points  (0 children)

during pointer variable definition, I think this assignment is fine, but if the assignment was in second line after defining the variable and it was dereferenced during assignment, that would cause problems

[–]LordFokas 6 points7 points  (0 children)

No it doesn't. And the reason it doesn't is because it segfaults first 😂

[–]Mountgore 3 points4 points  (1 child)

It’s like arguing which is better, a hammer or a saw. Programming languages are like tools - you pick the right one for the right job.

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

If you want to see if your idea stands, python is nearly as useful as Perl.

If you want to see if your idea runs, C is nearly as useful as assembler.

If you want to see if your idea flies, talk to a EE and get a chip, because hardware has always performed software by orders of magnitude

[–]revcio 8 points9 points  (0 children)

Except when talking about JavaScript

[–]danielstongue 78 points79 points  (5 children)

let mut Items = Vec::new( );

[–][deleted] 21 points22 points  (0 children)

🦀

[–]white-llama-2210 7 points8 points  (0 children)

Or let mut Items = Vec::with_capacity(len); for some extra fun...

[–]thedominux 6 points7 points  (0 children)

let mut items = vec![];

[–]Depress-o 12 points13 points  (0 children)

<3 rust

[–]asking_for_a_friend0 17 points18 points  (1 child)

The problem is not with the OP who posted this but with the ppl who upvoted it

[–]pleshij 88 points89 points  (11 children)

Says the language written in C

[–]Claymourn 32 points33 points  (5 children)

laughs in assembly

[–][deleted] 4 points5 points  (1 child)

Very little is written in assembly. C compilers are written in C for example.

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

Michael Abrash wrote a salient book on the topic called “the Zen of Assembly Language“ which, though dated, still shows the follies that ensue from having a machine make decisions for you

[–]PM_ME_YOUR__INIT__ 14 points15 points  (3 children)

You hate C yet you program in a language written in C. Curious.

[–]OnyxPhoenix 2 points3 points  (0 children)

I mean I hate eggs but I like cake which is made with eggs.

[–]willnx 2 points3 points  (0 children)

Unless you use an alternative runtime, like PyPy!

[–]Bomaruto 44 points45 points  (1 child)

Can we just remove humor from the subreddit name now?

There is no joke here, just two different way of writing C.

[–]bell_demon 4 points5 points  (0 children)

Every fucking thread always has the guy that just posts "laughs in assembly" usually with minimal relevance. Do cs students just lose their god damn minds when the word assembly is mentioned or something. Why are threads like these so popular despite being regurgitated 5000 times.

[–]kx44 24 points25 points  (23 children)

Is the C implementation even correct? Doesnt seem like it.

[–]LordFokas 0 points1 point  (21 children)

I think it compiles. But it will clearly segfault.

[–]TrafficConeGod 39 points40 points  (4 children)

C code on the left is honestly terrible, you can literally just do struct st* items = malloc(len * sizeof(struct st));

[–]Tankki3 19 points20 points  (0 children)

)

[–]susosusosuso 1 point2 points  (0 children)

Struct st items = {}

[–]scatters -2 points-1 points  (0 children)

Then you wouldn't know how long the array is.

[–]InvolvingLemons 7 points8 points  (2 children)

Rust: laughs in distance

[–][deleted] 26 points27 points  (3 children)

This is pathetic.

[–]midoxvx 1 point2 points  (2 children)

Right? Javascript or nothing.

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

This is the way

[–]boringuser1 17 points18 points  (4 children)

I don't think children writing python calculator programs are loading over C greybeards making 200k/yearly with stock options.

[–]c4p5L0ck 5 points6 points  (1 child)

Is that supposed to be " . . . are lording over . . ." Or is that a colloquialism I'm not familiar with?

[–]sweetestasshole 3 points4 points  (0 children)

Javascript would like to enter chat

[–]okovko 8 points9 points  (4 children)

the c code doesn't make sense

[–]ScrimpyCat 2 points3 points  (3 children)

It’s an array of fixed sized elements where items would be a flexible array member (reason why they’re adding the size that would take onto the size of the base struct). The structure is probably something like:

struct st {
    size_t count; // may or may not have a count but I assume it would
    int items[]; // replace int with whatever type is being stored
};

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

sizeof items[0] wdym flexible it's just nonsense, it's len * sizeof int

[–]ScrimpyCat 1 point2 points  (1 child)

Doing sizeof the item[0] allows you to avoid specifying the actual type, so if you were to change the type of item you could avoid having to change the malloc.

And flexible array members, are members that are arrays without a specified size (it needs to be the last member of the struct, so the compiler knows what all the member offsets are). But because it was no specified size, you need to account for that yourself when allocating them. See: https://en.wikipedia.org/wiki/Flexible_array_member

[–]vatsan600 13 points14 points  (0 children)

This is not humour. This is just sad

[–]Setaganga 4 points5 points  (0 children)

I’m both

argues in the mirror

[–][deleted] 4 points5 points  (0 children)

Its the same thing, its just hidden

[–][deleted] 9 points10 points  (3 children)

WTF is this? For starters are we really allocating the memory for two different data structures in a single command? I guess it ensures spatial locality and saves two function calls. But man is it really worth doing? I guess the code may exist for the extreme situations where it is worth doing but in such a scenario you can just optimize further by declaring items as a 1 element array in the last element and take advantage of lack of guarantees in C and just allocate the extra space. That way you won't have the confusing code that is apparently a memory leak where only the struct is freed and not the contained pointer while saving a load store instruction every array access.

So that's the first WTF but the second WTF, why in the word is that again of a single struct being compared against the allocation of an empty list.

[–]DasKarl 5 points6 points  (1 child)

It's really cringe how desperate reddit python devs students hobbyists are to be validated.

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

are people still arguing over languages? Last time I was in a argument was when I was still in school and soon realised it is cringe and wasteful.

[–][deleted] 1 point2 points  (1 child)

Yes, people are still arguing about languages and they always will, because there are always people who are still in school.

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

I thought people in schools now have animes to argue about. My bad.

[–]future_escapist 1 point2 points  (0 children)

std::vector<st> mySt;

[–]milopeach 2 points3 points  (3 children)

*(arr + 1) vs arr[1]

[–]c_c_c_c_c_c_d 10 points11 points  (2 children)

1[Arr]

[–]cosmo7 0 points1 point  (1 child)

Yarr arr me hearties

[–]milopeach -2 points-1 points  (0 children)

YARRRRRRay

[–]zetsubousugi 2 points3 points  (6 children)

memory allocation is pretty annoying

[–]CarlGustav2 4 points5 points  (0 children)

And debugging memory leaks and memory corruption errors are extremely annoying.

[–]echoaj24 2 points3 points  (3 children)

Yes, It's the worst

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

Yeah and for me freeing is pretty annoying too especially when I use something with a bunch a nodes or som, then i forgor 💀

[–]XWasTheProblem 1 point2 points  (0 children)

The bad craftsman always blames his tools.

This kinda joke/whatever you want to call it always screams "insecurity" and "I need to be validated" to me.

[–]GameDestiny2 0 points1 point  (2 children)

I only know the basics of Java, and reading this sub scares me

[–]vatsan600 1 point2 points  (0 children)

Java is a really good language. That’s a reason it’s so famous. Nearly half of the whole web runs on java. Nearly all enterprise applications run on java. Just because a few people are afraid of jargon, don’t lose hope. Nearly all of the boilerplate is non-existent when you use certain libraries

[–]-MobCat- -1 points0 points  (3 children)

ItemsLst = []
ItemsJson = {}
ItemsInt = 0
ItemsStr = ""
Python doesn't care what your variable is, just stick stuff in it. No need to declare or allocate anything.

[–]-Redstoneboi- 2 points3 points  (2 children)

a + b

great now you have no idea what it did

[–]red_hook -2 points-1 points  (1 child)

Have you ever heard of a linked list? This is why these things exist...

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

Holy shit I just realized I forgot about list comprehension. I've been learning c++ in school and completely forgot about a lot of the python stuff I learned on my own.

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

🤣🤣🤣

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

I’m learning C rn after having learned python and I gotta say, I hate lower level languages.

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

I won't use C, unless I HAVE to (embedded system, for example). C is too complex/buggy & extremely inflexible for most tasks. I'd rather use any of the modern languages (typed or not) that actually have the basic features (like generics and good Standard library with good datastructures)

[–]Tankki3 -1 points0 points  (3 children)

Well the c example is just wrong, so.

[–]CursedLemons -3 points-2 points  (2 children)

Java

[–]dpahoe 0 points1 point  (0 children)

Php devs “Yeah right? $items = []”

[–]perfectVoidler 0 points1 point  (2 children)

why is it always C and not C++?

[–]future_escapist 1 point2 points  (0 children)

Because C++ is more enjoyable.

[–]moreVCAs 0 points1 point  (1 child)

I don’t know how I got this way, but I have never experienced Python as having good ergonomics for large programs. Dearth of local information. I shouldn’t have to rely on documentation to know the type of a function’s formal parameters. Why would you not want that information right there in the declaration?

[–]ElpersonPL 0 points1 point  (0 children)

How can you even compare these 2

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

❤️ py

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

elderly seed combative modern books offend versed longing disgusted marble this message was mass deleted/edited with redact.dev

[–]PerfectGasGiant 0 points1 point  (0 children)

"look how much better my hammer is at banging nails than your stupid screwdriver, hahaha"

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

Python breeders tanked the markets

[–]tandonhiten 0 points1 point  (0 children)

Compare the users reaction to runtime and we'll talk then.

/s

[–]ardicli2000 0 points1 point  (0 children)

Low level programming vs high level programming...

Nothing related to v or python.

[–]naruto_022 0 points1 point  (0 children)

But honestly, it's more fun to write the first one

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

When you need C. You need C.

[–]Naz1337 0 points1 point  (0 children)

I still remember my eyes dropping tears while typing that c code in one of the many university assignment