I have been given a term paper on the subject of the database, and I have a question: with what language to implement the task of C ++ or Java. I know the basics of C ++, but in the future I want to switch to Java and actually want to start learning this language now and implement a project for better learning.

That is the essence of the question, I want to hear your opinion, should I write a database in Java and will I have about 3 months to implement this project in an unfamiliar language or does this task require a good knowledge of Java, and I should be safe and write on familiar C ++?

And the second question: what is more relevant now and which language is more suitable for the purpose of writing a Java or C ++ database?

  • I have almost no experience with databases, but, as I understand it, the easiest way to work with the database is from languages ​​with dynamic typing and reflex. - dzhioev
  • one
    It is not clear, do you have to write a DBMS or use some of the existing DBMS and write a software interface to create / fill / work a specific database in it? - avp
  • Write a new DBMS, as I understand it - RandomGuest

7 answers 7

If you want to use Java in the future - write to Java. Java is a very powerful language and allows you to solve almost any problem. If you are switching to Java from C ++, I will allow you to give some advice (as a person who made this transition himself a few years ago).

  1. If you want the java philosophy to clear up in your head - read the book with the same name of Bruce Ekkel authorship. It was she who gave me the fundamental knowledge of the language. Do this before writing code (spend a week, but then spend less time fixing jambs).
  2. Java has a very powerful standard library. If you need a bike, look for it in the library first, and then in other places.
  3. Do not believe anyone that Java has poor performance, reliability, etc. So say only people who do not know her. Java is a very powerful language that allows you to do amazing things.
  4. Program, program more. 3 months of programming for 3 hours a day will give you tremendous experience that you will not get at lectures and reading books.

    @RandomGuest , times

    Написать новую СУБД 

    then, apparently (based on ~ 3 months), you should focus on the "insides", i.e. that name physical organization and API for the main operations with this level.

    Here you will have to interact quite closely with the OS to work effectively with files.

    IMHO in a similar situation at the first stage you should not strive for system-independent solutions (but keeping it in mind, developing a hierarchy of functions is no doubt worth it), therefore c ++ (or pure C) seems to be a better choice.

      I do not think that the purpose of the trivial course work was the development of a new DBMS. :)
      Most likely, we are talking about writing some kind of solution using an existing DBMS for working with data within the project.

      • +1, although in SPbU is rumored to write a small DBMS within the course project - in the order of things. - Nofate
      1. Want to learn Java - learn it. A project is a good practice, even if you fail it (which is unlikely, good students are often pulled out), you will have experience that is useful in real life.
      2. For 3 months you will not learn Java well. However, C ++ too. Java learns easier.
      3. If you are doing something with an eye to the future, you may need a framework like Hibernate. (Find and read, get ready for arrays of English text.) In general, Java is all about frameworks, you have to learn a lot of them.
      4. I think Java is more suitable for databases. (But I can be mistaken, I am not a big specialist in it.) But you must choose not by this criterion, but by the criterion "useful or not in the future." If you want to learn Java, and your course topic is not suitable, change the course topic. I do not care what type you wrote it from the beginning of the year , the practice is more important.

        For writing, the DBMS is mainly used by C, and in some moments they can connect C ++. Even Java lovers like Oracle and IBM have written their C + C ++ DBMS. This is due to the requirements imposed on the DBMS: a lot of I / O operations, large amounts of data in RAM and operations with them, and most importantly, all this should be as fast as possible.

        But, I think, you are not going to write a DBMS for real use taking into account all the features and requirements for them, so the language here will be completely unimportant to you. You can choose both Java and C ++, there should not be much difference. Some deep knowledge of the language is not needed here, but rather a good understanding of how the DBMS functions and what components it contains.

        And if I were you, I would clarify the task on the @avp issue in order to do without: "Write a new DBMS, as I understand it ."

          I have been given a term paper on the subject of the database, and I have a question: with what language to implement the task of C ++ or Java.

          Write coursework first in C ++, and then in Java - you will increase the level of knowledge of C ++ and Java, you will understand the advantages and disadvantages of languages, learn their work with the database ... in short, you will seriously increase your skill ...

          • 2
            > Write coursework first in C ++, and then in Java, you will increase the level of knowledge of C ++ and Java ... in short, you will seriously increase your skill ... and then in C #, Python, Ruby, PHP and Pascal. So then the skill will increase as it rises, even though in tmlidy immediately - DreamChild

          For a DBMS, the main indicator is query speed. Look at what the most famous SQL and NoSQL DBMSs are written on - basically there will be C, C ++, sometimes something even lower level. Java, for all its virtues, is not the fastest language, and DBMS on Java would not be too much in demand.

          • one
            Seriously? A prime example of a DBMS written in Java is Apache Cassandra. A fairly common database for storing large amounts of data. - Oleksii Shapovalov
          • one
            1. For the subd, the bottleneck is communication with the file system. especially considering the amount of data read from IDSK and written there as well 2. C ++ is faster than Java - this is a fairly common and not absolutely fair argument, which is usually used without any evidence and statistical data, which greatly devalues ​​this argument. In your case, by the way, too. Of course, for a term paper, it is extremely important to write a DBMS no worse than in the best houses in London and Paris - DreamChild
          • @ Alexey Shapovalov, rather common compared to what? (even in the noSQL area). @DreamChild, regarding point 2) I recommend to look at numbers - avp
          • @avp and what will these numbers tell us? That C ++ performance is higher than Java? So it is already known, but I did not say that - DreamChild
          • @DreamChild, You yourself write in p. 2) which is usually used without any evidence and statistical data. So I gave a link to the data from the productivity research programs in different languages ​​that solve the same problem. - avp