A
A
azaznioo2015-04-07 20:24:54
Software design
azaznioo, 2015-04-07 20:24:54

How to learn to write code that is scalable and understandable to another person in C-like languages?

Hello, I would like to hear advice on this, probably, the eternal question from experienced comrades. Most likely, I will be asked to go to work under the guidance of a more experienced person, but now I am studying at a university and so far there is simply no way, but I want to learn how to write well right now. I periodically write software within 4,000-10,000 lines of code and went through a bunch of crutches in architecture. When you need to add new functionality, you have to suffer. In addition, it is more and more difficult to work with the old code.

Answer the question

In order to leave comments, you need to log in

8 answer(s)
A
Armenian Radio, 2015-04-07
@gbg

You can look through various good books like Golub, Alger, Alexandrescu and so on.
And you can listen to the spacing from the lead a couple of times in the spirit of WHO THROW THE FEET ON THE REMOTE CONTROL with a malloc snatched off the memory for the object, and then cleared it with a divider ?! and stop doing it.
Practicing under the wise guidance of a lawyer from the code is the sweetest thing to do.

M
MIsternik, 2015-04-07
@MIsternik

"Perfect code. A practical guide to pars... well written about how to write understandable code, the main idea of ​​the book is that any code should be easy to read. If you haven't read it, then this is what you're looking for.
Well, something about programming patterns. I have watched these videos

V
vsvladimir, 2015-04-07
@vsvladimir

Please write more and comment more. The same thing can be written in ten different ways, try to use the most popular ways. Make it easier to refactor the code later,

L
Lexans, 2015-04-07
@Lexans

1. Before writing code, you need to develop an application architecture.
Think over the use cases and arrange them in the form of a UML use
case diagram. And most importantly, make an uml program class diagram. In which to specify class components and relationships. 2. Patterns can be used
to design uml class diagrams
citforum.ru/SE/project/pattern

V
Vladimir Martyanov, 2015-04-07
@vilgeforce

Separate into separate procedures code that is repeated or can be applied later. Also - meaningful pieces of the type of initialization.

M
Mintormo, 2015-04-07
@Mintormo

Read books describing code organization techniques. Like like this .

D
Dmitry Makarov, 2015-04-08
@DmitryITWorksMakarov

I recommend this book to get you started. It describes the dependency injection pattern and tools for it. In general, this allows you to write loosely coupled programs, avoid spaghetti code.
Still it is possible to advise to write tests for the code. Sooner or later, the code style will start to change. Again, the code will become more modular, loosely coupled.
These two recommendations are essentially two sides of the same coin.
Well, "Perfect code ...." re-read every six months =).

S
Sergey Chistyakov, 2015-04-09
@piro1107

I was helped by McConnell's book "Perfect Code", this site on refactoring and the book of the 4x gang - "Object Oriented Design Techniques" by Gamma, Helm, Johnson and Vlissides.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question