Is C & Assembly Programming worth it for an EE Newbie? - Page 1
Forum section: electronics / general

author: michvtr
author_rank: Newbie
timestamp: June 14, 2015, 07:45:33 pm
content: Greetings everyone, I'm new to forum, it's about time I've registered for an account here.I am student with one year of university left until I graduate with a BSEE. Now, during this summer I failed to get an internship, although I did have many successful interviews, the candidates I interviewed against seem to have more qualifications than me.The coursework next year are pretty much out of my interests (Power Generation, Stocastics Probability). On the contrary, I want to move on into an embedded systems and robotics focus in my studies. For my Signals and Systems project, I built an arduino based autonomous RC car which drives on its own to an object of a Red, Green or Blue color without hitting it. From here, I think i've become very interested in the programming sides of things. Also I love the Arduino and want to spend some more time learning about it on my own.Should I delay my BSEE and take some certificate courses in C Programming and Embedded Systems at my university while hopefully getting an internship before diving into fourth year of EE? Let me know what you think.The job market is very tough for BSEE grads without experience without any concentrations. I constantly overhear seniors having trouble even finding 'entry level' EE jobs. This is probably the basis of my worries.

author: tggzzz
author_rank: Super Contributor
timestamp: June 14, 2015, 08:00:02 pm
content: Get your degreee.Get some hobby experience that will show that you (1) do more than required on your course (2) can set achievable stretch goals (3) complete the goals (4) realise what went well/poorly and how you will improve next time.Define a personal project with those characteristics and you will have a better CV and have something to talk about at interview.If C/asm is part of that - fine. If not - also fine.

author: Icarus
author_rank: Regular Contributor
timestamp: June 14, 2015, 08:04:16 pm
content: I don't know its worth to take a "certification" but I do know you should learn how to program, algorithms, software architecture, computer architecture, modern operating systems, networks etc...

author: IanB
author_rank: Super Contributor
timestamp: June 14, 2015, 08:20:41 pm
content: It is worthwhile to learn some assembly programming as this will teach you something about how the machine works, which is especially worthwhile if there is a hardware element to your interests. It will also give you some insight into what language compilers like C have to do when translating your code for the machine. Although you won't usually write production code in assembly, it certainly has value when you are debugging tricky problems and you want to understand something about what instructions the machine is executing.As to whether you should take courses in programming instead of finishing your degree, no, that doesn't make a lot of sense. It is important that you learn how to teach yourself instead of relying on others to feed you. Get some suitable hardware and start learning! There is a whole internet full of resources to guide you, not to mention loads of printed books.

author: nanofrog
author_rank: Super Contributor
timestamp: June 14, 2015, 08:29:55 pm
content: Finish your degree, no exceptions (necessary to get your foot in the door of most companies these days). You can learn both Assembly and C on your own if it comes to that (a very important skill for an engineer). Continue to try and get some experience while still in university.

