Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Why programmers use command line interface?

bearbles2

Newbie
Joined
Oct 10, 2020
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
24
Hello, I'm new to programming (started with C) and I searched this question on web and couldn't find any specific simple explanation (my english isn't the best).
I wonder why programmers use CLI (for which purposes)? Is it necessary to use CLI for being a good programmer? And why always LINUX? I never seen a programmer using windows cmd. I'm windows user so does it mean that i should change my os to linux to be a good programmer?

If i use linux command line does it mean that i do not need an IDE? Or both can be used together? I saw people using text editor rather than IDE and they use linux command line for compiling/debugging etc. Why they do that? What're the advantages?

Thank you everyone!
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
20,823
Helped
4,499
Reputation
9,010
Reaction score
4,565
Trophy points
1,393
Activity points
137,476
Hi,

What is command line controlled?
Surely no (good) programmer would write it´s C source code via command line.

But to upload a HEX file to a microcontroller (as example) a command line "programmer" could be useful. It simply can be automated. Singley key pres or via hotkey from the IDE.

Klaus
 

emresel

Full Member level 5
Joined
Feb 12, 2008
Messages
265
Helped
61
Reputation
122
Reaction score
61
Trophy points
1,308
Location
Turkiye
Activity points
2,842
Hi;
For C like languages, it is normal I think, because there is not much option to develop graphical user interface when C like languages are common in past.
On the other hand consider embedded programming. Many embedded platforms has no screen, generally you can communicate over uart, ssh etc. Then command line usage is the only option.
Consider remote connections, transferring graphical interface (GUI) over network is not reliable, especially in past when there is not enough upload/download rates. In that case, cli is most convenient way.
And of course for scripting (automating many commands in a singe file and call them sequentially, and just run single script, in windows dos shell/batch files, in linux bash shell)
Eventually, even you use graphical IDE, most probably it is running old cli type programs (such as make, gcc etc) in back ground.

If you plan to be -especially- embedded system developer, I suggest you that, don't hesitate to use cli, be familiar with linux. Start by installing a virtual linux PC, and taste it :)

I hope, it helps to clarify.
Good luck!
 

andre_luis

Super Moderator
Staff member
Joined
Nov 7, 2006
Messages
9,308
Helped
1,166
Reputation
2,351
Reaction score
1,152
Trophy points
1,403
Location
Brazil
Activity points
54,235
The Linux command line set is very extensive, and there are a lot of circumstances on which you can make a lot of tasks with no need of a compiled language. For Windows, the closest they did in the CLI scope is the Power Shell, which for some reason did not took the programmer's adherence.
 
Last edited:

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
49,160
Helped
14,393
Reputation
29,050
Reaction score
13,144
Trophy points
1,393
Location
Bochum, Germany
Activity points
283,322
Todays embedded programming mostly uses IDEs like Eclipse or VisualStudio for Code writing, compiling and debugging. Nevertheless some actions can be better performed on the command line., no matter if you use Windows or Linux.
 

BradtheRad

Super Moderator
Staff member
Joined
Apr 1, 2011
Messages
14,240
Helped
2,817
Reputation
5,642
Reaction score
2,757
Trophy points
1,393
Location
Minneapolis, Minnesota, USA
Activity points
106,225
Once in a while I type in DOS commands when running utility programs. Sometimes I need to look into a hard disk problem. I have utility CD's (such as the Emergency Boot CD, Ultimate Boot CD, PC Wizard, etc). Navigation frequently drops into DOS when a program is done.

Commands which I try not to forget:

HELP (name of program)

TYPE (to examine autoexec.bat or config.sys)

DIR (with switches /a /w) (to see every file and to check for presence of io.sys and msdos.sys)

c:

cd..
 

betwixt

Super Moderator
Staff member
Joined
Jul 4, 2009
Messages
15,216
Helped
4,958
Reputation
9,938
Reaction score
4,783
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
129,201
I use Linux exclusively but occasionally have to use Windows on other peoples machines. I would say that for most programming and debugging of other devices (MCU etc) I use an IDE but for basic operating system code I use CLI or more specifically script files.

For example, I have a utility written in a text editor and saved as a script that scans for all devices on my network (typically 20 to 25 devices) and reports their IP addresses, MAC numbers and the device name. It would take a fairly big program to do that as an exe file but my script only uses 514 bytes and some of that is comments!

Brian.
 

Aussie Susan

Advanced Member level 4
Joined
Jan 5, 2015
Messages
1,332
Helped
387
Reputation
774
Reaction score
396
Trophy points
83
Activity points
14,399
Don't forget that most GUIs that control other programs end up creating the CLI and passing that to the other program.
In the case of an IDE, the code editing may be done within the IDE but the compiler is not (normally) built in and so it needs to be activated by the command line. You just don't see that as the IDE also reads the error information and interprets that back into the source for you.
As others have said, compilers typically have a huge number of command line options and having the IDE handle most of those for you is a blessing. Also the IDEs that I've used normally have a way to add your own options that are passed to the compiler (or linker or whatever)along wth those that are generated by the IDE.
Susan
 

Mr.Big

Junior Member level 3
Joined
Apr 17, 2014
Messages
25
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,283
Activity points
1,408
In Linux, there are simply hardly any usable GUIs.
Therefore, a lot of Pascal, FreePascal or Lazarus Pascal is programmed under Linux.
I even think that more programming is done in Pascal under Linux than under Windows.
Under Windows MS Visual C and C++ exist.
The easiest and best alternative under Linux is Lazarus Pascal.
As I said, many Linux programs are written in Pascal, but hardly anyone knows that :)
Just google for it
 

