⬆️ ⬇️

Developer Tools or Why aren't you using X? Part 1





I saw many examples where they used dropbox for joint development, inserted print after each line to debug the application, wrote their bikes for automatic tests (I confess, I did it all myself).



It is not right!

')

Now at the disposal of the programmer, he writes in Python, C ++, Haskell or Ruby, there are a huge number of different tools that he can use in his daily development.



Compilers, interpreters, debuggers, profilers, documentation generators, version control systems, text editors, build automation, static analyzers, emulators, and virtual machines — all at our disposal!



However, it turns out that many developers simply do not know what powerful tools they can use.



If you are interested in how to improve your productivity, start writing programs better, and just read something interesting - welcome under the cat!



Brief introduction



Do you use a text editor when programming? Ok, weak question. Which editor are you using? Probably you like it, it has X, it is also very nicely implemented by Y and unlike many other editors, it doesn’t have this stupid Z!



OK, do you use a profiler to improve the performance of your application?

How not?



Do you use a version control system to monitor changes, have a backup copy of the code somewhere on BitBucket or share it on GitHub?

No again?



Do you use all the features of the standard library (or even third-party) of your language?

Are you still writing bikes?



It's time to finish this!



In this article (even a series of articles) I will talk about those tools for programming and development that I learned about in the last 7 years and most importantly - I continue to learn!



The cycle is divided into several parts - in the first parts I will write about those tools that EVERYONE needs to know, I mean EVERYONE at EVERY developer. This is how useful things are that not knowing about them is a crime.



In the final part, I will describe a few tools that are either not worth attention separately, or are highly specialized (yes, for these bald scientists), or indirectly related to programming and development.



Version Control System





The version control system (git, svn, hg, bazaar and their friends) is one of the most important tools that, unfortunately, very many people do not know about. Or know, but do not use (fear?).



Disadvantages of ignorance:


- You keep a bunch of old versions in different folders

- You are afraid to “spoil” the source code, therefore you are afraid to experiment

- You post the source code to the general access in the archive

- In collaborative development, you manually merge changes made by different developers.

- You back up the source code



Why do you need a version control system:


- You can keep track of different versions of your project

- You will have the opportunity to experiment and not be afraid for the source code

- You will have a clear knowledge of all the changes from version X to version Y

- You can easily conduct joint development (2, 3, 10, 1000 people)

- Having started a repository on any service, like github, bitbcket or sourceforge, you will have a free backup on a reliable external server



Description:


I myself use git, less often bazaar and I actually advise you to start with git. Well, if you like to delve into the details and you like to find everything 100% suitable, here's a little introduction.



First, version control systems are divided into centralized and distributed. In general, both have advantages and there are many differences between them, but the main difference is that it is more convenient to work with distributed users without constant connection to the Internet.



In short, here is a small description of the most popular systems, select something and please start using it already!



Git (select it!) Is one of the most popular systems, convenient, fast, distributed, has good support and very good hosting for repositories - GitHub, Bitbucket and a thousand others. Used by a bunch of open source projects.



Subversion (svn, but not his!) - one of the best centralized systems, is also very popular, if you want to suffer for a long time in death agony - try. Of course, I joke, maybe there are such perverts who like svn.



Darcs - if you are a Haskell fan - you can try the product in your favorite language, otherwise nothing remarkable.



Mercurial is often positioned as an alternative to Git and in fact in many ways it’s better; if you’ve used Git before, try, it won’t get any worse.



Bazaar is a very interesting project, still damp, for a start I will not recommend it, but if you already have the experience, Bazaar may become your favorite version control system.



Okay, there are other version control systems, but I will not go deep, there is still Google, and in general there are a lot of articles on this subject, the main thing is to start using this thing.



Let's go further!



Profiler





This is the must use tool number 2, which every programmer should know about. In general, in fact, it would be better to call it "Tools for analyzing performance."



What is the point? You have written the application and you do not like the speed of its work. Okay, let's sort everything out and optimize the application so that it runs faster.



What are the problems? And there are a lot of them here!



1. We have limited time and we would like to get an acceptable level of optimization in a reasonable time.

2. If you do not participate in the development of an optimizing compiler and if you have a brain smaller than an average watermelon, you know the features of the processor, such as predictions of transitions, and this is one of the ways to improve performance at times.



What solution?



