What C editor to use for novice?

Go To Last Post
75 posts / 0 new

Pages

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There's more to C++ than OOP (classes). Very useful things, actually, like references, namespaces, constexpr variables, templates, etc.

 

So I like to program AVR in C++ because of these things, even if my programs are somewhat C-like in their structure. A good C++ programmer would probably not like that style.

But that's what you get when, like me, you learn C first then move to C++.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

An advantage for AVR is C++ is available and at zero price (Atmel and GCC late in the life of AVR Studio 4)

Embedded C is partially implemented for AVR (fixed point arithmetic); C and C++ can be mixed.

 

Electronic Design

Electronic Design

Is C the Best Embedded Programming Language?

C is still the dominant language for embedded programming—but these days, it has lots of company.

by William Wong

Feb 27, 2018

http://www.electronicdesign.com/embedded-revolution/c-best-embedded-programming-language

...

Microcontrollers used to come only with macro assemblers, but these days C (and possibly C++) is the minimum provided by chip vendors. 

...

Real-time systems with tight timing requirements may limit languages that can be used, but developers typically have more choices than just C (even for bare metal applications).

...

It is possible to use C++ as a better C, but that doesn’t utilize the former to its full advantage.

...

TR 18037: Embedded C

http://www.open-std.org/JTC1/SC22/WG14/www/projects#18037

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think, the major think is always the same.

A programming language is like a tool.

 

The question is:

"What do you wish to do with the tool".

 

If you need a drill for everyday working 8h/day you need a professional drill.

If you need a drill for 5x use/year than a hobby drill will fit your requirement.

etc...

 

If I wish to use a uC for DIY project's or some everyday stuff like in a foam cutter machine for regulating the heating, some speed controlling etc.

Whatever language would do the job.

If I wish to go to more complicated project where are precise timing is used, special features or whatever what is not usual a better choice is C/C++.

But if I wish to build a space car of the next generation or a private moon shuttle then I should use ASM for sure.

 

But here is a nice moment of the "IF"!

IF we will be superior over some one other, and/or wish to impress the somebody then we can go into chatting

"I'm better because I know C/C++/C#"

"Your C is to slow compared to my ASM"

etc...

Of course, nobody is taking in count today's speed of the CPU of our PC's.

Several GHz, MEga-Giga RAM's but there small crap of codes are slow because it was not wrote in C or ASM or whatever...

 

Conclusion:

Take in count for what you wish to use the programming language before you start to learn it.

It should be comfortable to manage the code in the editor.

The language should add you the opportunity to make your software finished in the shortest period of time. (time is money).

Of course, the language should also give you a stable software as a result of your request and effort.
 

 

 

 

Last Edited: Sat. Mar 10, 2018 - 05:09 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

pawi777 in #47 has some merit, but the amount of confusion generated is largely dependent on the way a course is set up.

 

For a university I unserstand learning both C and C++.

But for a modern coarse in programming it is much better to skip the whole C thing and exclusively use C++.

With carefull planning on the Course Leader's side a lot of the object oriented concepts come naturally to the students without confusion.

A piece of fruit is an object, so is a keyboard.

Most of the confusion is created by first learning C and then switching to C++ which has a completely different flow.

If you are interested in this I highly recommend "Stop teaching C" from Kate Gregory.

https://www.youtube.com/results?search_query=%22Stop+teaching+C%22+Kate+Gregory

 

This is a 1 hour long video about a presentation from her to other teachers on how to structure a coarse in C++. It's brilliant in design. She sure is a smart kookie, but it's also a pretty specialized video.

Paul van der Hoeven.
Bunch of old projects with AVR's:
http://www.hoevendesign.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

She's pretty good. I liked an introductory C++ course she co-host in M$: https://mva.microsoft.com/en-us/...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I learn now C and I have some questions about the code I have in my book.

Is here on this forum any place where I could ask for some help to better understand the 

code and the text from the book?

 

I searched around the forum but really didn't found a good place to ask about C...

 

Thank's.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

This forum is "compilers and general programming" so you wont find a better place on this board than right here to ask any questions about the use of C. We'll waive the fact that it might not be about AVR as we know your ultimate goal is to program AVRs in C.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Clawson, I will try post the question "compilers and general programming" forum, I have faith in you, moderator's, does you won't drop me out.

If yes, that's ok, I have to search for another board where I can ask for help about C programming.

 

Does somebody use the CodeLite editor?
I'm trying to execute my C code step-by-step, I added break point's but I don't know how to run the code step-by-step.

 

