From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!reality.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: feedback asked on dab-decoder software in Ada Date: Thu, 15 Sep 2016 11:00:08 +0200 Organization: JSA Research & Innovation Message-ID: <87oa3ph71j.fsf@adaheads.sparre-andersen.dk> References: <52cfa89e-7e4f-48f6-93b4-d559ea001d82@googlegroups.com> NNTP-Posting-Host: 109.57.244.137.mobile.3.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: franka.jacob-sparre.dk 1473929994 848 109.57.244.137 (15 Sep 2016 08:59:54 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 15 Sep 2016 08:59:54 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:v60YmNvoMHM/ET2ICSTWFTyVAMo= Xref: news.eternal-september.org comp.lang.ada:31790 Date: 2016-09-15T11:00:08+02:00 List-Id: Jan van Katwijk wrote: > This summer I wanted to learn Ada (again, after a period of well over > 20 years) and I made a reimplementation of the DAB software in Ada. Sounds like an ambitious project. > I would like to get some feedback on the use of the Ada language. Some comments and questions: + It would make it easier to get contributions from other Ada developers, if you switched source style to something closer to what is suggested by the Ada Quality and Style Guide [1]. + Why do you put the package specifications in a separate directory? + You might benefit from running your compiler with more warnings enabled. + A package body doesn't have to "with" itself. + There are no guarantees that "Integer" in Ada is the same as "int" in C. If you need a C "int", you should use "Interfaces.C.int". + Are you sure you need as many access types as you declare? (It looks - understandably - a bit like you are writing C in Ada.) + It looks like you aren't getting as much out of the type system as you could. (A length should probably not be able to contain negative values. - Just to take a single example.) > Any feedback and suggestions for improvement (it definitely runs > slower than the C++ version) is welcome I would suggest that you postpone the performance improvements a bit, and focus on getting more out of Ada. Greetings, Jacob [1] http://www.adaic.org/resources/add_content/docs/95style/html/cover.html -- "For there are only two reasons why war is made against a republic: The one, to become lord over her: the other, the fear of being occupied by her." -- Nicolo Machiavelli