If you write on SI
Be at least three times lamer
They say about this:
"He is a cool programmer!"
(Fidosh songs - "What is Suxxx and What is Rulezzz")
Foreword
The reason for writing this article was the negative attitude of the professional community to this platform and programmers.
As a programmer who chose 1C, I consider this opinion unreasonable. The 1C platform is far from ideal, but, in my opinion, this is the best, and most importantly, domestic product!
And even more so - it is inadequate to judge the abilities of the programmer by the language in which he writes.
')
In this article I will describe the benefits that I found for myself in the program. The article will turn out almost advertising, so immediately disclaimer:
- I have no direct relationship with 1C;
- This article is not customized and is written solely on a voluntary basis;
- In some cases, a personal opinion was expressed, which may not coincide ...;
- The whole article, with the exception of the prologue - the author, any coincidence - an accident;
- It will be about the 1C Enterprise 8.2 platform (currently, version 8.3 is relevant, but I have not studied it yet - there is a lot of work on 1C 8.2). However, most of the above is applicable to both platform 8.3 and earlier versions, and some to version 7.7.
So let's get started.
What is it about?
Platform 1C Enterprise 8 is:
- It works in two versions - file and server (three-star) - each has its own advantages and disadvantages;
- Independent accounting system that is easy to install and configure;
- Powerful ecosystem for programmers with all the necessary objects and tools;
- Pleasant ergonomic interface;
- Relatively inexpensive solution for business;
- Franchisee network, initial training;
- The powerful base of developments and knowledge accumulated over the years;
- At times, a problem platform for system administrators;
- Not the fastest execution of algorithms (although not the slowest) is a tribute to the information content (with errors, the line number and its contents are indicated);
- In the programming language, there are no classes (inheritance, encapsulation, polymorphism), no anonymous functions, and other modern features. But for most tasks - this is not necessary!
For the organization of accounting - one platform is not enough. The platform is a kind of “engine”, an intermediate link between the program and the database. Programs for this “engine” are called configurations. The configuration describes the structure of the database in the form of objects, the texts of the procedures stored in separate modules (there are many modules, both each object and the system as a whole have them, and there are also general modules). The platform is a level of abstraction, in which a direct access to the database is not required, and also allows you to abstract from the operating system and database type.
File and server databases
The platform consists of several parts and can work in a file or server version.
In the file version, the entire database is contained in one file (with the extension “1cd”) - the platform is installed on each computer and directly reads / writes to the database.
The advantages of the file version are low price and easy deployment.
Minuses - the structure of the file "1cd" is closed, there is no single system that interacts with the database. As a result, it is difficult to use with a large number of users (tried for 20+ users - you can work). In addition, when the database size is approximately 15 GB (or more), failures occur when performing a dynamic update. Solving such failures is a difficult task, and the utility for repairing the base does not always effectively repair and sometimes cripple the base.
The solution is, first of all, setting up a daily backup of the database. In addition, craftsmen not only publish the 1cd file format, but also developed utilities for working with such files and a number of methods for solving such problems.
In the server version, the database storage platform uses a SQL server (usually MS SQL, but starting from 8.2.14, you can use some others,
for example, Firebird PostgreSQL, IBM DB2, Oracle Database), and the platform itself works using three-part architecture:

