Is the "C" language more complex than Java?


Goodnight! Colleagues it so happened that I myself write in Java but we are thrown very different projects, and on Monday a project should come (related to network protection) for long-term support and a bug-fix that is written in the purest "C" (so we were told) like remember "C-shku", and although I graduated from high school but studied from the very beginning php then Java (even a little C# after Java), but with pure "C" somehow I did not have to meet we don't have any Java projects yet !
At first glance, it seems like a simple language without OOP, and then who knows!!!
Many thanks to everyone who dares to answer at least a line ...

Author: Stanislav Pankevich, 2014-01-17

6 answers

@Oleg_Samitch Your more experienced colleagues are worthy of sympathy. C is a simple but elegant low-level language. What may be unusual after java - manual memory management (allocated dynamically - do not forget to release and do not neglect the use of tools to track this process) and (what is important for reading someone else's code) massive use of side effects. Well, you know about the lack of OOP mythology.

 2
Author: alexlz, 2014-01-17 17:44:26

Another problem is pointers, arrays, and strings. They are very similar in C syntactically, which often leads to misunderstandings.

A separate point is manual memory management and understanding that a pointer in C (as opposed to a reference in Java) can point to unallocated, uninitialized, or freed memory.

Another major difference: resources in the absence of GC have a owner - an entity (code) responsible for the timely release of the resource.

 3
Author: VladD, 2014-01-17 19:24:15

I will also contribute my 5 kopecks.

I do not get tired of repeating to everyone that C (it is the language, not the libraries and the system) is as simple as a stick and a rope, which is why it is good.

What the program uses to work with the network (it is said about network security) is unknown. Maybe pure RAW sockets, maybe some library, but you definitely have to study a bunch of RFC's.

The project, at least in *nix-ah?

 2
Author: avp, 2014-01-17 19:33:34

C and C++ are very different from C# and Java. As far as I know, c# was developed by Microsoft as an answer to Java, and many things that you have to do manually in c/c++ are handled by Java and C# themselves. This is a very long journey, if you dare, and a" simple bugfix " rally is unlikely to succeed.

 1
Author: etki, 2014-01-17 17:23:15

It is difficult for a normal programmer to switch between different languages, for example, from java to erlang or haskell. Large entry threshold. And between related languages, it's easy.

There will be three problems with pure c:

  • lines manually.
  • there are not many "convenient things" (for example, such a familiar List, you need to write or take something ready).
  • clean up after yourself (no GC).

But there will be advantages:

  • compiles quickly (unless it is microsoft)
  • the number of abstractions is much less than
  • is addictive.
 1
Author: KoVadim, 2014-01-17 18:58:06

Pure C is likely to be very complex after Java/C#. In the sense that there is no automation. Even primitive classes like String will be hard to emulate.

When I have to write on it, I often swear because sometimes it is not clear what the error is. Compilers give out more often than in Java/C# some general errors and you will not understand where exactly and why they occur.

But I'd say it's worth a try.

It will be very difficult with pointers and thongs (more precisely, with the absence of a thong). But no matter how you look at it, C turns out to be more speed-efficient programs than in many other languages.

 1
Author: Walter Nuss, 2014-01-17 23:53:28