Forumite Members › General Topics › Tech › Makers & Builders › Programming/Code tips › Learning to program
Tagged: Android, app, program, programming
- This topic has 133 replies, 6 voices, and was last updated 7 years, 3 months ago by
Wheels-Of-Fire.
-
AuthorPosts
-
October 29, 2018 at 11:36 pm #27702
One thing I like about Visual Studio as a development tool is that it does on the fly compilation in the background as you type. This capability was originally developed for Visual Basic but it has now been extended to C++ and Java. Visual Studio will highlight errors in your syntax AND your logic with a squiggly line as you type. Even better than an interpreted language in many ways.
You still have to build your project before you can run it though.
October 30, 2018 at 9:07 am #27716The M$ development platform was complete rubbish until they poached Anders Hejlsberg from Borland’s Delphi/C++. At the time Object Pascal Delphi was the absolutely best hackers programming language and introduced the concept of RAD (rapid application development) allowing widgets to be dragged/dropped and at the same time built a code template procedure for each widget. In fact Delphi is reportedly still the language of choice amongst many Russian hackers.
M$ appropriated all that technology for itself and incorporated it in the first releases of Visual Studio.
Delphi is still around, but unfortunately outrageously expensive. If you want to just use something very similar for a quick hack take a look at Lazarus the cross-platform FOSS equivalent. I personally prefer object Pascal to C++ any day of the week!
October 30, 2018 at 11:11 am #27717I can’t personally comment on Pascal because of my very limited knowlage of it but Lazarus looks like a top notch IDE. I would not set out to learn Pascal from scratch now though. Existing Pascal programmers can reportedly earn good money maintaining code that was originally written to run on 1970s main frames but it is not a language of the future.
October 30, 2018 at 4:21 pm #27718Pascal was actually written as a teaching language. It was also one that was stable and well structured, producing light-weight compiled code. It was amongst the first languages to encompass Object Programming. The compiled code was also well defined with few surprises. This latter is of vital importance as quirky behaviour by the compiler is very hard to either detect or correct, and one of the main reasons that fuzing a computer kernel turns up bugs. However, there is probably little reason to learn Pascal unless you want to emulate a Russian/Ukrainian hacker.
In fact afaik only ADA and the OTOH, CompCert for C are certified for use in the Aerospace industry and other critical duty software programs. I do not know of any C++ compilers that are similarly certified and my guess is that its quirky run-time behaviour and overloading probably precludes its use! (Its all very well having maintainable code, but useless if it compiles into a pile of flakey pastry.)
October 30, 2018 at 7:31 pm #27722I am not a great fan of C++ myself. In fact the more I learn about it the more overly complex it appears. The main push is towards encapsulating everything into objects that can be seen as stand alone building blocks.
The thing is though I am increasingly reading texts that assume I have some knowlage of C++ methods so I thought I should give it a go. About 95% of Windows is written in C with 3% in C++ and 2% in assembly. Microsoft has stated that it will be increasing the use of C++ in the future though. Stand by for some bugs ?
October 30, 2018 at 8:30 pm #27725Just one caution, I’m not sure which Python the book uses.
The free first edition uses 2.x, but that’s obviously not the current book. It says it uses it because it’s what’s going to be in your Linux distro though, and the Ubuntu variants I’ve used still use 2.x. The only downside is, the book is geared towards using a Pi, which I don’t have. I’m downloading a VirtualBox VM and the Raspbian ISO file now though to see if that’s any good.
October 30, 2018 at 8:42 pm #27726As usual it is a trade-off. Provided that M$ somehow produces a C++ compiler that churns out certifiable code then there are great benefits in moving to an object oriented language like C++. e.g. better stability, fewer bugs, and a reduced attack surface.
Although I like C, it is one of those languages with big health warnings. Code has to be rigorously tested to ensure that none strays outside defined behaviour. As a simple and well documented example if a signed integer number overflows then the behaviour in the compiler is undefined. It MIGHT wrap around or even change sign. wiki link It will however, and most dangerously, run with no error messages!
October 30, 2018 at 8:53 pm #27728Tippon, unless the code uses the GPIO pins then it will run without issue on a PC (best under Linux as M$ Python has a few quirks). The latest book uses 2.7 – which is a very usable version.
The Raspberry Pi runs under fairly standard Debian. I routinely develop within Mint Linux (because I can use my big monitor) and just copy the *.py file and any dependencies to the Pi. I see no reason why the converse (Pi code on a PC) will not work without issue as I doubt the book uses the Pi’s *GPIO (introduces too many additional complexities).
*GPIO = General Purpose Input/Output which uses interrupts on the Broadcom chip, and is used by wiring up things to the GPIO pins.
October 30, 2018 at 9:18 pm #27731Most of it does seem to be normal programming. There are some GPIO examples, but they look like stand alone examples.
I didn’t think about using a Linux VM for some reason. I may transfer my Ubuntu Studio VM to this machine and use that for programming too. I realised this week that I haven’t actually played a game properly for a couple of years, so that’s one less reason to stick with Windows. Using the VM will help me get used to a distro before I switch.
October 31, 2018 at 11:50 am #27756Steam is in the process of introducing a compatibility fix that they claim allows over 1000 games to run under Linux. I think you should probably preface games with ‘old’ as the Wine fix this uses will not fully cover DX11 or DX12 games. Even VMware is unable to handle DX11 which is really annoying as a lot of graphics software now uses DX11/12.
October 31, 2018 at 1:26 pm #27758Reading you link about overflows turned up another unexpected thing about Atari BASIC Ed. If I do a calculation on a variable and the result won’t fit in 8 bytes of signed floating point then I get a strange number with an E in it as the result. It turns out that this is scientific notation and in this case it is 10 to the power of n and the E stands for exponent. I have been aware of scientific notation since my collage days but I never made the connection before.p
October 31, 2018 at 2:26 pm #27759If you think Atari basic formats are odd, you should have been born in the days of COBOL 60.
Despite computers having very limited capability to handle large values and being essentially integer only they soon took over the business and financial sectors. However, commercial and banking transactions had to be capable of handling tens of millions of pounds (shillings) and pence without any rounding errors.
Programmers ingenuity was stretched to the limits, and many non-standard ways of manipulating data were used (including self-modifying code!). Despite COBOL now being most definitely obsolete a survey showed that 43% of banking systems are still built on COBOL, and programmers are still very much in demand. In fact one very venerable ex-colleague in his late 80s still makes a handsome amount of money as a part-time consultant/programmer.
October 31, 2018 at 3:58 pm #27763You can break any sort of programming rules in Atari Basic. Self modifying is a good one. Just use the ENTER command in your program and it will pull in new code from a file, tokenise it and go on as before.
October 31, 2018 at 4:07 pm #27764<p style=”text-align: left;”>The point is that memory and line numbers and variables will stay the same with enter but not with LOAD.</p>
November 1, 2018 at 7:51 am #27795Most programming languages of that period allowed the programmer to use so-called in-line code. Some such as Pascal allowed Assembler and calls to imported files, while venerable ones like the Commodore Pet used Peek and Poke etc. They built in this facility to allow programs to directly access the underlying hardware or speed up critical sections of code (early primitive Basics were not compiled but interpreted scripts just like today’s Python). The modern equivalent can now be seen with programming languages such as Vulkan that allow direct access to the inner workings of a GPU.
November 1, 2018 at 8:59 am #27799<p style=”text-align: left;”>Oh yucky Commodore basic. Made in 1977 from an M$ lisence. It was rubbish on the Pet and then they put it on the C64.</p>
November 1, 2018 at 9:06 am #27800What is with the HTML mark up ?
November 1, 2018 at 11:10 am #27813What is with the HTML mark up ?
Are you drafting your replies, or using an email link. No problem here afaik.
November 2, 2018 at 2:54 pm #27870No i’m not writing drafts. I am writing on my phone though. Don’t matter much cos my opinion of Commodore Basic is still clear ?. Every Commodore basic listing is full of pokes because it didn’t even try to support the hardware. They had another go on the C128 with V2.0 but it was still rubbish. Dont matter now but it was dire.
November 2, 2018 at 3:12 pm #27872Maybe I should start a new Retro programming thread like MM Retro Mart ?
-
AuthorPosts
- You must be logged in to reply to this topic.
