Author Topic: Is C & Assembly Programming worth it for an EE Newbie?  (Read 13800 times)

0 Members and 1 Guest are viewing this topic.

Offline michvtrTopic starter

  • Newbie
  • Posts: 4
Is C & Assembly Programming worth it for an EE Newbie?
« on: June 14, 2015, 07:45:33 pm »
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.
« Last Edit: June 14, 2015, 07:47:47 pm by michvtr »
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 21062
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Is C & Assembly Programming worth it for an EE Newbie?
« Reply #1 on: June 14, 2015, 08:00:02 pm »
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.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline Icarus

  • Regular Contributor
  • *
  • Posts: 132
  • Country: 00
Re: Is C & Assembly Programming worth it for an EE Newbie?
« Reply #2 on: June 14, 2015, 08:04:16 pm »
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...


 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 12477
  • Country: us
Re: Is C & Assembly Programming worth it for an EE Newbie?
« Reply #3 on: June 14, 2015, 08:20:41 pm »
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.
 

Offline nanofrog

  • Super Contributor
  • ***
  • Posts: 5446
  • Country: us
Re: Is C & Assembly Programming worth it for an EE Newbie?
« Reply #4 on: June 14, 2015, 08:29:55 pm »
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.
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4205
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Is C & Assembly Programming worth it for an EE Newbie?
« Reply #5 on: June 14, 2015, 08:33:44 pm »
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?
« Last Edit: June 14, 2015, 08:35:39 pm by Jeroen3 »
 

Offline calexanian

  • Super Contributor
  • ***
  • Posts: 1886
  • Country: us
    • Alex-Tronix
Re: Is C & Assembly Programming worth it for an EE Newbie?
« Reply #6 on: June 14, 2015, 08:42:44 pm »
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.
Charles Alexanian
Alex-Tronix Control Systems
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 12477
  • Country: us
Re: Is C & Assembly Programming worth it for an EE Newbie?
« Reply #7 on: June 14, 2015, 08:53:49 pm »
I just read the following comment on YouTube. I'll quote it here as it seems tangentially relevant:

Quote
duane a
 To me, the ZX81 was amazing, because it brought the power of the microprocessor to me.  It had a taste of consumer friendliness that obviously failed to dominate the world, but to me it was my guide.  From this machine, I quickly mastered assembly language of the Z80 microprocessor, which helped me breeze through my electrical engineering degree and ultimately the start of my career.  My life would  have been be much more average without this machine...
 

Offline rx8pilot

  • Super Contributor
  • ***
  • Posts: 3645
  • Country: us
  • If you want more money, be more valuable.
Re: Is C & Assembly Programming worth it for an EE Newbie?
« Reply #8 on: June 14, 2015, 09:03:07 pm »
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.

Factory400 - the worlds smallest factory. https://www.youtube.com/c/Factory400
 

Offline Howardlong

  • Super Contributor
  • ***
  • Posts: 5423
  • Country: gb
Re: Is C & Assembly Programming worth it for an EE Newbie?
« Reply #9 on: June 14, 2015, 09:42:45 pm »
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.
 

Offline Stonent

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
Re: Is C & Assembly Programming worth it for an EE Newbie?
« Reply #10 on: June 14, 2015, 09:53:49 pm »
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: [Select]

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 variables
PowerShell 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.
« Last Edit: June 15, 2015, 11:55:22 am by Stonent »
The larger the government, the smaller the citizen.
 

Offline LabSpokane

  • Super Contributor
  • ***
  • Posts: 1899
  • Country: us
Re: Is C & Assembly Programming worth it for an EE Newbie?
« Reply #11 on: June 14, 2015, 09:55:16 pm »
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. ;-)
 

Offline Stonent

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
Re: Is C & Assembly Programming worth it for an EE Newbie?
« Reply #12 on: June 14, 2015, 10:13:09 pm »
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. ;-)

Oh 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)
« Last Edit: June 14, 2015, 10:16:40 pm by Stonent »
The larger the government, the smaller the citizen.
 

Offline joefarad

  • Newbie
  • Posts: 5
  • Country: us
