C C programming best IDE for FreeBSD -- can't find one

This is about answering some questions of the best IDE ever for FreeBSD. I did install some before I came to write this post. At least I reach a personal satisfaction …. Hope will answer some searches on C programming and compilers. Windows will not do that for you. But what do I know, there should be an IDE that writes code by himself… J

Suggested reading and influence:
https://forums.freebsd.org/threads/48356/
https://forums.freebsd.org/threads/7018/
https://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/tools-compiling.html

Nevertheless, deeping into what?
http://www.slideshare.net/olvemaudal/deep-c/33-What_will_happen_if_you

Concluding:
Be a sport and keep going -- you will be the best C programmer ever!

Suggestions and improvements to the enclosed/attached IDE are welcome – don’t miss the fun!

Best IDE (IDE-20160405.zip)
 

Attachments

The best one is the one you like the best which is the same one available everywhere else, including FreeBSD, if you want one at all, but these reddit-like threads drag on forever and contain nothing but opinions and in-fighting, so it's best to leave them alone.
 
Too much work formatting (tabs would not paste all the time) -- cut and paste is more productive…

COMPILER (aka IDE)

Code:
#!/bin/sh
# syntax for compiling with cc
# one file: cc foobar.c // ful compilation
# more files: cc foo.c bar.c
# output: a.out // as executable
# run: cc -o foo foo.c // output foo as executable
# check syntax: cc -c foo.c
# RUN this file with: sh /root/run_1c.sh lsn_01a

CCR_cmd="$1"
CCR_pgm="${0##*/}"
CCR_pth="/root"
CCR_fle="${CCR_pth}/${CCR_cmd}"

clear; echo ""; echo "";
if [ ! -z "$CCR_cmd" ]; then
  if [ ! -x "${CCR_fle}.c" ]; then
      chmod +x ${CCR_fle}.c
  fi

  # compile with cc
  echo "COMPILING: ${CCR_fle}.c"
  cc -o ${CCR_fle} ${CCR_fle}.c

  echo ""; echo "";

  # execute
  echo "EXECUTING: "${CCR_fle}; echo "";
  ${CCR_fle}

  sleep 2; echo ""; echo "";

  rm ${CCR_fle}
else
  echo "Don't know what to compile!"
  echo "Invoke: ./${CCR_pgm} file-name (without .c)"
  echo "--to compile and see results"
  echo ""; echo "";
fi

TEST C Program: "(file.c)"
Code:
#include <stdio.h>

int main(void) {
  printf("Welcome to C programming!\n");

  int a = 57;
  printf("%d\n", a);

  return 0;
}
 
Let's bisect this a bit. First of all, an IDE is an "integrated development environment" ... no matter how minimal it might be, it has at least a code editor, and either an own build system or support for an existing one as a frontend. Typical other features: debugging, management of "projects", integration of source control systems, ...

That said, I often prefer just editors/vim and make. But that's a matter of taste.

What you have here is a simple build script. And I don't think it's really a good idea:
Code:
CCR_cmd="$1"
CCR_pgm="${0##*/}"
CCR_pth="/root"
CCR_fle="${CCR_pth}/${CCR_cmd}"
  • Don't abbreviate variable names. It took me a while to realize what you mean: command, program, path and file.
  • Looks like you use your compiler as root? BAD idea.
Code:
clear; echo ""; echo "";
if [ ! -z "$CCR_cmd" ]; then
  if [ ! -x "${CCR_fle}.c" ]; then
      chmod +x ${CCR_fle}.c
  fi
Uhm what? The source isn't executable, so don't set the executable flag on it!

Well, all in all ... I suggest you have a look at a buildsystem. Maybe just start with the classic make. If you try scripting your build, you will probably like the concept once you get a grip on it.

Just to give you an idea, your whole script would come down to this Makefile:
Code:
.c:
    $(CC) -o $@ $<
.. and just type make foobar if your source file is called foobar.c. It will only do something if foobar.c is actually newer than the compiled foobar.

Although I also think running the program directly from the build is a bad idea, you CAN do so by adding a line:
Code:
.c:
    $(CC) -o $@ $<
    ./$@
Note that it's important the lines with the commands start with a tab character (not 4 or 8 spaces).
 