Part of the code is executed on the client, part on the server. In this case, only the server interacts with the database. At the same time, starting with version 8.2, in addition to the standard mode of operation, which was called the thick client mode, two new modes of operation appeared - thin client and web client; also appeared "managed forms", the appearance of which is built in the form of an abstract tree of elements. Programming under managed forms and the three-tier architecture is more difficult, but it allows you to transfer almost all of the load on the server (that is, you can buy one powerful server and a hundred of the cheapest office computers).
Advantages of the platform: “three-star” - load distribution, open database (officially, 1C company refuses responsibility for any data corruption, if changes were made to the SQL database except by means of their platform or server, but this stops few).
Disadvantages - price: you will have to buy client licenses for each client computer separately, separately - one license for 1C server, separate license for SQL server, if you do not use the free one. Also sometimes there are difficulties in the database. They are solved much faster due to the availability of data and the availability of external tools to work with the database. In addition, in this case, you should backup the database.
A common advantage is the versatility of the configuration code: with some exceptions, the configuration developed for the file database will work on the server database, and vice versa. An example of an exception is the transfer of a mutable value to a server or from a server to a client (in the file version this will not cause exceptions, and in the client-server variant it is prohibited).
Another plus: the platform is installed very simply, like this: “Next-Next-Next-Ok”, no tweaking or installation of any components is required.
For the server version there are a few more settings, but everything is done in the installation dialog and does not require to register something in separate files. Some difficulty may be the installation of SQL-server, because In this case, the settings are much larger (and in order to fine-tune one, additional instructions are required). But this does not apply to the problems of the 1C platform. Moreover, if you install, for example, an MS SQL server with all settings by default, then 1C can work with it.
This is more than accounting.
When it comes to the 1C platform, it is presented primarily as a program for accounting. Indeed, this is the most popular area for using the 1C platform. But not a single accounting department lives 1C!
Those who are familiar with the platform say that this is a system of accounting (automation of accounting). This is closer to the truth - there are many configurations, both from 1C and from third-party developers. Some are only indirectly related to accounting, some are not connected at all.
In general, it is more correct to represent the 1C platform as a wrapper for object database modeling, interface and 1C programming. The only limitation is that a separate database is created for each configuration, and only one (however, it is possible to additionally include external data sources, that is, other databases) as part of the configuration.
Programmer Ecosystem
Consider now the language 1C and the platform from the point of view of the developer:
The object model of the database. First, we do not work directly with databases. It is not necessary. For our convenience, all data is presented in the form of interconnected objects (reference books, documents, information registers, accumulation registers, ...), and the platform pulls this data out of the database automatically.
For example, provided that the variable “ItemName” contains a reference to the item of the Nomenclature reference book, the Nomenclature reference has the Primary Supplier information, such as Reference.Contractors, and the Counterparty reference has the attribute FullName, then the code:
..
... will lead to the fact that the 1C platform, using internal mechanisms, finds an entry in the table corresponding to the directory "Counterparties" by the identifier from the field "Primary Supplier" of the nomenclature element and returns the field values ​​corresponding to the field "FullName" in the object model of the directory "Contractors".
There can be a lot of similar dereferences - the system will cope. The only caveat - the system does not know how to optimize dereferencing, so you should strive to bring them out of all sorts of cycles.
In addition to the objects describing the data, there is a huge number of system objects - for a variety of functions. I will highlight some of them:
Value Stores
An array is an object that stores a dataset, as opposed to the classic representation of arrays. It can be data of various types (number, string, reference, other object). It has minimal functionality and is mainly used as a temporary container for transferring values ​​between other repositories.
The List of Values is an object, primarily for working with the user interface. In addition to the data, for each element it may also contain a representation, a flag flag and a picture (pictograph). It also has the methods “Select Element ()” and “Mark Elements ()” - when called, the interface dialog is shown to the user (which is convenient - you do not need to create this dialog in the configuration).
Structure and
Compliance are the repositories of the “Key” value pair value. In the “Key” structure, this is a string that obeys the rules for naming variables in 1C (without spaces, do not begin with a digit, consist only of letters, numbers, and the underscore character). In accordance - “Key” is any value. The quickest search for objects is in accordance (faster than in an array and an indexed value table).
The Table of Values is a very convenient, and rather fast, facility for storing and processing data. Columns in the table of values ​​can be added and deleted, regardless of the number of entries. At the same time, the data in the rows are not lost (or only the data from the cells corresponding to the columns to be deleted are deleted). Also, it has a method “Select String ()”, which calls the dialog for selecting a string. There are indexes.
Value Tree is an object that represents hierarchical data. It contains columns, the set of columns is the same for all records at all levels. Deleting / Adding columns in the value tree is just as easy as in the table of values. Also, it has a method "Select String ()".
Interface objects and objects for working with various data TextDocument, TabularDocument, Web-browser, ReadingFile, WritingFile, ReadingZIPFile, WritingZIPFile, ReadingXML, WritingXML, HTTPRequest and many more objects, and there is built-in help in everything in the configurator. The purpose of the listed objects is evident from their names and all this is immediately on the platform.
Separately, it should be noted that there is a “Metadata” object - with which it is possible to study the data structure in a programming language, as well as with each link or object for a directory, document, chart of accounts, etc. there is a method “Metadata ()” - providing a description of this directory / document / chart of accounts / etc. in the database (what details, tabular parts are available, the length of the code / number, etc.). It is often very convenient.
And one more thing should be mentioned about the objects: “Request”, “Designer of Request”, “Builder of Request”, “Report Builder”, “Data Layout Scheme”. This family implements a set of objects for working with a powerful query language 1C.
Query language Queries in 1C are used only for retrieving data samples with convenient selection, sorting, groupings. In the first approximation, this is the “SELECT” operator translated from Russian into SQL; however, in the 1C query language there is also a functional that is missing in SQL, namely:
- Work with configuration objects 1C, instead of SQL tables;
- Work with links, instead of SQL identifier fields;
- Dereference support, similar to how it is done in code;
- Sample by entry into the group (for reference books);
- Hierarchical totals;
- Temporary tables and subqueries (SELECT * FROM (SELECT ...)));
- The query designer is a convenient, object-based, automatically optimizing query text for fast reading, which can parse the query text (parse the query text and build an object model from it);
- The report builder is an add-on above the query mechanism, in which the functionality of automatic execution of the results is added, as well as the flexible configuration of the query itself in the “Enterprise” mode (that is, the user). As a result, a standard report appeared in standard 1C platforms, in which the user can configure what data and in what order he wants to see what is in the rows, what is in the columns, and the report itself generates an output table;
- SKD (Data Composition System) is the next model, which incorporates the functionality of a universal report and complements it with some functions for processing results.
Programming languageThe syntax of the 1C language is similar to the “Russian Pascal”, however, it differs from “Pascal” by less strictness and the absence of some constructions:
- There is no need to declare variables - you can initialize directly in the text of the module;
- There is no hard typing of variables. The system has value types, but for variables there are no strict rules on typing. The variable that stores the link may, after a couple of lines of code, already store a number or string;
- You can add variables with values ​​of different types, while the result type will be the same as the type of the first variable, for example:
= “25”+1;
- Variables with values ​​of different types can be compared for equality or inequality (but not for more or less, this will cause an exception) - naturally, such variables are not equal;
- There are functions and procedures, it is permissible to use recursion (with a restriction on the depth of recursion);
- When specifying a function or procedure without parameters, it is all the same; it is necessary to specify empty brackets at the end: here__ac ();
- There are modules: each directory and document has several, in addition, there are modules for registers, reports and processings and for each form, as well as in the configuration there is an opportunity to create common modules;
- No classes, inheritance, encapsulation, polymorphism;
- The function cannot be passed as a link, there are no anonymous functions;
- There is no reverse loop (for i: = 5 downto 1 do), but it is really needed when deleting records. Bypassing a slightly longer entry through the “Bye” cycle.
Tools- In the 1C platform, it is possible to upload / download a configuration, compare the configuration with another configuration, and partially load changes;
- It is possible to upload the texts of the modules for batch processing and load them back into the configuration;
- If the configuration is on support (all configurations from 1C are initially on support), then you can always perform a comparison and see what has been changed by third-party developers or local experts;
- It is also possible to upload / download the entire database (along with the data);
- For collective work on one configuration, configuration storage is used;
- There are also a number of rules for making changes to standard configurations, there is even a document from 1C describing the techniques and standards for changing typical configurations (and any others).
Overall impressionThe 1C language combines the clarity of the texts of the Pascal language with the frivolity of working with variables of the BASIC language. It lacks a number of features inherent in modern programming languages, but without them it is quite possible to do. In addition, the 1C platform has a powerful garbage collector, i.e. it is not necessary, for example, to clean the tables after use or to delete them.
Interface 1C Enterprise 8.2
1C Company paid special attention to the interface of its program. First of all - it is a color palette. She is gorgeous! The windows of the program are recognizable even from afar, while over many years of work - they do not cause hostile feelings, on the contrary - I want all the programs to be the same cool ones.
At the same time, the style of the platform is very strict, without ryushechek and other excesses. At the same time, there are quite useful functions, for example, remembering window sizes (dimensions are remembered only when they are changed by the user, and, at the same time, you can always reset the user settings - to the size and default position by pressing Alt + Shift + R).
The interface of the Web client 8.2 causes a number of complaints, but, it seems, the platform 8.3 carries with it a new redesigned interface - Taxi.
Prices, supply and demand, franchising
The most "tasty" advantage of the 1C platform is its price. Especially, this is relevant now, during the crisis. After all, 1C is completely our, domestic product. And it is sold for our wood. Such decisions from a foreign manufacturer will cost a lot of money. A license for 1C are quite acceptable.
In addition, 1C has an interesting licensing policy. Licenses and configurations are purchased once. At the same time, licenses are bought for the workplace and for the server, but not for databases, and not even for connections, i.e. 1, . : , ( / — , 1).
, .. . , , .
, .
The second “tasty”, but with a fly in the ointment, plus, is the presence of fairly universal configurations from 1C itself and from partners.Pro versatility«» : , , , , , . .
1 — . , , . , 1 , .
The third plus (and also with a spoon of "tar") is a network of franchisees and training centers, both for users and for beginner programmers and administrators. Good idea, but very mediocre quality of its implementation. Nevertheless, the prevalence and aggressive marketing is one of the reasons for the widespread popularity of 1C in our country (and this is also the cause of negative, envy and hatred).A spoon of tar
Having painted in all the colors of 1C, it would be unfair not to say about its shortcomings, and there they are:Unstable releases - both in the platform and in the configurations, there is a huge amount of errors and glitches. And it is in official releases. Before releasing the official version, a version for review is released. There is also a feedback for sending error descriptions to be accepted for correction. However, then, whether the versions for familiarization are not very popular, then the 1C company itself does not have time to process all the letters by the deadline, but it is a fact. Each time updating the platform or configuration, you can stumble upon the most unexpected "surprises". The company 1C has repeatedly appealed to more thoroughly test their development.Franchisee (hereinafter - Franchi). Ideally, as planned, it should have been a company with qualified specialists who knew the basic principles of how configurations and platforms work. These same companies would have to sell the platform, configuration and support, slightly “finish” universal configurations to the client's requirements (and sometimes adjust these requirements), trying to minimally modify the standard configuration. So as not to greatly complicate future updates. But in reality the opposite is true.When selling new licenses to a customer, francs receive 50% of their value (minus the income tax 13% of that 50%). At the same time, you yourself do not need to produce anything; you just need to transfer the keys from 1C to the buyer.When rendering services, francs do not pay anything to 1C (except for membership fees), but they need to pay the employee’s salary. You also have to spend money on taxes to the state - the Pension Fund of Russia and income tax.It turns out that both 1C and French are profitable to sell licenses and it is not profitable to carry out further support. At the same time, in order for the client to buy the program, it is necessary to adjust it initially to its requirements. And the work must be paid. And here, in order to save, students, students, non-specialists are attracted, who can pay a little, and sometimes - and not pay at all, they can not even be sent to the staff (they will work informally, since there is a reason to pay). The result is a huge number of sales with very low quality. Improvements tend to affect important mechanisms and complicate future updates. But at the sale stage, neither 1C nor the franchisee is interested.I note that this is not so much the fault of franchise businessmen, as 1C firms. Focusing on sales, she didn’t take care of the support at all (I’m not talking about schools now, but rather that providing support should be beneficial to both the franchisee company and 1C).Technical supportIn the understanding of 1C, technical support is the provision of access to the “update” section for the platform and configurations, as well as information sections containing a description of some of the mechanisms and features of 1C operation. In addition, a subscription disc is provided at subscription. There is also a forum (very scarce in comparison with folk). It is also possible to send an email to 1C - but not even hoping that it will be answered (or the robot responds, “The letter is transferred to the development department.” In terms of development, Yandex.Search and help embedded in the configurator provide much greater support.Epilogue
In this section, the author tells about himself.1 2008 , , (Delphi 5, Delphi 7). 1 7.7 . , , Delphi, . — . , , . — .
, 7.7 , — . . , , .. , 8.1 (, 8.2 ), , , , .
, , . , , .
In general, I am quite pleased with the work in the 1C Enterprise 8 platform. It is suitable for most accounting tasks and tasks using a database.