Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

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
19
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
18,391
Helped
4,104
Reputation
8,208
Reaction score
4,036
Trophy points
113
Activity points
121,081
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
262
Helped
61
Reputation
122
Reaction score
60
Trophy points
1,308
Location
Turkiye
Activity points
2,828
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_teprom

Super Moderator
Staff member
Joined
Nov 7, 2006
Messages
9,185
Helped
1,141
Reputation
2,301
Reaction score
1,116
Trophy points
1,403
Location
Brazil
Activity points
53,368
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
47,644
Helped
14,072
Reputation
28,401
Reaction score
12,739
Trophy points
1,393
Location
Bochum, Germany
Activity points
276,823
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
13,720
Helped
2,717
Reputation
5,430
Reaction score
2,631
Trophy points
1,393
Location
Minneapolis, Minnesota, USA
Activity points
102,384
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
14,443
Helped
4,744
Reputation
9,503
Reaction score
4,514
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
123,195
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,196
Helped
366
Reputation
732
Reaction score
363
Trophy points
83
Activity points
12,974
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
 

Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top