I moved from Visual Studio C to CodeLite because the saving problem what I have in my version of Visual Studio.

I should Update or whatever but I don't care right now about that.

Actually, there is a bug in VS/C editor, I can't save my project's...

 

Thank's.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Never heard of Codelight. I assume this..
.
https://codelite.org
.
Ironic that you chose this and none of the previous recommendations?
.
If I wasn't using Visual Studio I'd go for either Code::Blocks or Pelles C.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I also never heard of  Codelight. smiley

I don't know from where you got that.

 

That editor was installed before on my PC.

I realized later does I have problem with my version of VS but I won't wast my time with it.

 

Pelles C i don't like how it looks like but Code::Blocks I like, but I stumbled in some problem until I was trying it

and won't waste time also with it, but I would be happy if it would work of course. smiley

 

Thanks for suggestions.

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Apparently, CodeLite is not very well known. I had never heard of it also, but it is written in C++ and C and that's automatic extra points for me, so I'll check it out.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jodank wrote:
...  because the saving problem what I have in my version of Visual Studio.

I should Update or whatever but I don't care right now about that.

Maybe repair instead of update.

Microsoft Docs

Repair Visual Studio 2017

https://docs.microsoft.com/en-us/visualstudio/install/repair-visual-studio

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

El Tangas wrote:
it is written in C++ and C and that's automatic extra points for me

Why is the source language of a product of any consequence to a user??

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, I'm surely not going to generalize, but I have a feeling that C++ programs use less resources than java for example and my laptop is getting a bit old, so...

 

Memory use, both with no projects open:

 

edit: note that I prefer netbeans in terms of features. That's why I'm interested in something that is lightweight, but with the features I want.

Last Edited: Mon. Mar 12, 2018 - 10:20 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I confirm this observation about Java apps...

Actually, I personally don't like apps who take more resources than it should what is the case with Java.

I don't have to need a hyper-super PC just because something is wrote in Java and the same eat up my 

PC resources just because it need Java platform running.

 

I tried with repairing my VS, but without success.

On MS forums are written does my version which is 15.3.x should be updated, because 

people who are bored in MS VS programming team are make think worse with their 

updates than it was before.

That's nothing new on MS product.

 

I don't have nothing personal against people who like MS product.

I don't like it even if I use their VB .Net for programming.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For reasons of legacy support I actually mainly use Visual Studio 2010.  Quite happy with that.

 

(unfortunately the demise of Windows 7 and the fact that Windows 10 does not support VS2010 means that shortly I will have no choice but to migrate to a later version!)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

El Tangas wrote:
Well, I'm surely not going to generalize, ...
Well, I'll compare an apple to an orange :

NetBeans IDE 8.2 Release Notes

System Requirements

https://netbeans.org/community/releases/82/relnotes.html#system_requirements

(Intel Core i5, 4GB DRAM, 1.5GB disk space)

Requirements for VS Code

https://code.visualstudio.com/docs/supporting/requirements

(1.6GHZ CPU, 1GB DRAM, 200MB disk space)

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
(unfortunately the demise of Windows 7 and the fact that Windows 10 does not support VS2010 means that shortly I will have no choice but to migrate to a later version!)
Some will put their copy of Windows 7 into a VM and lock it down.

Surprisingly, Visual Studio 2010 Express has a gold rating in Wine (Windows emulator) though has some bugs and how-to :

https://appdb.winehq.org/objectManager.php?sClass=version&iId=22306

Wine 3 emulates Windows 7; might try your copy of VS2010 on it.

 


https://support.microsoft.com/en-us/help/4057281/windows-7-support-will-end-on-january-14-2020

via https://support.microsoft.com/en-us/lifecycle

Wine Reviews

The WineHQ Wine development release 3.3 is now available for Linux and Mac

March 2, 2018

