SPLIT : Why do I hate C?

Go To Last Post
19 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi
A nonsense question !

Why I hate C!! The problem is with me or C?

Please, just one way to get me out of this hatred this Monday.

 

Split and moved to General programming.. - Moderator

Last Edited: Mon. Jul 31, 2017 - 06:55 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Goorman wrote:
The problem is with me or C?

 

Probably you.

 

Did you learn your A and B to get to C?

 

A = ASSEMBLER

 

B = Bytes

 

C

 

 

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

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

Just wait for 'Simonetta' to find this.. (-:

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

I love C.  And I like Mondays.  They are the same as every other day since I retired.

 

Better you practice your C, and you will love it when it flows easily.  In the mean time, you can hate me.

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

Guess: Maybe you "hate" C because it does what you TELL it to do, instead of doing what you WANT it to do?  The BIG TRICK? Learning how to tell it what you want it to do!

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

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

B = Bytes

You mean BASIC? That comes after Assembler..... then C or not.....

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

js wrote:

B = Bytes

You mean BASIC? That comes after Assembler..... then C or not.....

I was stuck for something witty and failed....

 

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

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

ka7ehk wrote:

Guess: Maybe you "hate" C because it does what you TELL it to do, instead of doing what you WANT it to do?  The BIG TRICK? Learning how to tell it what you want it to do!

 

Jim

 

I was going to say something about getting married for that, but I never have been, so I should shut up already.

 

''D' is for 'defenestration' when you throw the whole thing out the window and take up golf instead.

 

S.

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

Thanks for your guidance

The result is:
Hey ugly C, I must learn you so the world is full of unreasonable things that I have to deal with. I hope, one day I will love you.

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

"I was stuck for something witty and failed...."

And yet...

 

 

https://en.wikipedia.org/wiki/B_(programming_language)

Four legs good, two legs bad, three legs stable.

Last Edited: Tue. Aug 1, 2017 - 06:57 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well....

 

C is a LOT better than working in assembly, but there are some simple compiler features that it lacks which could make things lots smoother. If you point any of these out, you get long responses about the "spirit of C" and shouted down in embedded programming forums. Don't ask me how I know

 

GCC is maintained by some really clever people and it optimizes better than I could write any assembly code. But then, it doesn't have to worry about the assembly code it generates being legible since anybody in his right mind does his maintenance work in the C source, not the assembly output.

 

P.S. I speak C with a strong Pascal accent.

The largest known prime number: 282589933-1

In my humble opinion, I'm always right. 

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

And some folks went for the "D" programming language (incl at least one C++ "elephant") : https://dlang.org

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

I'm going to pass on this.   After all, what you C is what you get.    Monkey C: monkey do.

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

Torby wrote:

C is a LOT better than working in assembly, but there are some simple compiler features that it lacks which could make things lots smoother.

If you point any of these out, you get long responses about the "spirit of C" ...

 

Theoretical vs practical.

Way back when, I read an article about whether Pascal's case statement needs an else clause.

Niklaus Wirth, who created Pascal, argued that the case statement should not have an else.

Many Pascal compilers, including Turbo Pascal, included an else for the case statement because it was too practical to leave out.

(Note that C has default for the switch statement.)

 

So Torby, which "simple compiler features" does C lack?

 

 

 

 

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

var parameters, for one. In pascal languages, you specify VAR in the parameters and whenever you call the function, it knows to pass by reference. In C you have to remember that yourself. Some other little bits and pieces.

 

ELSE made the pascal case statement SO much more useful.

 

I like how C variables are executable  code and you can say int B = PORTB & (1<<c) ;

 

The largest known prime number: 282589933-1

In my humble opinion, I'm always right. 

Last Edited: Sat. Aug 5, 2017 - 06:08 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Goorman wrote:
Hey ... C, I must learn you

Yes, that is the key!

 

You must make the effort to properly, systematically, learn the language - not just jump in and hope to throw stuff together.

 

Here's some learning & reference materials for you: http://blog.antronics.co.uk/2011/08/08/so-youre-thinking-of-starting-with-c/

 

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

Hi  awneil

I think because I started with Basic and Visual Basic, now I hate C. Although sometimes I had to write a few lines. For starters, I need to have a rational reason, and I'm looking for it.
I hope this blog can convince me.
thanks for your kindness

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

It's always the same when going from one language to another:  because you naturally just try to write, eg, BASIC in C - which is doomed to failure and frustration.

 

It will get better once you can actually start to think in C (or whatever)...

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

Speaking two languages, I have to start thinking in one of them before I can speak it. Same with programming. I've used many languages over the years. Think it, then you can speak it.

The largest known prime number: 282589933-1

In my humble opinion, I'm always right.