betwixt

Super Moderator
Staff member
Joined
Jul 4, 2009
Messages
15,216
Helped
4,958
Reputation
9,938
Reaction score
4,783
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
129,201
I've never had a problem with GUI environments in Linux and at least for the past 10 years or so the majority of Linux programs have been written in Python or C/C++.

It is true what Susan said, much of the underlying work is done by CLI driven programs with the GUI just acting as a friendly face for them. The GUI creates suitable command lines and passes them to the CLI interface to get the work done. Command line programs are actually far more versatile and work like building bricks, each alone has limited use but put them together and you can build house, bridges, skyscrapers...

Brian.
 

MichalP

Junior Member level 1
Joined
Jul 16, 2018
Messages
17
Helped
1
Reputation
2
Reaction score
1
Trophy points
3
Location
Krakow
Activity points
78
Just easy tasks with output files and report filtering is much more easier on LINUX terminal. You can do everything and flexilbility is the best
 
Joined
Mar 21, 2021
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
108
6 months late, but I love this question.

Is it necessary to use CLI for being a good programmer?
Yes. One of those important skills in software is being able to debug. And when I say debugger I'm not talking about using an IDE debugger tool for your program, I'm talking about Friday afternoon at 4 PM and your distribution warehouse calls and asks you why it just received a request from your e-commerce platform to ship 500 orders of something called ActiveRecord to a place called localhost. You're gonna need the command line to dig into these things.

And why always LINUX?
There are a lot of reasons for this and they'll become clear as you advance in programming. The most significant to me are it's ubiquity in servers/embedded software, and being open source at its core. Linux is the operating system most servers that back web applications, embedded systems, and IoT devices run on. Many of the programs running on these machines are comprised of open source software, which is a core element of Linux. The license used by the Linux kernel (GPL) basically allows it to be used, modified, copied, other stuff, without needing to obtain permission or pay for a license. Remember that at the end of the day, Windows is a product. Linux is a project.

should I change my os to linux to be a good programmer?
Yes

If i use linux command line does it mean that i do not need an IDE? Or both can be used together?
Yes. You can almost always find the underlying commands needed to get your work done, but there are definitely situations where a specific IDE is helpful. Android/Android studio is a good example of this.

I saw people using text editor rather than IDE and they use linux command line for compiling/debugging etc. Why they do that? What're the advantages?
Similar to my answer to your first question, but with the addition that using the command line will force you to gain a deeper understanding of the entire system that you're trying to build. It exposes the underlying functions that are generally hidden my the features of an IDE, and the skills on the command line translate across lots of a much broader spectrum of software/computer skills. IDEs tend to be more specific, because like Windows, they are products. You will never open Vim and be greeted by a pop-up asking you to go 'Visit the Blog' or anything like that.
 

Mr.Big

Junior Member level 3
Joined
Apr 17, 2014
Messages
25
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,283
Activity points
1,408
should I change my os to linux to be a good programmer?
no, really not
 

LaTeX Commands Quick-Menu:

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top