author: Jeroen3
author_rank: Super Contributor
timestamp: June 14, 2015, 08:33:44 pm
content: If you do not know C you can try to get work with iOS or Android app farms. Or go somewhere to fool around in Microsoft Java (C#).C is essential, for at least the next 15 years.There is no need to be able to write complex routines in assembly as a junior. I doubt you will every need that. Just know the basics of what C translates to in ARM instructions and you'll be fine.You're in the last year of BSEE, so you've have already finished at least 1 year of programming, right?

author: calexanian
author_rank: Super Contributor
timestamp: June 14, 2015, 08:42:44 pm
content: Knowing what I know now. (That is nearly a tongue twister) I wish I had learned C when I was younger. Many of the firmware development tools are moving that way.. Handy thing to have in your tool box so to speak.

author: IanB
author_rank: Super Contributor
timestamp: June 14, 2015, 08:53:49 pm
content: I just read the following comment on YouTube. I'll quote it here as it seems tangentially relevant:Quote

author: rx8pilot
author_rank: Super Contributor
timestamp: June 14, 2015, 09:03:07 pm
content: My opinion is that C is very important to learn. Not only is it useful in a myriad of EE applications, it forces the understanding of key concepts that higher level languages hide from the programmer. Once someone learns C, you should be able to deal with almost any other language while understanding the their limitations.

author: Howardlong
author_rank: Super Contributor
timestamp: June 14, 2015, 09:42:45 pm
content: To add to what has already been said, C is pretty much essential for embedded systems work.It is one of only a few languages, particularly these days, that gets you close enough to the skin of a machine that you stand a chance of making an impact on and understanding how efficiently (or not) it works.The only thing that I would add is that learning C by yourself is all vey well, but without a more formal structured programming and data structure background it may well limit and frustrate you. In my EE degree a gazillion years ago, without doubt the most valuable course was one on algorithms and data structures but it was in Pascal. Those concepts are fundamental to any structured language, far more so than any fancy flavour of the month OO nonsense in respect of embedded systems. Even moving from Pascal to C, I found the concept of pointer arithmetic to be a little painful at first, but in real environments, particularly embedded systems, where performance is everything, the use of such concepts is de rigeur.The value of assembler? Well, less so, particularly these days. Maybe 10 years ago being able to write assembler for the low end embedded controllers would be the only way but nowadays even for those SOT23 MCUs you might as well write it in C.That does not mean you don't need to be at least aware of your MCU's architecture. Innevitably you will at times have to look at the dissasembly at times to work out what is going on, and not be afraid to do so. Even if all you do to learn assembler is to switch an LED on and off, you will have learned enough to be confident in reading and understanding the basics of the compiler's dissassembly code. Stuff like flags, registers, addressing modes etc.These days I switch between several different processor archtiectures, and I don't think twice about dropping into the dissassembly as required: I don't necessarily need to understand _exactly_ what each instruction is doing, but I get a good feel for what is going on particularly when optimising code.

author: Stonent
author_rank: Super Contributor
timestamp: June 14, 2015, 09:53:49 pm
content: Edit: 2 other replies were posted while I was writing this, so some points may be repeats of theirs.Definitely learn C or a C-based/related language. If you learn one, then learning the others is a snap.Many of the basic commands and syntax are identical across C based languages.Code:If (x==1){Do_Something();}Else{Do_Something_Else();}While (x==1){Do_Something();}Do{Do_Something_Else();}While (x!=1);For (Int X=0; X<100; X++){Something_That_Needs_To_Happen_100_Times();}Those basic pieces of code are identical or almost identical in C, C++, Objective C, C#, Java, JavaScript, Arduino, PHP, Perl, PowerShell and several more languages.Minor differences:PHP, Perl and Powershell use a $ in front of variablesPowerShell does not use the standard logical operators like =, !=, >, <, >=, <=, it uses things like -eq (equals), -ne (not equals), -gt (greater than), -lt (less than)My story:I learned Basic as a kid, Pascal in high-school and in college about 18 years ago, Pascal, VB 4, C. None of which I ever used after class was over. But 2 year ago or so when I started playing with Arduinos, and watching Dave's videos, the C stuff came in handy.When I returned to college to attempt to finish my degree, I took an MS Access class and later another intro to programming class that was C#, and it all just clicked into place after a few weeks and the instructor had commented that he was concerned that I might have been paying someone to do my assignments for me since I was excelling far better than anyone else he had seen. I explained my previous programming experiences in school (who seemed much more strict about stuff like formatting) using the form and report designer made working with the C# Windows Forms easier since the toolboxes were similar.I was also taking a HTML5/CSS/JavaScript class at the time. The HTML5 made working with and using XML much easier. The C# made picking up the JavaScript much easier.C# took my familiarity with C and brought me into the understanding of object oriented programming and also to the .NET framework in Windows. It sharpened my brain with C in general and now find Arduino and C for Microcontrollers easier to understand and create.After those classes, I was able to teach myself PowerShell in a few weeks. (Since PowerShell uses a lot of C syntax and also a lot of .NET methods.)Then next semester I had a Java class and it was like "This is almost exactly like C# with different capitalization and slightly different method names." I could immediately read and understand Java without having ever programmed in it before.Then also I had a PHP class and it had portions of the base language that were nearly identical to PowerShell.While taking the HTML5 class I was also taking an SQL class. The understanding of SELECT x FROM y WHERE z ORDER BY x helped a lot in PowerShell since you create a lot of variable list objects that you select from using commands like select and where.I have never taken Assembly but I've heard similar stories about Assembly that some what mirror mine when it comes to C and C-related languages. If you can learn one processors assembly instructions, picking up more processors is fairly easy.So definitely I say, learn C first if possible, and then one object oriented language based on C (C#, Java, C++). If C is not available, then pick C#, Java or C++ based on availability. I prefer C# because I find Visual Studio far more "newb friendly" than Eclipse or NetBeans.Others may differ.If you will be doing some of this stuff outside of an IDE, I highly recommend Notepad++. It supports nearly every language you can think of and has syntax highlighting.Learning a markup based language would be greatly of help as well. HTML5, or just general XML. Since well, most things seem to have web connectivity today and XML is heavily used in configuration files for many applications. Tweaking program options or just using XML to store data is very useful.No, I'm not trying to turn you into a full fledged programmer, but I find even knowing some PC programming to be very valuable when working with electronics programming and debugging.I once whipped up a powershell script that captured output from a digital scale via a virtual serial port over TCP/IP, then modified it and then passed that data to the program that was supposed to be receiving the scale data in order to test general functionality and try some scenarios that we couldn't easily replicate. (The scale was not physically located in our area)I've said a mouthful, but that's how I see things.

author: LabSpokane
author_rank: Super Contributor
timestamp: June 14, 2015, 09:55:16 pm
content: Learn C. How anyone can receive a degree in EE without fluency in a programming language or two is beyond my comprehension. I'm not criticizing you, but higher Ed has just gone batshit crazy and split EE and computer engineering and allowed EEs to have no programming skills at all.Learning assembler is great. But I wouldn't put that at the top of my priority list as a EE. There are people who specialize in that.One caveat: learn C from a qualified instructor that is hard-nosed about writing good code. Lots of people write code, most of them write shitty code. Writing good, clean, reliable code is critical when using C. C is lightweight. C runs fast. C will do exactly what you tell it, for better or worse.Don't learn C on the street. It will only cause you and you future coworkers pain. ;-)

author: Stonent
author_rank: Super Contributor
timestamp: June 14, 2015, 10:13:09 pm
content: Quote from: LabSpokane on June 14, 2015, 09:55:16 pmOh yeah that's right. To add to that, C doesn't care if you want to overflow your memory either purposely or accidentally. When you are working on the scale of a device with a few KB of memory, you can easily overwrite other memory with either a freeze up will happen or unexpected results. You can overflow PCs as well, but many times the memory you flow into is not something that you notice right away since it may be something you're not working with.I once wasn't paying attention to my arrays and had forgotten that they are zero indexed. My AVR program worked ok for about 15 seconds then kept getting slower and slower with each loop, but still worked. I had accidentally went out of bounds on my array and since an MCU has no way of telling you without debugger hardware that you've overflowed your array, or had a memory leak, it will just keep going until something gets overwritten in ram that causes it to no longer function.C++ helps with this a little but still possible. C# and Java don't let you really manipulate memory directly since they execute within a protected bubble (JavaVM for Java, and the Common Language Runtime which C# and VB use)

author: joefarad
author_rank: Newbie
timestamp: June 14, 2015, 11:02:17 pm
content: Really... I hope ya got the message about C... FYI, as a senior EE student, I would hope that you could pick up C on your Arduino in the next couple of weeks. Mastering it may take a little longer but that's just time in grade. You also may want to look into the arm architecture. Good luck.

author: SL4P
author_rank: Super Contributor
timestamp: June 14, 2015, 11:17:07 pm
content: Quote from: IanB on June 14, 2015, 08:20:41 pm+1

author: rx8pilot
author_rank: Super Contributor
timestamp: June 14, 2015, 11:27:53 pm
content: Quote from: LabSpokane on June 14, 2015, 09:55:16 pm++++1111111I have been an amateur programmer since 1984. I actually worked as a professional programmer in the early 90's, but I was solo. When I got back in the saddle a few years ago and had to work with others, it was sobering. I had to go back to page one in the K&R book and get pro education help. It wasn't that my code would not work, it was more that my style and techniques were hard for others to follow, took too long to write, hard to debug, and ultimately slow to run.At 41, I am just now becoming a 'real' programmer.

author: LabSpokane
author_rank: Super Contributor
timestamp: June 14, 2015, 11:56:00 pm
content: This is a bit of a diversion, but since this is about C, hopefully not too much. Writing code, no matter what the language, should be taught to students like we teach grammar in any other language, spoken or written. While there are infinite ways to write a book, there should be standard ways we structure sentences, conjugate verbs, etc. Otherwise, we would never be able to understand one another. Good coding practices need to be taught at the university level. Good coding practice is NOT a job skill to pick up later. In the age of Open-fill-in-the-blank, good coding style is now a life skill. We live in a collaborative world, and code is one way we "talk" to one another.I am not an expert coder by any stretch of the imagination. But I try to write code at *my level* that is clear, simple, and as self-documenting as possible. I "waste" code space initializing variables even though a compiler might do it for me. I'll waste memory declaring the occasional intermediate variable so that my code is more readable.No one in their right mind would hire me as a programmer. But at least I remember the lessons of my 200-level computer sciences instructors and write decent code for what I do.

author: SL4P
author_rank: Super Contributor
timestamp: June 15, 2015, 12:01:24 am
content: A good point.its critical thinking and logic.understanding there is more than one want to address a challenge.A major flaw in many graduate programmers is their dogged determination to use what they learned in college, to do only what they were taught!... regardless of what's actually needed - not necessarily to solve the problem the in best way!

author: EEVblog
author_rank: Unknown
timestamp: June 15, 2015, 12:30:17 am
content: Quote from: michvtr on June 14, 2015, 07:45:33 pmNo, get your degree.QuoteThen work on some projects that puts you above everyone else.

author: VK3DRB
author_rank: Super Contributor
timestamp: June 15, 2015, 03:38:18 am
content: Quote from: LabSpokane on June 14, 2015, 09:55:16 pmWho learn's Assembler? No one. It is calledASSEMBLYlanguage. A common mistake by people who have never actually written any assembly language programs, or are newbies.But I agree on your other points. I find most EE's have no idea how to write good C embedded software because they have not been taught properly, lack the aptitude, or are just plain lazy and disorganised.One of my kids did both engineering and computer science (double degree) at a university here. He had to do C++ programming in both courses. The EE course taught him how to program in C++. The computer science course taught him how to program in C++properly.

author: IanB
author_rank: Super Contributor
timestamp: June 15, 2015, 04:02:48 am
content: Quote from: VK3DRB on June 15, 2015, 03:38:18 amWhat is it with such pointless picking of holes in "facts"?Assembler languageWhat's more important: what you call it, or knowing how to use it?

author: Howardlong
author_rank: Super Contributor
timestamp: June 15, 2015, 07:32:52 am
content: Quote from: VK3DRB on June 15, 2015, 03:38:18 amOh the irony of pedantry, grocer's apostrophe cough?Pretty much asembler and assembly language have been used interchangeably as far as I can remember, back to the 70s anyway when I first wrote some. Certainly I have not been aware (until now) that anyone particularly cares. Sounds rather like the SQL/Sequel debate, I'd say there are other things to get more concerned about.As for the calibre of those who use the term assembler rather than assembly language, or indeed interchageably, I guess that puts my my 30 year career in the dunny then!

author: VK3DRB
author_rank: Super Contributor
timestamp: June 15, 2015, 07:34:44 am
content: Quote from: IanB on June 15, 2015, 04:02:48 amSo what do you call an assembler? An assembler assembler? How about assembler2? Don't take it too seriously.This tells you what an assembler is and what assembly language is...https://en.wikipedia.org/?title=Assembly_languageMost people who use assembly language don't care so much about the the machine readable code. The assembler does it all for you. Learning assembly language can be useful, but these days almost all my embedded coding is done in C. There is little reason to do stuff in assembly language these days, except maybe for high speed RAM or PROM scans or tasks requiring critical clock cycle timing. Plenty of great compilers around for Microchip, Atmel and others, including free compilers.

author: tggzzz
author_rank: Super Contributor
timestamp: June 15, 2015, 07:35:53 am
content: Quote from: VK3DRB on June 15, 2015, 03:38:18 amBy that do you mean it taught him how to avoid all the unpleasant "nooks and crannies" and "gaps between the floorboards"? If so, forwhichC/C++ standard (because there are very significant differences), and which compiler (because there are very significant differences)?If you don't mean that, what do you mean?

author: Jeroen3
author_rank: Super Contributor
timestamp: June 15, 2015, 10:39:07 am
content: C/C++ is a tool.Knowing the C/C++ syntax and rules does not mean you are able to develop a maintainable application.https://en.wikipedia.org/wiki/Object-oriented_design

author: VK3DRB
author_rank: Super Contributor
timestamp: June 15, 2015, 11:36:42 am
content: Quote from: Jeroen3 on June 15, 2015, 10:39:07 amAbsolutely!!!!!Once in my career I had to refactor 50,000 lines ofcreated by a few "engineers" who clearly had no idea how to program (except for one who walked out of that company after a few weeks of mental torment.)It was a massive amount of work to fix. About 18 months of restraining myself from committing murder. The poor microcontrollers had suffered great cruelty under such torture. Even the RSPCA (Royal Society for the Prevention of Coding Atrocities) should have been called in. But with some tender coding care, the microcontrollers recovered and live a happy productive life.What I found was:Sparse commenting and a waste-of-time comments (including ASCII cartoon characters).No programming standards. Cowboy code.Completely illogical or wrong constant, variable and function names.Windows type of programming for an embedded microcontroller.Dead code all over the shop.No consistency in anything.Out of data or wrong documentation.Wrong approaches to handling data used.Almost no type statics used when they should have been.About 300 .c and .h files, of which 80% had irrelevant names.Function calls in ad-hoc places with little planning.No understanding of control theory.No understanding of protocols.Their supposed "CRC's" were actually just 8 bit checksums.Little regard to the architectural and clock constraints of the poor microcontroller.Unnecessary floating point maths operations and array manipulation inside time critical interrupts.Anyone can program, but I have found relatively few EE's write complex code that is beautifully written to make life easy for all to follow. A good start is to engage in using CODING STANDARDS. I don't give a toss what standards are used, but for goodness sake, be consistent. All these traps for young players can be avoided. Engineering courses do not teach top notch coding practices. Computer Science tends to concentrate more on good programming practices. These practices can be learnt by oneself.Above all, learn to communicate to the next engineers who have to inherit your code.I suggest to the author of this thread, DO YOUR DEGREE first and don't be distracted. After you graduate, take time out to learn the art of C programming. Buy a book or two, and read other people's well written code. And practice writing code yourself and enjoy the satisfaction that comes with revisiting your own code 12 months later and not having to work out how the heck it works. And don't end up becoming a pain-in-the-arse code Nazi like myself. Let tools like CodeWrite, Eclipse or something else do that for you.

author: ranch varment
author_rank: Regular Contributor
timestamp: June 15, 2015, 12:11:12 pm
content: I dont bother letting anyone read my code, I share the concepts, but the code is mine, I wouldnt bother even paining you with it, because its all developed as I go, and I even have to change theories halfway through, then bits get left behind, 75% of files end up getting commented out - but I still need the code just in case it turns up its useful again after typing some more in.Ill always pay you a favour I dont want you to bother looking at my code, Ill look at yours, (and I dont complain.) but I dont expect it back, my programs are too big to bother with.Assembler isnt the most hardcore form of coding. The actual pipes that run it are the most hardcore, So I recommend doing that instead.

author: tggzzz
author_rank: Super Contributor
timestamp: June 15, 2015, 01:29:41 pm
content: Quote from: Jeroen3 on June 15, 2015, 10:39:07 amJust so. Except that it appears that even the experts who have been using C/C++ since the 70s have difficulty understanding all the arcane details.FFI, see comments on the usenet group comp.arch, and - for a much better informed and wryly humourous commentary, read learn and inwardly digest the C++ FQAhttp://yosefk.com/c++fqa/I especially like the section on "const correctness".

author: lapm
author_rank: Frequent Contributor
timestamp: June 15, 2015, 04:45:28 pm
content: I would say get your degree. If learning programming makes you late, then you have to explain that every time you apply for job...Its possible to learn programming on your own, good book or two helps, reading other peoples code helps, taking online course for it helps, etc...But you seriously should not avoid learning C-language for example. Its used by tons in embedded micro-controller stuff. If anything else, skill of C-programming allows you to read what the other engineer has done so far with project you end up working on as newest hire in company...Others have posted some very good tips already about coding standards, etc...

author: rx8pilot
author_rank: Super Contributor
timestamp: June 15, 2015, 05:40:06 pm
content: Quote from: ranch varment on June 15, 2015, 12:11:12 pmThat sounds like a predictable path to a mess. It will also ensure that you never really grow as a programmer since you have only a single mind and single set of eyes. Having others read your code is not just a social courtesy, but a critical part of the development process. Another programmer with a different perspective can spot trouble that you may not ever see until you have coded yourself into a corner and have code your way back out. You end up with bloated and inefficient code. All that on top of the fact that sloppy code makes bug searches/fixes very difficult, and adding new features is something only the originator could possibly do. It costs time (money) to operate that way and severely limits opportunities IMHO.I went through that phase which limited me to elementary development only. When I decided I wanted and needed to move up, I focused on writing sharp, clean, and clear code. No surprises, efficient, easy, are my key words. There is always so much to learn and I am not yet a top shelf programmer, but on my way hopefully.

author: con-f-use
author_rank: Unknown
timestamp: June 15, 2015, 06:34:29 pm
content: Quote from: ranch varment on June 15, 2015, 12:11:12 pmThen no one that matters will ever employ you. It's not a bother, it's a chance.

author: tggzzz
author_rank: Super Contributor
timestamp: June 15, 2015, 07:54:29 pm
content: Quote from: rx8pilot on June 15, 2015, 05:40:06 pmYou may, or may not, be surprised by another posting by "ranch varment" athttps://www.eevblog.com/forum/chat/(ab)-(cd)/msg693028/#msg693028

author: MarkF
author_rank: Super Contributor
timestamp: June 15, 2015, 11:01:57 pm
content: FINISH your BSEE degree above all else. You can learn C/C++ programming on your own or by taking a few night classes. If you can find employment with a company that performs good software development processes and standards, you will quickly pick up the necessary coding skills. JAVA and C# are in demand for web based applications. C/C++ and assembly languages are still used for imbedded systems.I am a good example of where you're going. I have a BSEE degree but have been developing software applications for the past 35 years. 20 of which have been in C/C++ and the rest of the time where in varies assembly languages, Fortran and Ada. Work with Arduino and PIC microcontrollers will help you to understand numerous aspects of hardware/software interfacing and control.

author: eas
author_rank: Frequent Contributor
timestamp: June 19, 2015, 06:58:00 pm
content: Quote from: LabSpokane on June 14, 2015, 09:55:16 pmSince it can take a while for a novice to be able to distinguish a well qualified instructor from a passing one, it can help to have a point of reference. For many of a certain age, that was Kernighan & Ritchie "The C Programming Lanugage" in companion with THE UNIX source code. That isn't to say that there aren't other good points of reference. Friends and Colleagues who I would trust to design and implement a complex piece of software from scratch spoke highly of the quality and care evident in the Postgres codebase. There are probably better examples for the embedded developer.In the end, a programming language is a human language, and like all human languages, there are issues of style, idiom, dialect, culture, history, etc. Those differences are important for humans, but the machine doesn't give a damn. For my own purposes, I've tried to focus on Python, because the culture around it values clarity over cleverness, which is important to me because I never program on any given project for long enough to get past the need for clarity. However, Python wasn't intended for use cases like those found in embedded systems and could never substitute for C (which probably won't stop me from trying one of the uC targeted Python subsets at some point).Quote from: IanB on June 15, 2015, 04:02:48 amWell, arguments over semantics seem in-scope for discussions about computer programming. If rigid pedants are bad, compilers/interpreters/assemblers are much worse.As for the OPs original question:In general, my advice for students and recent grads with an interest in any technical or information related discipline is that time and effort spent developing programming/software development/software engineering skills will not be wasted. It will either be a competitive advantage, or an necessary skill. From that point of view, relative to the value of learning any language/environment, which specific language/environment you learn to start with is a minor consideration.However, clearly there are better choices for some domains than others. C is a good choice for embedded development There are many who bash Arduino, but the overall environment is great for both the creative non-engineers it was designed for, and engineers who want to be able to prototype and iterate quickly. Plus, it gives people the chance to dip their toe into C/C++ as need or curiosity arises.From a learning perspective, continuing to work with Arduino wouldn't be a bad thing. However, I doubt it will help much on the job market. It may be popular enough that hiring managers recognize it as a transferrable skill, and perhaps some HR drones will have caught a clue as well. Most likely though, C training/experience is going to be better understood.As for whether to defer graduation to take additional courses. That really depends. If you graduate on time and then pursue more programming training, will it be significantly harder to do or more expensive than if you defer graduation? If it won't be, then I think you are better off beginning your job search and graduating ASAP. If you've graduated and have no promising job offers on the horizon and a lack of programming skills seems to be a major factor, you can then get more programming credentials. On the other hand, if you do land a suitable job after graduation, you can start earning and learning on the job sooner, and you may even be able to get them to pay for further training.Oh, and on a final note, if you think statistics and probability aren't relevant to your interest in robotics, you are likely wrong.

author: Galenbo
author_rank: Super Contributor
timestamp: June 20, 2015, 08:53:06 am
content: Quote from: VK3DRB on June 15, 2015, 03:38:18 amEnglish isn't my first language, but I think the second word is written in a strange way.Nobody made a remark, does it mean something else than "learns"?

author: Galenbo
author_rank: Super Contributor
timestamp: June 20, 2015, 09:03:27 am
content: Quote from: VK3DRB on June 15, 2015, 03:38:18 amDo you have a link to some page where the top-10 of bad embedded C code is explained, and where you agree with?I think I'm on the bad side, but not sure, and always looking for improvement.Don't post links to those unrelevant C++, C# things.You gave some remarks:Quote from: VK3DRB on June 15, 2015, 11:36:42 amBut I would like a link to the constructive, specific and positive side of it: How to code un-cowboy, how to make right and logic names, how to do consistence, the right approach to handle data...

author: tggzzz
author_rank: Super Contributor
timestamp: June 20, 2015, 09:25:32 am
content: Quote from: Galenbo on June 20, 2015, 09:03:27 amMany of the problems in C++ are inherited from C. For example the "const correctness" problems noted in the FQA are common to both - and there are many others e.g. w.r.t. aliasing and implementations of volatile.C# isentirelydifferent and inno waycomparable to C (except for a bit of surface syntax) - the only interesting comparison would be with Java.

author: Galenbo
author_rank: Super Contributor
timestamp: June 20, 2015, 11:04:54 am
content: Sorry, I am absolutely not interested in those things.Only Embedded C, the language mentioned in the first Quote.

author: VK3DRB
author_rank: Super Contributor
timestamp: June 20, 2015, 11:42:57 am
content: There is a ton of good C coding standards and style guides on the web. I wrote our own C Coding Standards for my company because not one size fits all.Check out MISRA, JPL and NASA C coding standards on the web. A lot of good tips in them especially for writing robust embedded codehttp://caxapa.ru/thumbs/468328/misra-c-2004.pdf(there are holes in some of it like the crappy indentation on page 61), and I don't agree with not mixing the /* and // comment styles. If you want to use MISRA, you should purchase the standard. Some compilers like IAR can enforce the MISRA standard.Look at other people's code too, but beware. For example, look at these Doom 3 source code clippings. The author thinks the comments are good. Great that the comments tells you WHY something is being done or gives useful background information, but his commenting style is pretty lousy, leaving the door to ambiguity open because the comment lines can blur.http://fabiensanglard.net/doom3/dmap.phpFor example, start a new comment with a upper case character. It makes more sense to comment blocks of code using "/*... */", and to comment single lines with a "//". I knocked this up as an example.../* Closed loop speed control of the motor */if (motorIsOn){error = speedSetPoint - speedMeasured;current += GAIN * error; // Use proportional feedback control...AdjustMotorSpeed (current); // and blah, blah blah, using a method to delimit or link comment lines (like the 3 dots)}The other thing is some older coding standards say things like "Thou shall not exceed 80 columns in source code". That might be OK if you travel back to the 1980's, but these days on modern monitors it makes little sense to limit a line to 80 characters. Same with inline vs. offset braces. Who cares these days with big monitors, as long as we are consistent and the code is easy to read.You can write your own C Coding Standards or download and use an existing guide. University websites also have them. Some are old and too brief, but others are modern and detailed.In some cases, you are forced to develop code in a certain way, eg: IEC 62304.Also there is this specifically for embedded C...http://www.barrgroup.com/Embedded-Systems/Books/Embedded-C-Coding-Standard$29.

author: tggzzz
author_rank: Super Contributor
timestamp: June 20, 2015, 11:52:54 am
content: Quote from: Galenbo on June 20, 2015, 11:04:54 amSo youareinterested in aliasing and const correctness. And if not then you may suddenly and rudely become interested in them.Change the optimisation level and you will find that, with code (including whatever libraries you are using) or poor compilers, aliasing problems may or may not be visible depending on the optimisation level. And the problems vary between different versions of the same compiler, as bugs in the compiler are noticed and corrected (or introduced).You may not like that, but I've been using embedded C since 1982, and I can assure you the problems are real. People more knowledgeable about the subject than myself (e.g. those that have represented the UK views on various working groups (especially WG14)), tell me that the problems they find are worse and more convoluted than I wanted to believe, that they are baked into the C language specifications, and they vary (by design) between different version of the same C language specifications.

author: Howardlong
author_rank: Super Contributor
timestamp: June 20, 2015, 01:46:41 pm
content: Quote from: tggzzz on June 20, 2015, 11:52:54 amTo be fair, the way I read it was that Galenbo was referring to C and not C++, C# or Java that you mentioned just prior to her post. The scope of this discussion is C and assembly language.

author: linux-works
author_rank: Super Contributor
timestamp: June 20, 2015, 03:37:57 pm
content: Quote from: rx8pilot on June 14, 2015, 09:03:07 pmnot sure I agree with the last part. partially, perhaps.I started my C experience in the mid 80's (I'm a software guy). I stuck with C for a long time and in the early 90's was forced to learn c++ (hated it). I still don't love c++ but I can use it if I have to.last year I had some formal python training. there were a TON of things that python had (new languages have things that C wont' ever have) that caused me to have to struggle to understand. some things were instantly understandable but some things are still taking time for me to fully get it (lambda functions, for example; and the at-sign decorators in python). C gave me no foundation to understand those or even why they exist, now, in new languages. closures (also still very confusing to me) dont' exist in C.and all the obj-oriented stuff is hard for a pure C guy to grasp.anyway, learning C is useful and I do suggest it. its a classic language, now, and when I run into software guys (at least) who are java mavens (lol; that's sort of a joke) but can't hack it when it comes to C, I get annoyed. I once saw production code on a big company's router product (begins with a C, lol) where they allocated something and never free'd it. yup, memory leak inside production code and it was only a few lines of code, but the 'java guy' must have thought it was ok to alloc things and let 'the system' garbage collect it later on its own. sigh. this is what I see as a problem; when kids leave school they are java guys, now, and usually don't have much C. and yet, os's and network stacks and important tools are still written in C, not to mention most realtime boxes and networking boxes.java has polluted a whole generation. lack of C skills is part of the problem and C is not going away any time soon. (java, otoh, is becoming a 2nd choice to, say, python, at least in the US. in india, java is still king but in the US, java is losing ground fast).

author: IanB
author_rank: Super Contributor
timestamp: June 20, 2015, 03:49:56 pm
content: Quote from: Galenbo on June 20, 2015, 08:53:06 amYes, the word should be "learns", not "learn's". Many English speakers have trouble with apostrophes. Such mistakes are so common that people rarely comment on them any more.

author: linux-works
author_rank: Super Contributor
timestamp: June 20, 2015, 04:08:17 pm
content: Quote from: VK3DRB on June 20, 2015, 11:42:57 amhuh? what??upper case buys you nothing in comment lines. hell, I rarely type uppercase since it hurts my carpel tunnel (stupid shift keys were never meant for human anatomy and after decades, it really does hurt).mixing comment style looks ugly! sheesh. nothing wrong with using double slash everywhere. the /* */ style comments now look ugly to me and I only use them in short term debug cases like:if (a == 5 /* 2 */) {...}I might comment out the 2 like that to test it with 5 and once I find the right value, I will remove the comment. but its a quick way to test things out (VERY short term) and still see some 'history' there of what you were doing and trying. again, short term, like during a day's work or maybe a few but avoid committing code to the library like thisQuoteI got in trouble with a very large company when I tried to use my own style. everyone STILL insists that I use 80 chars or maybe a bit longer, but all companies I've worked for seem to insist on this and it does drive me crazy. there is the notion of a logical line and a physical line and sometimes you want that logical line to be a true physical line, even if its long, since it needs to be 'seen' as a single entity. if you strictly follow the 80char rule, you lose self-documenting techniques like that.I also like lots of vertical white space and that also, once, highly annoyed a previous boss of mine. visually, I like to see 'blobs' of things related and together, with separate things really -looking- separate. my vision gets worse as I get older and so I put 2 or more line feeds between C routines that are not related and leave only 1 blank line between functions if they are closely associated with each other. I like to scroll (fast) thru a doc and find sections and the increased vertical white space helps me. but it does seem to drive some purists totally nuts and they freak out when they see extra white space.

author: Jeroen3
author_rank: Super Contributor
timestamp: June 20, 2015, 04:18:41 pm
content: I only use /** for doxygen */, together with /// for briefs.The 80 chars rule is ancient, for when you used to print code.On a 1920x1080 monitor you should be capable to fit 2 files + ide overhead. If your line doesn't fit, it's too big.@earlier: Instead of complain, explain:http://www.oxforddictionaries.com/words/apostrophe

author: linux-works
author_rank: Super Contributor
timestamp: June 20, 2015, 05:33:23 pm
content: I agree that the 80char 'rule' is ancient and does not apply anymore.however, I got my hands slapped when I tried to break this rule. in fact, some 'agile' build systems even reject your code if it does not conform to style guides and you won't be able to check it in (jira, jenkins, etc).when I do my own coding, I follow my own style guide. been writing c code for quarter of a century and I know what works well for me. but when you work for another company, they get to say. and I often find their style guides to be pretty bad. you have no choice, though; so its a reality of working in the software field.could be worse. at least its not python (lol). I like a lot of things about python but they did some some things VERY wrong. indenting and lack of brackets is what I'm talking about, here. but that's for another thread and has already been beaten to death.

author: IanB
author_rank: Super Contributor
timestamp: June 20, 2015, 06:02:42 pm
content: Quote from: linux-works on June 20, 2015, 05:33:23 pmI still think it is reasonable. If we consider that the most important property of code is that be easy for other humans to read and understand, then we will recognize that people generally have trouble scanning long lines. That's why newspapers, for example, generally have columns of text instead of letting the text span the whole page width.Human text presenters, such as web browsers and e-book readers, will usually flow the text between the current margins, wrapping as necessary. Code editors generally don't. If you have a long line of code it will generally disappear off to the right and make you scroll across to see it. This is awkward and painful. Therefore it is better to break long lines by putting line breaks in suitable places.

author: linux-works
author_rank: Super Contributor
timestamp: June 20, 2015, 06:10:32 pm
content: but for every rule there is an exception.I value readability, like you do, but there are times that I want that logical line to be taken as a whole. in fact, I often dont even see what the line says anymore, I 'fold it down' in my mind and consider it an opaque thing that does something, but how it does it, I almost don't care once its debugged and working. and so, putting related stuff on the same line reduced line clutter and I can 'digest' that line as a single whole thing rather than having to realize that some concept was split across multiple physical lines.there are times I want to split lines up, too. it really ALL DEPENDS. each case can be different, so I don't blindly follow any rules (in life or programming). I decide on a per case basis if it makes sense to confirm or not. I'm a human, not a robot, I can evaluate things on a case by case basis. treating people like robots is not productive and is too limiting.

author: Galenbo
author_rank: Super Contributor
timestamp: June 21, 2015, 08:48:46 am
content: Quote from: VK3DRB on June 20, 2015, 11:42:57 amQuote from: tggzzz on June 20, 2015, 11:52:54 amThanks guys for the info.I usually get things working, usually understand my code from years ago, but embedded C is the only language where I work alone,so there's no feedback from other (better/worse) programmers for me in this language.I'll have a look at the links and terms, think it won't take me more than a few weeks :-)

author: tggzzz
author_rank: Super Contributor
timestamp: June 21, 2015, 09:27:48 am
content: Quote from: Galenbo on June 21, 2015, 08:48:46 amIn the case of C and the points I referred to, changes in the standards and compiler implementations mean will take you foreverIt is a "Red Queen's race".https://en.wikipedia.org/wiki/Red_Queen%27s_raceMore positively:MISRA is a good starting pointconsider keeping the specific version of compilers and libraries availableand functioningin the long term. That probably implies development inside a portable VM