#Where to start?

5 messages · Page 1 of 1 (latest)

misty crow
#

Hello, I am sorta new to coding and have only made a few small protypes, I am sorta a apprentice someone right now and they gave me a task to complete; create a very simple app just typescript with a gui tool like bootstrap, and VSC as IDE, then once completed I must rewrite the app in c too. The issue I am having is just finding where to start, most tutorials aren't really what I am looking for and I just don't know where to start, any help would be truly appreciated!

calm bridge
#

What app do you want to create?

ivory badger
# misty crow Hello, I am sorta new to coding and have only made a few small protypes, I am so...

if your goal is to mae something in JS and then port it in C, I wouldn't target something that relies too much on the GUI part of the job, and rather focus on computing things

you could for example, implement a BoxPlot class, that takes a long stream of numbers (in JS, an array or why not a File that has an expected format, like a file made of numbers in standard format, separated by a line break; that will be easy to port to C as either an array or a fle stream), and computes basic statistics like

  • average
  • standard deviation
  • percentiles 0.25, 0.5, 0.75 for example
  • mark which are the outliers
    and then that BoxPlot class would provide sufficiently many utilities for being drawn on screen (see below)

in JS you can have the class writing itself on a canvas for example, or maybe try to have svg elements positionned correctly to gain some user interactivity (like hover effects to pop info bubbles). in C I guess you'd do the same, in the limit of the reasonable, for a gui lib of your choice; or just do it ascii art in console or idk

in terms of mathematical background (for computing the statistics), this should be fairly straightforward (you could maybe even reimplement a sorting algorithm, if you feel funky, but both C and JS have it in their std lib), unless you want to implement in-place solutions (for the percentiles there are interesting approximation algorithms https://www.cs.wustl.edu/~jain/papers/ftp/psqr.pdf ; for median and std variation there is a well-known Welford algorithm). computing the dimensions of the box plot should be relatively fine too. reading a file and parsing it I guess would be fine, unless you want to go psychotic and verify input errors; but if you claim the file is trusted, it should be relatively easy in both languages. I guess the most annoying part will be to actually draw stuffs and make it nice

misty crow
misty crow