Performance Tools! First of all, it is a profiler, in the second - more advanced tools.



Disadvantages of ignorance:


- Optimization takes a lot of time

- You do not know where it is necessary to carry out optimization

- You can not accurately assess how successful the change was



Why do you need profiling?


- You will be faster and better to optimize applications

- You can see the weak points of your application and concentrate on them.

- You can find out the exact effectiveness of optimization and decide whether it is needed or not.



Description:


In general, profilers are just a bunch and usually they are language-dependent, so if you write in Python, you can hardly use gperf (however, I can be wrong).



Okay. Here is a short list of profilers for different languages:



Java - there are embedded tools in NetBeans, libraries perf4j, jetm, JavaMelody, separate tools - YourKit, JProfiler.

With # - built-in tools in Visual Studio, there is a mono out of the box.

PHP - xDebug, XHProf.

C / C ++ - embedded tools in Visual Studio, Gperf, a whole range of solutions from Intel.

Python - hotspot, python profile, dowser.

JavaScript - YUI profiler, you can also use some tools in the browser (in Chrome something was exactly like that).

Other languages ​​- there are profilers for other languages ​​too, many are built into the compilers, for example, the GHC (compiler for Haskell) has a built-in profiler.



Advanced Profiling Tools


The main thing - the tools are divided into those that measure the use of CPU time and those that measure memory usage.



Additionally, I can report that for C / C ++ and Fortran there is such a wonderful thing as Intel Parallel Studio which allows you to analyze a huge number of parameters, for example, to find out for each branch design the number of incorrectly predicted transitions (if you improve this indicator, sometimes with the help of simple code frauds You can get a performance increase of 2-3 times or more).



Okay, I hope you understand the point - when it comes to optimization, think about profiling, otherwise don't even start.



Let's go further!



REPL





Perhaps one of the most convenient and useful things from the list. I have about 10 REPL applications for different languages ​​(most of them came with compilers / interpreters) and I use them VERY often. Especially ghci, Haskell for serious development, I still know too badly, but if I suddenly need to quickly figure out something, I use ghci as a calculator for the Gods. I'm serious.



Disadvantages of ignorance:


- To test any language design or its capabilities, you create a complete test application.

- To calculate the value of any complex expression, you suffer for a long time with a calculator, drive an expression into Google or (usually, if the calculations are rather complicated), you also create a micro-application.



Why do you need a REPL?


- You will have a testing ground, which is very well suited for learning a language, a better understanding of some of its capabilities, and just for toys.

- You will have an incredibly powerful calculator that can work with strings, dates, rational numbers, long arithmetic, and anything!



Description:


So, REPL is an application that organizes a read-eval-print cycle for a language (it would be interesting to look at the REPL for several languages ​​at once).



What does this cycle do?



The loop reads a line of code, executes it, and outputs the result.



An example is the calculation of the sum of the first 100 fibonacci numbers (for Haskell and ghci):

$ ghci Prelude> let fibs@(_:t) = 1: 1: zipWith (+) fibs t Prelude> sum $ take 100 fibs 927372692193078999175 




An example is the number of digits in 10,000! (Python):

 $ python >>> import math >>> len(str(math.factorial(10000))) 35660 




Well, I hope you understand that REPL is a very cool thing (and even more I hope that you have installed Haskell Platform).



So, here is a list of languages ​​and a REPL for them:



Java - Java RELP

C # - CsharpREPL

C ++ - Cling

C - Crepl

With some other languages ​​(Python, Ruby, CoffeeScript, Haskell, Scala), the REPL comes out of the box, along with the compiler (or interpreter).



Okay, next!



Conclusion or Why so little?





In general, the topic is bottomless and I would like to write a lot more. And I will write. However, I set myself the goal of writing an article at 8 o'clock (and the time is running out), and the article itself is 4 pages (and the place is also ending), so the remaining tools (and I haven’t described one-tenth!) Will be disassembled other parts of the cycle.



The main thing that I wanted for you to bring - now many programmers are working to improve the lives of other programmers. And it's a sin not to use their work in this area.



Write the code better and faster, let it not cause you more inconvenience, use all the tools that were created specifically for this. I hope all the tools were created to be used.



And yes, I hope that you liked the article and you learned something useful from it.



Wait for the next article in the series and good luck!

Source: https://habr.com/ru/post/215513/



All Articles