http://www.wine-reviews.net/2018/03/the-winehq-wine-development-release-33.html

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gchapman wrote:
Some will put their copy of Windows 7 into a VM and lock it down.
Sadly some corporate IT departments will say "not supported - can't have" :-(

 

(Win 7 extended support ends 14th Jan 2020)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

... and the one zero price extension is no longer maintained; ...

MIEngine is being maintained :

https://github.com/Microsoft/MIEngine

The Visual Studio MI Debug Engine ("MIEngine") provides an open-source Visual Studio Debugger extension that works with MI-enabled debuggers such as gdb, lldb, and clrdbg.

found by janj :

https://www.avrfreaks.net/forum/making-gdb-attach-gdbserver-instead-launching#comment-2420721

hm ok, I solved this issue now by using MIEngine from Microsoft and adding AtmelStudio 7.0 to the vsixmanifest and changing the GUIDs, it works fine with it. 

...

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
(unfortunately the demise of Windows 7 and the fact that Windows 10 does not support VS2010 means that shortly I will have no choice but to migrate to a later version!)
One of the reasons I ditched microsoft altogether.

Did'n't we have a thread for that? Aha, here it is:

https://www.avrfreaks.net/forum/another-win10-rant-frustration-part-2

 

For a comparison for IDE's for C++ Wikipedia has a reasonably nice table:

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

 

For the compiler itself I stick to GCC of course.

For commercial projects I can imagine switching to a commercial compiler for for example LCD libraries. but I'm fine with GCC itself.

 

I might have said it before, but I've been using Qt Creator for some time for AVR projects. It has a pretty well mix between simplicity and sophistication for my needs.

Because all my projects are makefile based (trying to look into platformio & scons sometimes) I can easily use any text editor for writing code, and compile & program from the command line in a terminal.

Paul van der Hoeven.
Bunch of old projects with AVR's:
http://www.hoevendesign.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

A good coding editor will have:

 

   - the ability to use different colors for the comments and actual code.  Block comments " /* da da da */ " should be a different color from end-of-line comments " // more da da da  "

   - the ability for the user to redefine function keys (or all keys, for that matter) to match commonly used coding symbols.  For instance, using F8 and F9 to represent the braces { }.  The most common programming symbols should be associated with ease-of-use of the strongest fingers. 

   - No programming symbols should require two keypresses (such as Shift+8 for the indirection operator *). 

   - Multiple keys in rarely used sections of the keyboard should be able to be redefined for common programming symbols according to the programming language.  For example, all keys on the top half of the numeric pad (everything in the line above the "1"  to top edge of the Enter button) would be assigned to left brace { and every key on the numeric pad above that line be assigned to right brace }.

   - The lamentable NumLock key would be deactivated. This should have been done six months after the release of the IBM PC when 99.9% of computer users realized how annoying the NumLock key was. 

 

This user-defined keyboard redirection template should be activated when the user opens a file with a .c , .cpp, .h, or .ino extension.

   

    A coders work desk would have two to four flat-screen monitors on it.  One monitor for each different file used by the code.  One for the .ino or main() file; one for the .h file; one for each .cpp library file, ect...   When there is no more room on the physical desktop, then the coder would (hopefully) realize that he should stop using so many separate files to hold the various code sections.

 

Serious editors would have voice recognition for comments.  A code writer would finish the code and then put a picture of his favorite movie star next to the screen.  He would pretend that this movie star is totally fascinated with him and his program and simply loves to hear him describe for hours how the program works in every little detail. Then all of this description is converted into text comments, adjusted for spelling and punctuation and appended to the end of the program.  There would be links between the actual code lines and the verbal description of the code.

 

Good code reads like a Clive Cussler novel.  Short paragraphs of highly descriptive but plainly written commentary intersected with crisp dialog.  The comments would be paragraphs and the actual code would be the dialog.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
... (though "Source Insight" is brilliant, if a little expensive).
Source InsightTM is now in its own install bottle in the commercial version of Wine 3 (CrossOver by CodeWeavers)

CodeWeavers

CodeWeavers

What Runs

Source Insight

https://www.codeweavers.com/compatibility/crossover/source-insight

Source Insight

Source Insight Programming Editor and Code Browser

https://www.sourceinsight.com/

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jodank wrote:
But if I wish to build a space car of the next generation or a private moon shuttle then I should use ASM for sure.
Please don't.  At least not by itself.

Even for a skilled programmer, ASM is the least legible language.

Answering the question "does it work as advertised in the time advertised? will be a major pain.

With a HLL, including C, one can split the task into several, some of which are easier the reading ASM:

If correctly compiled, would the source code do the job advertised?

Is it reasonable to expect the time constraints would be met?

Has the source code been correctly compiled?

Does it meet the time constraints?

That one might be difficult for CPUs with timing more complicated than AVRs.

Does the linked version do what the separate ASM files say?

Parallelism is possible.

If one wants (I think NASA does), one can even do an origin-independent analysis of the linked version.

Expensive, but so are exploding or off-course rockets.

Expensive is not the same as sufficient.

I'd want the other stuff.

"SCSI is NOT magic. There are *fundamental technical
reasons* why it is necessary to sacrifice a young
goat to your SCSI chain now and then." -- John Woods

Pages