Let's bisect this a bit. First of all, an IDE is an "integrated development environment" ... no matter how minimal it might be, it has at least a code editor, and either an own build system or support for an existing one as a frontend. Typical other features: debugging, management of "projects", integration of source control systems, ...

That said, I often prefer just editors/vim and make. But that's a matter of taste.

You know Vim has all of those features, right? Vim is an IDE, and has been one for many years. It's a pretty *crappy* IDE, but it's an IDE nonetheless. For some reason people seem to deny this...

You can interface with various build tools with :make (which works with more than just make), it has the quickfix window for debugging, it has code completion, it can work with the filesystem (netrw). For some other features you need plugins (like Syntastic for better/more direct interfacing with the build system, or Fugitive for git support), which is not that different from many other IDEs which put a lot of stuff in plugins (like Emacs)...
 
You know Vim has all of those features, right?
I use some of vim's development features -- and when writing GUI applications, I sometimes use something else like e.g. devel/qtcreator. Or, in my day job, MS VS ;)

I'd never call vim an IDE. It's a text editor and also a code editor with some development features, combine that with plugins and scripts and you can make an IDE out of it, but just because it meets the absolute minimum requirements for something to be called an IDE doesn't make it one -- it's created as a text editor.
 
And so it begins ...
Obviously not (good thing!), but I see what you mean -- discussing whether vim (or, as well, emacs) should be called an IDE or not is probably very pointless :)

What I'd really like to see here is some reaction from AHR Inc and I hope my criticism wasn't too harsh. After all, he had the right idea and I just tried to point him to the fact that problems like automating builds were solved before, in fact, many many times :)
 
Okay, kind participants of this thread.

Please don't be surprised if this thread, should it turn into a troll cave, will suddenly experience a cave-in (a.k.a. closing-derailed-thread), maybe trapping some unhappy individual inside with some time to dig themselfes out of the debries (also known as temporary ban).

I think we all know that the topic of IDEs can lead to extreme behaviour, which is not appreciated here. But since you all are grown up professionals, such a warning is entirely superfluous. Isn't it?
 
Dear Crivens, I can't see any "extreme behavior" here. As for me, IDEs have their merit as well as a workflow based on "simple" text editors and a decent build system. But what this thread SHOULD be about is the scripts of the original poster and some advice for him how to advance --- IFF he ever comes back ;)
 
That is a warning about things which might come.
There Will Be No vi ./. emacs Wars Here.
 
Lol, you really want to take on the mother of all flamewars? ;) Haha, never mind, point is clear, and so far, I don't see the danger. Yes, we are all professionals, focusing on the result, not the tools. Well, that's what I hope for :)
 
Windows will not do that for you
Compared to what ?
Back in the day Borland C++ 3.11 was one awesome IDE. Debugging there was very neat.
Visual Studio (well, I stopped following one release after .NET) was very good too. And not only for commercial use.
QT has some neat stuff too, though I can't comment as I never used it personally.

On Unix vi+gdb is very powerful. With some addons such as https://github.com/longld/peda or http://docs.binjit.su/index.html you can manage a lot more (true, focus there's on pwnables, but you can use it for other stuff too).
 
Wow, there are still developers around who remember the fun of Borland C++ 3.11!
How about Borland C++ 2.0? I started there, optimizing C/C++ code in Assembly and stll miss the clean and straightforward interface that ran on 286 with 1 MB RAM.

As for modern IDE I think Netbeans is Okay, especially because it supports everything that I ever need to touch - Java, C, C++, asm, PHP - and works on all platforms I develop for. Eclipse and QtCreator are way too counter-intuitive for my liking. You should have seen IBM's Data Studio where they customized the hell out of Eclipse - comprehending it is simply impossible. Netbeans at least follows some sort of QUA.
 
Wow, there are still developers around who remember the fun of Borland C++ 3.11!
I remember that other Borland product; Turbo Pascal (running on MS-DOS 3.3). That was somewhere in the early '80s when I was still a strapping young lad :D
 
Yes, those were the days... I found that using the right tool (as in the right IDE) could give you more information and more focus, not interrupting the work flow but assisting you in it. That made for some relaxed working and playing with the code, finding better solutions on the higher levels of the code than focusing on the few lines you can get into your head while staring into some little sceen. Debugger, Profiler, most of all "jump to error". These I would really miss shoult they be gone in an IDE. And some obvious features are still missing today which I took for granted 20 years ago: That the line number in the compiler message is leading me to the correct place in the source, no matter what I delete and insert above it (geany, I'm looking at you). We had that 20 years ago, but I still do not have it here. Who can tell me which IDE has this today?
 
The best one is the one you like the best which is the same one available everywhere else, including FreeBSD, if you want one at all, but these reddit-like threads drag on forever and contain nothing but opinions and in-fighting, so it's best to leave them alone.

Of course I agree with your first claim that "best" is subjective, but I enjoy when people share their opinions as long as those opinions are based on facts (I like feature x because it can do Y). I also don't mind when threads drag on. If I lose interest I just stop reading that particular thread. It's not like threads are a fixed resource that we have to conserve or you're obliged to read every thread.
 
Some ideas to help. Best IDE:s. Some background.

What I have seen, the professional developers use mostly Eclipse. It is very scalable starting from JavaScript and SmartTV applications to C and C++. This information is from Java world and from Java developers.

Personally I have used just a nano -editor. I have good reasons for this. Gnome -terminal I have been using has offered magnificent fonts and glyphs. The background can be set with transparency settings and the font colors. The key sequences can be configured to switch the windows and tabs as desired. I have a system administration background and I'm used to looking a terminal window, usually just a PuTTY terminal on a Windows desktop. First editor I have learned was the pine email program the University used. This nano editor is similar with similar key sequences. It is small and easy to install.

Small code is better. Like in the first slides of the first post, "now that's a darn cute little c program isn't it". Maby this has been encouraged in the programming courses. Smaller programs are easier to manage and usually more quality than the big ones. The IDE:s can hide the code not needed and so on. Using a little editor makes small code.

Emacs has been encouraged to be used as an IDE as far as I know. It can be extended with Lisp programming language. I have made Java programming with emacs with nice coloured text environment with the editors capability to compile the source file in the same window. Programming first with Lisp was time consuming and the results were rewarding.

Where I have heard and read about the IDE:s is from Unix -classes and programming courses. People were encouraged to use some IDE available from the computers here in Espoo/Finland. Mostly Emacs. In Windows I have used Borland IDE for C and C++. I have used Sybase for Java. These could program the user interface in less than ten minutes. The database applications were innovatide with the synchronization of the software. It was good to know about the replication of the databases in the background.

Short summary:
- If a user interface is needed, to design the buttons and canvases, some user interface tool is best (Borland or former Sybase for example).
- Code size and text based editors correlate (and the program quality)
- System administrators use a primitive environment
- Unices were most used in large installations in big organizations and the people used what was offered
- Professional programmers use scalable IDE:s like Eclipse

/escape
 
I have recently been using editors/codelite, it is nice enough and fast. But it also has the problem of not remembering the on-disc line numbers when fixing things. But maybe it is better suited to have it added.
 
Sorry folks but I was trying to get examples of how you do it. More or less a little tutorial.

Even more focus on the subject is how quick you can (a) check the syntax - syntax validator and (b) check the functionality of the code you wrote.

Aim at a more updated tutorial reflecting version 10 and above of freebsd. Imagination and creativity – yes!

No doubt a C language little program to serve as a tool when coding in C – Modifying "make" is a little invasive and should be alternatives.

This is the fun I meant (focus): Know how – yes. Favoritism? NO!, I will let the reader choose.

Furthermore, how can one simulate/run/debug whatever code he wrote and touch perfection as described here:

https://en.wikipedia.org/wiki/Software_testing

Whomever wants to go forward I suggest starting another post and focus on examples (working examples) I have no doubt the result is a good tool to use. And not necessary an IDE or a particular editor. And for the mechanical amusement I use ee J (just shut up, stop it – I am laughing my ass off as it is) The never ending story and the last thing one may want to do is ask for an IDE on the freebsd forums.

Peace: once we have a tread with examples, I promises you – you can come back to this one and throw stones at each other, politics, whatever argument may be – please spare me, my mistake.

I’ll go with two names here the example and particular useful post:
Unix (FreeBSD) is my IDE. Don't need anything else.


.c: $(CC) -o $@ $< ./$@
Very good example per: Zirias (involves make)
 
Back
Top