Shop OBEX P1 Docs P2 Docs Learn Events
Why C is better than BASIC, can anyone provide live example? - Page 6 — Parallax Forums

Why C is better than BASIC, can anyone provide live example?

13468912

Comments

  • idbruceidbruce Posts: 6,197
    edited 2015-04-01 20:45
    Shell Invasion Reference http://forums.parallax.com/showthread.php/156547-Protecting-WINDOWS-XP-SP3-And-My-Invasion-Of-The-System-Shell

    Let me see Basic achieve what this program does.

    Of course it could be done, but I would like to see it.

    The software is in Post #42 of that thread
  • Heater.Heater. Posts: 21,230
    edited 2015-04-01 22:39
    idbruce,

    What's all this Visual Basic vs Visual C++ nonsense? How off topic can we get?

    Visual C++ is not even a programming language it's an IDE and libraries. The language it uses is C++ and that is not the language under discussion, C. Same for Visual BASIC except that the name also refers to yet another non-standard dialect of a BASIC like language.

    Neither of these are useful outside of their legacy operating system. And so are not interesting to the world at large.

    In the same way that every Christian should have a bible, every C programmer should have a K&R. Similarly it's not necessary to actually read it :)

    However doing so does at least teach people the difference between a programming language and an IDE :)
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-04-02 01:41
    Well, I tried the K&R 2nd edition (ANSI standard C) entry point and quickly found that the STDIO examples got me snagged by conversions to and from floating point. This is an awful entry point for the new user to learn C on the Propeller as the floating point conversions of i/o eat up a big chunk of the 32K hub ram, and slow everything down that is trying to get through the i/o.

    K&R 2nd edition is indeed worth referring to, once you have learned something as it is short and clear. You can get a free PDF download from the internet, no need to buy. But don't expect C on any microcontroller to adhere to the standard libraries in a religious fashion. K&R clearly states that the C language is NOT the libraries. And in many instances, the example were heavily focused on deploying code for databases, not exacty an optimal use for mirco-controllers.

    Visual Studio, VisualBasic......... arrg!
    I found a lot of my Taiwanese students that were occupationally programmers in the semiconductor industry actually knew nothing but VisualBasic... no C. It seems that the English-Chinese language barrier created a situation where a generation of programmers never bothered to learn C and the textbooks in Chinese for VisualBasic were easier to follow, and everybody was using Windows anyway.

    You find technology skipping in nations playing catchup. China went pretty much from vinyl audio records to digital, some reel-to-reel tape. But no 8-track and a limited amount of cassette tapes. Audio CDs skyrocketed.

    My gut feeling is that Basic need only be a beginneers orientation purposed language. Microsoft has developed it as a 'branded product' that desires to lock in customer loyalty and dependency.

    ++++++

    My main interest is that Parallax should have a clear educational continuty in programing languages. In other words, if one is recommend Propeller Basic as the lowest of entry points, the pathways to SPIN, GCC, and PASM should be clearly explained with PRO and CON factors for each -- maybe a spreadsheet presentation on a web page.

    The core problem is that people are asking themselves "How do I get started without wasting a lot of time and effort?" This is why teachers and schools develop cirriculms and syllabus. The more that Parallax provides at least a skeletal structure for these, the more real educators will appreciate and adopt the Propeller in the classroom. And of course, the self-study individual will always perfer the best self-study materials -- not just FREE tutorials on the internet (which can be very hit-or-miss).

    I actually have done a PBasic to ANSI C comparision for my own understanding. ANSI C has everything that PBasic provides, and then extends beyond in obvious useful tools that rely on the original fundamentals. I suppose that publishing a 'white paper' (I hate the tutorial apporach), might inspire PBasic users to up-grade to C. In fact, there are a lot of potential 'white paper' topics that need to be addressed -- items that are repeatly debated on this Forum. Rather than debate, why not inform those that are interested in a useful manner?
  • Heater.Heater. Posts: 21,230
    edited 2015-04-02 04:08
    Loopy,
    And in many instances, the example were heavily focused on deploying code for databases,
    Do what? Which chapter and paragraph of K&R makes any use of or mentions a database? I think you'll find there isn't one.

    Chapter 8 is all about the UNIX System Interface which most people will probably want to ignore. Though they should not, it's all good example code.

    Otherwise K&R is all good, honest, down to earth, C syntax and semantics.
  • idbruceidbruce Posts: 6,197
    edited 2015-04-02 05:07
    Heater
    The language it uses is C++ and that is not the language under discussion, C.

    Hmmmm.... That's wrong. I can output all the C programs I want with it. As for being nonsense. I would imagine those are the two best selling IDEs of C and Basic in the world. If you want to compare, I say compare those two.
  • Dave HeinDave Hein Posts: 6,347
    edited 2015-04-02 05:15
    idbruce, I must point out that you are unfairly taunting Heater to use a Windows system. He is allergic to anything produced by Microsoft, and would probably become severely ill if he actually tried either VisualBasic or Visual C++. Shame on you for suggesting that he even consider such a thing. We must be sensitive to other people's afflictions.
  • Heater.Heater. Posts: 21,230
    edited 2015-04-02 05:25
    idbruce,

    OK that is true enough, it will compile C as well.

    I think my point was that we are comparing two languages here. C and BASIC. We are not comparing IDE's. IDE's are not languages.

    Also I can't see how it's relevant to look at systems used for programming a single legacy personal computer operating system on a micro-controller forum. They are of no use.
  • Heater.Heater. Posts: 21,230
    edited 2015-04-02 05:32
    Ha, ha, Dave, not so fast. It's not just MS.

    I have been quite happy to use VC++, when people want to throw money at me to do so. Mind you I also ensure that all that code runs on Mac and Linux as well. A feature that my clients and employers have been very grateful for as the years went by.

    I did draw the line at Visual Source Safe though. The worst source code management tool ever.
  • idbruceidbruce Posts: 6,197
    edited 2015-04-02 05:43
    Heater
    I think my point was that we are comparing two languages here. C and BASIC. We are not comparing IDE's. IDE's are not languages.

    No, but those IDEs, have the best libraries for the languages being discussed.
    Also I can't see how it's relevant to look at systems used for programming a single legacy personal computer operating system on a micro-controller forum. They are of no use.

    I do not believe that the OP mentioned uC anywhere in this thread. Which is better? C of course. :) What is the very best IDE for C.... We all know the answer to that one, but I will be sensitive to your affliction :)
  • MicksterMickster Posts: 2,693
    edited 2015-04-02 05:47
    idbruce wrote: »
    Heater
    If you want to compare, I say compare those two.

    Why compare two products that aren't intended to go head to head? VB can't even do multi-threading.

    If you care about small, fast, *readable* code on the Windows platform, you need this (The PB compiler was created using PB, BTW):

    http://www.powerbasic.com/products/pbdll32/
  • idbruceidbruce Posts: 6,197
    edited 2015-04-02 06:03
    Mickster
    Why compare two products that aren't intended to go head to head? VB can't even do multi-threading.

    If you care about small, fast, *readable* code on the Windows platform, you need this (The PB compiler was created using PB, BTW):

    http://www.powerbasic.com/products/pbdll32/

    Okay... Now let's see you attempt a shell invasion with that IDE similar to the one mentioned in Post #153.

    I'll give you a years time :)
  • MicksterMickster Posts: 2,693
    edited 2015-04-02 06:12
    idbruce wrote: »
    Mickster
    Okay... Now let's see you attempt a shell invasion with that IDE similar to the one mentioned in Post #153.

    I'll give you a years time :)

    Unfortunately I have paying clients right now and I am betting that my rates are out of your league so I cannot even quote you on this project.

    You like to give the impression of a veteran C coder, why do you have to cite someone else's work as a benchmark....why not come up with your own hand-crafted challenge?
  • idbruceidbruce Posts: 6,197
    edited 2015-04-02 06:16
    Mickster

    Mr.Vapor himself
    You like to give the impression of a veteran C coder, why do you have to cite someone else's work as a benchmark....why not come up with your own hand-crafted challenge?

    The application linked to in Post #153 is my own hand crafted work :) Now either put up or shut up
  • PublisonPublison Posts: 12,366
    edited 2015-04-02 06:22
    ///...///...///...
  • Martin_HMartin_H Posts: 4,051
    edited 2015-04-02 06:22
    Heater. wrote: »
    I did draw the line at Visual Source Safe though. The worst source code management tool ever.

    I never used that one. Is it worse than Clearcase? That's my gold standard for bad and complicated at the same time!
  • idbruceidbruce Posts: 6,197
    edited 2015-04-02 06:26
    Sorry Jim

    He just keeps trying to push my button. So I offer him a challenge. Let's see if he can do it in a year. My project took about a day.
  • Martin_HMartin_H Posts: 4,051
    edited 2015-04-02 06:27
    David Betz wrote: »
    Yes!! LISP! The only perfect programming language. Only problem is you wear out your paren keys quickly. :-)

    You're both heretics. Logo is the perfect programming language. All the clarity and power of Lisp with the all conciseness of BASIC.
  • MicksterMickster Posts: 2,693
    edited 2015-04-02 06:39
    idbruce wrote: »
    Sorry Jim

    He just keeps trying to push my button. So I offer him a challenge. Let's see if he can do it in a year. My project took about a day.

    Oh you mean this one?
    idbruce wrote: »

    Many years ago, I came across CSystemTray class, written by Chris Maunder. Anyone interested in System Tray applications should definitely look at his class object. Over the years, I have used this class several times, and it has always worked flawlessly.

    Many thanks to Chris Maunder for sharing this class.

    You rock, Bruce, what can I say! LOL!
  • Heater.Heater. Posts: 21,230
    edited 2015-04-02 06:41
    @idbruce,

    No the OP did not say anything about what he want's to do with either language. That is why his question is un-answerable and this thread is all over the shop.

    It's all about context. This is a Parallax forum and Parallax are a vendor of micro-controllers that can be programmed in BASIC and C. It would be natural to assume the question is not about writing software for legacy personal computer operating systems.

    "What is the very best IDE for C". Clearly not Visual Studio. It does not even start up on any machine I need to develop code on or for.

    @Martin_H,
    I never used that one. Is it worse than Clearcase? That's my gold standard for bad and complicated at the same time!
    That's a close call. They are both essentially useless. After a few years of using Clearcase and spell trying to use VSS I would say Clearcase is way out in front in terms of complexity.

    Years after I left one company they called me up asking if I had copies of the code I wrote for them. They could not get it out of their VSS! Luckily I did.

    Believe it or not I have had to use even more complex, time consuming, horrible version control systems. In the avionics industry.

    Thank goodness Linus showed the world how to do it with git. I can't live without git now a days.
  • Heater.Heater. Posts: 21,230
    edited 2015-04-02 06:44
    Guys, I love a good language war as much as the next programmer.

    But when they devolve into stupid play ground personal slanging matches it's really boring. It' also disrespectful to everyone else who would like to follow the debate.

    Please exercise some self control.

    Thank you.

    Play on!.
  • PublisonPublison Posts: 12,366
    edited 2015-04-02 06:48
    idbruce wrote: »
    Sorry Jim

    He just keeps trying to push my button. So I offer him a challenge. Let's see if he can do it in a year. My project took about a day.

    I'm just here enjoying my popcorn, but I'm still trying to figure out the plot. :)
  • idbruceidbruce Posts: 6,197
    edited 2015-04-02 06:53
    Mickster

    You can attack better than that, can't you Mick? CSystemTray is all about the icon in the system tray, that program is sooooooo much deeper than CSystemTray. That program modifies the standard operating procedure of Windows Explorer. Would you even have a clue?

    This all goes back to the time when you were WRONG about a "PROVISIONAL PATENT". Grow up Mick, just let it go.
  • mindrobotsmindrobots Posts: 6,506
    edited 2015-04-02 06:56
    Jim,

    So far:

    blah...blah..blah...better...blah...blah..is not...blah...blah...I wrote a program that does this and you can;t in BASIC....blah...blah...I'm too busy and really don't care because I have paying clients and I don't need a program that does that...blah...blah...your mamma!!....blah...blah...whatever....blah...

    In the meantime, I have a little icon on my Mac and various Linux "system trays" that you click and can disconnect from the network or reconnect to the network and Firefox and Chrome both replicate my bookmarks (aka favorites) from machine to machine.....so I'm just enjoying the popcorn for now!

    I'll throw another log on if the fires start to get low! :D
  • MicksterMickster Posts: 2,693
    edited 2015-04-02 07:04
    Heater. wrote: »
    @idbruce,

    No the OP did not say anything about what he want's to do with either language.

    I noted this from the get-go but because it wasn't in the Prop forum and you don't hear much about BASIC on Linux, I assumed the OP was referring to the Windows platform.

    What I would like to see is source code snippets to be compiled under both C and BASIC and compare execution times, *standalone* .exe file size and maybe post the code for a vote on readability.

    I haven't touched Windows programming since I started on Android, three years ago but I guess I could dig out my PB compiler.
  • PublisonPublison Posts: 12,366
    edited 2015-04-02 07:06
    mindrobots wrote: »

    I'll throw another log on if the fires start to get low! :D

    Unfortunately Rick, I'm standing by with the garden hose to keep the flames down.

    Jim.
  • mindrobotsmindrobots Posts: 6,506
    edited 2015-04-02 07:08
    Publison wrote: »
    Unfortunately Rick, I'm standing by with the garden hose to keep the flames down.

    Jim.

    Right, that's what I meant, I'll call 9-1-1 if things get bad! :D
  • Dave HeinDave Hein Posts: 6,347
    edited 2015-04-02 07:10
    Publison wrote: »
    I'm just here enjoying my popcorn, but I'm still trying to figure out the plot. :)
    The plot goes like this. When C and Basic were kids they played together on the same computer. They were best friends, but then they started growing apart. C worked hard, and was involved in many big projects. He started a family and his kids were involved in even larger projects than C was. His kids are very object oriented they do well in all areas of endeavors.

    Basic did not do as well in business or industry. He also had a family, but his kids were not well organized, and they weren't as successful as C's family. Basic has a large family, but none of them really adhere to any standards. Some of Basic's kids are also object oriented, but they rarely win when competing directly with C's kids.
  • idbruceidbruce Posts: 6,197
    edited 2015-04-02 07:11
    Jim
    Unfortunately Rick, I'm standing by with the garden hose to keep the flames down.

    That's okay Jim, I am bowing out. He's right, my skills are just vapor :)
  • Heater.Heater. Posts: 21,230
    edited 2015-04-02 07:17
    Dave,
    Basic did not do as well in business or industry. He also had a family, but his kids were not well organized,
    Ha, I love it. A programming language soap opera.

    According to Dijkstra all the children of BASIC have brain damage. http://www.cs.virginia.edu/~evans/cs655/readings/ewd498.html
  • mindrobotsmindrobots Posts: 6,506
    edited 2015-04-02 07:19
    Dave Hein wrote: »
    The plot goes like this. When C and Basic were kids they played together on the same computer. They were best friends, but then they started growing apart. C worked hard, and was involved in many big projects. He started a family and his kids were involved in even larger projects than C was. His kids are very object oriented they do well in all areas of endeavors.

    Basic did not do as well in business or industry. He also had a family, but his kids were not well organized, and they weren't as successful as C's family. Basic has a large family, but none of them really adhere to any standards. Some of Basic's kids are also object oriented, but they rarely win when competing directly with C's kids.

    I like that! BASIC mostly lived in its parent's basement and played games (sometimes went out and did productive work). :D
Sign In or Register to comment.