Re: Is C & Assembly Programming worth it for an EE Newbie?
« Reply #13 on: June 14, 2015, 11:02:17 pm »
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.
« Last Edit: June 14, 2015, 11:06:52 pm by joefarad »
- they'll stone you and say good luck...  -- R.Z.
 

Offline SL4P

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
  • There's more value if you figure it out yourself!
Re: Is C & Assembly Programming worth it for an EE Newbie?
« Reply #14 on: June 14, 2015, 11:17:07 pm »
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.
+1
Don't ask a question if you aren't willing to listen to the answer.
 

Offline rx8pilot

  • Super Contributor
  • ***
  • Posts: 3645
  • Country: us
  • If you want more money, be more valuable.
Re: Is C & Assembly Programming worth it for an EE Newbie?
« Reply #15 on: June 14, 2015, 11:27:53 pm »
Don't learn C on the street. It will only cause you and you future coworkers pain. ;-)

++++1111111

I 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.
Factory400 - the worlds smallest factory. https://www.youtube.com/c/Factory400
 

Offline LabSpokane

  • Super Contributor
  • ***
  • Posts: 1899
  • Country: us
Re: Is C & Assembly Programming worth it for an EE Newbie?
« Reply #16 on: June 14, 2015, 11:56:00 pm »
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.
 

Offline SL4P

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
  • There's more value if you figure it out yourself!
Re: Is C & Assembly Programming worth it for an EE Newbie?
« Reply #17 on: June 15, 2015, 12:01:24 am »
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!
« Last Edit: June 15, 2015, 12:32:12 am by SL4P »
Don't ask a question if you aren't willing to listen to the answer.
 

Offline EEVblog

  • Administrator
  • *****
  • Posts: 38951
  • Country: au
    • EEVblog
Re: Is C & Assembly Programming worth it for an EE Newbie?
« Reply #18 on: June 15, 2015, 12:30:17 am »
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.

No, get your degree.

Quote
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.

Then work on some projects that puts you above everyone else.
 

Offline VK3DRB

  • Super Contributor
  • ***
  • Posts: 2268
  • Country: au
Re: Is C & Assembly Programming worth it for an EE Newbie?
« Reply #19 on: June 15, 2015, 03:38:18 am »
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. ;-)

Who learn's Assembler? No one. It is called ASSEMBLY language. 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.
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 12477
  • Country: us
Re: Is C & Assembly Programming worth it for an EE Newbie?
« Reply #20 on: June 15, 2015, 04:02:48 am »
Who learn's Assembler? No one. It is called ASSEMBLY language. A common mistake by people who have never actually written any assembly language programs, or are newbies.

What is it with such pointless picking of holes in "facts"?

Assembler language

What's more important: what you call it, or knowing how to use it?
 

Offline Howardlong

  • Super Contributor
  • ***
  • Posts: 5423
  • Country: gb
Re: Is C & Assembly Programming worth it for an EE Newbie?
« Reply #21 on: June 15, 2015, 07:32:52 am »

Who learn's Assembler? No one. It is called ASSEMBLY language. A common mistake by people who have never actually written any assembly language programs, or are newbies.


Oh 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!
 

Offline VK3DRB

  • Super Contributor
  • ***
  • Posts: 2268
  • Country: au
Re: Is C & Assembly Programming worth it for an EE Newbie?
« Reply #22 on: June 15, 2015, 07:34:44 am »
Who learn's Assembler? No one. It is called ASSEMBLY language. A common mistake by people who have never actually written any assembly language programs, or are newbies.

What is it with such pointless picking of holes in "facts"?

Assembler language

What's more important: what you call it, or knowing how to use it?

So what do you call an assembler? An assembler assembler? How about assembler2? Don't take it too seriously. :-DD

This tells you what an assembler is and what assembly language is...
https://en.wikipedia.org/?title=Assembly_language

Most 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.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 21062
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Is C & Assembly Programming worth it for an EE Newbie?
« Reply #23 on: June 15, 2015, 07:35:53 am »
The computer science course taught him how to program in C++ properly.

By that do you mean it taught him how to avoid all the unpleasant "nooks and crannies" and "gaps between the floorboards"? If so, for which C/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?
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4205
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Is C & Assembly Programming worth it for an EE Newbie?
« Reply #24 on: June 15, 2015, 10:39:07 am »
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
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf