Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #91960

Re: Improving productivity

From Joe Pfeiffer <pfeiffer@cs.nmsu.edu>
Newsgroups comp.lang.c
Subject Re: Improving productivity
Date 2016-08-08 09:24 -0600
Organization A noiseless patient Spider
Message-ID <1bfuqfp9m0.fsf@pfeifferfamily.net> (permalink)
References <affac3f5-3804-41e9-9678-9f02ca51b47a@googlegroups.com> <94918357-365a-4c67-9397-5bc2228d9bb6@googlegroups.com>

Show all headers | View raw


luser droog <luser.droog@gmail.com> writes:

> On Sunday, August 7, 2016 at 8:47:14 AM UTC-5, janus wrote:
>> Hello All,
>> 
>> I have noticed that my productivity is pretty low when programming
>> with C language compared to say JavaScript. I am suspecting that I
>> am not using the right tools and systems to properly and quickly
>> zero in on errors and bugs.  Please, list the right tools/systems
>> one could use to troubleshoot and zero in on bugs. And also test
>> suites.
>> 
>
> I've grown fond of the 'classic' tools and highly 
> recommend them: bash (or whatever your command shell is),
> make (to automate compilation), and your text editor.
> The textbook for this is Kernighan and Pike, /The Unix 
> Programming Environment/. Also get a used copy of the
> Unix manual, volume 1, which is all little essays and
> papers about how C and Unix were initially ported to
> several environments and how the language evolved to 
> cope with these and lots of other cool stuff. These 2
> books should be on your shelf right between K&R and 
> van der Linden.
>
> The text editor is the tool that will repay increased 
> familiarity. In the "unix" milieu, you can use the same
> editor for almost any language and the whole operating
> system becomes your "IDE".
>
> If you have a makefile written, then in vi you just type
>
>   :!make<RET>
>
> to build your project. That's light years ahead of opening
> (or suspending to) a shell and typing `gcc ...`.
>
> In emacs it's even shorter: 
>
>   ^x^m          (where ^ indicates the ctrl- key combo)
>
> For unit testing, there are many frameworks available. I've
> used `check` successfully and it's pretty straightforward
> and works well and combines easily with autotools and stuff.
>
> But I've also become very fond of this "minimal" test suite
> which I've augmented with more magic:
> http://stackoverflow.com/questions/32163935/compose-a-combined-test-suite-program-from-a-collection-of-unit-tests
>
> In summary, all of the text-manipulation tools of the command-shell
> are available to the makefile to manipulate the source text for the
> benefit of the compiler. sed, grep, perl, m4 (!). If something is
> difficult to 'write' in C directly, it may be easy to generate from
> a scripting language. <!-- any language you're more familiar with, even js
>
> Or use an IDE.

I'll echo everything you have to say about emacs+make, and add gdb to
the mix for debugging (especially run from inside emacs).  I imagine
something similar is also possible with vi, but I'm an emacsophile.
-- 
"Erwin, have you seen the cat?" -- Mrs. Shrödinger

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Improving productivity janus <emekamicro@gmail.com> - 2016-08-07 06:46 -0700
  Re: Improving productivity Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-08-07 18:52 -0700
  Re: Improving productivity Real Troll <real.troll@trolls.com> - 2016-08-07 22:59 -0400
  Re: Improving productivity fir <profesor.fir@gmail.com> - 2016-08-08 00:49 -0700
    Re: Improving productivity fir <profesor.fir@gmail.com> - 2016-08-08 01:32 -0700
  Re: Improving productivity luser droog <luser.droog@gmail.com> - 2016-08-08 08:04 -0700
    Re: Improving productivity Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2016-08-08 09:24 -0600
    Re: Improving productivity Keith Thompson <kst-u@mib.org> - 2016-08-08 09:22 -0700
      Re: Improving productivity Nick Bowler <nbowler@draconx.ca> - 2016-08-08 18:47 +0000
      Re: Improving productivity luser droog <luser.droog@gmail.com> - 2016-08-08 15:23 -0700
        Re: Improving productivity Udyant Wig <udyant.wig@gmail.com> - 2016-08-09 11:27 +0530
    Re: Improving productivity Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-08-08 19:59 +0100
      Re: Improving productivity luser droog <luser.droog@gmail.com> - 2016-08-08 20:16 -0700
  Re: Improving productivity Nobody <nobody@nowhere.invalid> - 2016-08-10 03:19 +0100
  Re: Improving productivity jgh@mdfs.net - 2016-08-12 13:59 -0700

csiph-web