Author Topic: How many people code in C these days, and if so, why?  (Read 45424 times)

0 Members and 4 Guests are viewing this topic.

Offline olkipukki

  • Frequent Contributor
  • **
  • Posts: 790
  • Country: 00
Re: How many people code in C these days, and if so, why?
« Reply #400 on: May 16, 2020, 04:28:26 pm »

I really don't get the mingw stuff. It's just another layer of headache. Is it my stuff, is it the wrapper, is it a windows bug?
No, it's clusterf@G  :scared:
 

Offline bd139

  • Super Contributor
  • ***
  • Posts: 23059
  • Country: gb
Re: How many people code in C these days, and if so, why?
« Reply #401 on: May 16, 2020, 04:38:27 pm »
If you're using mingw you're doing something wrong...

 
The following users thanked this post: chriva

Offline chriva

  • Regular Contributor
  • *
  • Posts: 102
  • Country: se
Re: How many people code in C these days, and if so, why?
« Reply #402 on: May 16, 2020, 04:40:25 pm »
If you're using mingw you're doing something wrong...


Anyone using PS instead of shell gets a thumbs up from me. Miles ahead of the old stuff
 

Offline bd139

  • Super Contributor
  • ***
  • Posts: 23059
  • Country: gb
Re: How many people code in C these days, and if so, why?
« Reply #403 on: May 16, 2020, 04:41:58 pm »
Yeah it's windows terminal + powershell as well. Waaay better. That plus vscode = bliss.

I'm mostly using it to write Go and kubernetes manifests at the moment.
 

Offline nfmax

  • Super Contributor
  • ***
  • Posts: 1581
  • Country: gb
Re: How many people code in C these days, and if so, why?
« Reply #404 on: May 16, 2020, 04:46:54 pm »
Yeah it's windows terminal + powershell as well. Waaay better. That plus vscode = bliss.

I'm mostly using it to write Go and kubernetes manifests at the moment.

Ana a Gopher client:

I'm actually building a console gopher client in Go at the moment ;)

Please tell me your program is called 'pher", as in:
    $go pher
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6648
  • Country: fi
    • My home page and email address
Re: How many people code in C these days, and if so, why?
« Reply #405 on: May 16, 2020, 05:04:03 pm »

Why not run python3 explicitly?

Yeah, the Python 2/3 split, and exactly which interpreter you get when running just python, is annoying.

I'm actually building a console gopher client in Go at the moment ;)
Name it fer to ensure maximum :o.
 

Offline bd139

  • Super Contributor
  • ***
  • Posts: 23059
  • Country: gb
Re: How many people code in C these days, and if so, why?
« Reply #406 on: May 16, 2020, 05:12:02 pm »
It’s called nofur at the moment so half way there.

I can run python3 or Python. Does the same thing. I have three different version on this box. Latest is just default
 
The following users thanked this post: Nominal Animal

Offline Picuino

  • Super Contributor
  • ***
  • Posts: 1026
  • Country: es
    • Picuino web
Re: How many people code in C these days, and if so, why?
« Reply #407 on: May 16, 2020, 08:17:10 pm »
To install Python and its associated libraries in Windows it is best to use Anaconda or another similar package.
https://www.anaconda.com/products/individual

This way you avoid incompatibilities between versions and resolve dependencies.


Why do we need Anaconda when we have pip?
« Last Edit: May 16, 2020, 08:20:07 pm by Picuino »
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6529
  • Country: nl
Re: How many people code in C these days, and if so, why?
« Reply #408 on: May 16, 2020, 10:14:44 pm »
Did this topic morph to a python topic ?  :clap:  :--
 

Offline bd139

  • Super Contributor
  • ***
  • Posts: 23059
  • Country: gb
Re: How many people code in C these days, and if so, why?
« Reply #409 on: May 16, 2020, 10:31:04 pm »
Python is where it all ends  :-DD
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15047
  • Country: fr
Re: How many people code in C these days, and if so, why?
« Reply #410 on: May 16, 2020, 10:33:12 pm »

 :-DD
 
The following users thanked this post: Karel, bd139

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6648
  • Country: fi
    • My home page and email address
Re: How many people code in C these days, and if so, why?
« Reply #411 on: May 17, 2020, 01:00:56 am »
Python is on-topic in the sense that the official interpreter, CPython, is written in C, and currently it is easiest to interface to Python via C.

Which is one of the use cases I've already mentioned: writing code that can be used from multiple programming languages, without risking runtime library incompatibilities (as may happen with e.g. C++, if your code uses C++ version X and some other code used in the same process is compiled against C++ version Y).
 
The following users thanked this post: Karel

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2247
  • Country: 00
Re: How many people code in C these days, and if so, why?
« Reply #412 on: May 17, 2020, 07:01:35 am »
One could say that, without C, other languages can't exist...
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4159
  • Country: gb
Re: How many people code in C these days, and if so, why?
« Reply #413 on: May 17, 2020, 07:59:27 am »
One could say that, without C, other languages can't exist...

It's funny.  Most of the internet runs on C.  Unix/Linux etc is still the dominate OS.

When people write business applications in Java/Python/<insert exotic language the kids want to use>.  The C folks who write things like Docker, ngix, apache httpd, postfix, sendmail and the Linux OS smile and say, "Aww, bless!  Look; they use milliseconds to time things.  How quaint."
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4159
  • Country: gb
Re: How many people code in C these days, and if so, why?
« Reply #414 on: May 17, 2020, 08:08:46 am »
Oh it's a piece of piss to install python 3 on MacOS. Take the mac and chuck it out the window or install windows on it. ----- Python packaging on linux is crap too. I spent at least 5 days this year unfucking centos python packages where someone has installed something with pip on the target node.

Mac-what?  What's that?

I have never installed Python on windows in my life.  I'm too scared after installing perl once on windows.  EDIT:  I tell a lie.  I do have PyCharm installed, so that counts I suppose.

Redhat are arseholes.  Some of their install conventions are absolutely bonkers.  They modify Java to distribute it according to the FSH and move it all over the place leaving behind dozens of dynamic symlinks to make it look use-able to Java programs.  It's moderately annoying when you want to install a version you can get an rpm for, it's massively annoying when you want to install a version you can't get an rpm for.  Just unzip the damn tarball, update your JAVA_HOME and you are DONE!  Stop the madness!  /opt/java/jdk1_8 -> /opt/java/version/jdk_1.8.0_234  if you must.

Python on gentoo was better, but there was always the hassle when an upgrade told you that you needed to update every Python module and reinstall everything that uses said modules.  The page detailing this is an hours read on their wiki. :(  Gentoo does have it's "Slotting" mechanism and as long as you are paying attention and don't leave upgrading too long, it's fairly usable to have multiple concurrent versions, even minor versions.

On shells, I can't deal with CMD it's just rubbish.  I can't deal with PowerShell cause it's just a .Net console running on CMD.  If you have admin switch on the Linux developer layer in Windows 10 and install whatever Linux you want.  Or use cygwin or at very least git bash.  Never stoop low enough to be forced to use CMD, in any disguise.
« Last Edit: May 17, 2020, 08:18:44 am by paulca »
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline dietert1

  • Super Contributor
  • ***
  • Posts: 2291
  • Country: br
    • CADT Homepage
Re: How many people code in C these days, and if so, why?
« Reply #415 on: May 17, 2020, 09:59:59 am »
A compiled language like C/C++ prevails for people who want some IP protection. After that hands-on advice that even elderly people need to learn Python i started looking up some examples, then downloaded pycharm IDE. Then during installation a little panel popped up asking me for the root password. What? Isn't that IDE written in Python?
Then i found i already had Python 3.7 on my Debian internet computer and the editor supported syntax hiliting for python, so i enjoyed the examples. Appended my first exercise if anybody is interested.
Tried another example with pyqt5, but that complains about super()... Maybe i am invoking another old python.

Regards, Dieter

Edit: The example script2.py worked after i made it invoke python3 instead of python. Besides that i had to install another Debian package with Qt5 bindings for python3 instead of Qt5 bindings for python that i had installed before. Now the first panels appear on my gnome desktop...
« Last Edit: May 17, 2020, 08:53:47 pm by dietert1 »
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4159
  • Country: gb
Re: How many people code in C these days, and if so, why?
« Reply #416 on: May 17, 2020, 11:53:51 am »
super() is valid .. at least in python 3.

For example:

    def evaluate(self, data):
        state = super().evaluate(data)
        if not state:
            return []
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline jfiresto

  • Frequent Contributor
  • **
  • Posts: 865
  • Country: de
Re: How many people code in C these days, and if so, why?
« Reply #417 on: May 17, 2020, 12:08:04 pm »
super() is valid .. at least in python 3.

For example:

    def evaluate(self, data):
       state = super().evaluate(data)
       if not state:
           return []


Unfortunately, Python 2's super() is wordier and needs evaluate()'s host class:

    def evaluate(self, data):
         state = super(Class, self).evaluate(data)
         if not state:
             return []


Could feeding a super() without arguments to Python 2 be the issue?
-John
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4159
  • Country: gb
Re: How many people code in C these days, and if so, why?
« Reply #418 on: May 17, 2020, 12:18:29 pm »
super() is valid .. at least in python 3.

For example:

    def evaluate(self, data):
       state = super().evaluate(data)
       if not state:
           return []


Unfortunately, Python 2's super() is wordier and needs evaluate()'s host class:

    def evaluate(self, data):
         state = super(Class, self).evaluate(data)
         if not state:
             return []


Could feeding a super() without arguments to Python 2 be the issue?

Probably, but it reminds me of a great way to troll Python programmers.

When they say, "It's object orientated.", reply, "No.  It's not.", when they whine and get all uppity point them to the four corner stones of object orientation and get them to tick them off as to which Python supports.

Abstraction - Nope.  No protection, no formal interface, no "Interface" concept.

Encapsulation - Nope.  No protection, no internal/private/hidden members, everything is public.

Inheritance - Sort of, but without the above it's a bit weak and allows you to do really messed up stuff that you really shouldn't.

Polymorphism - Again, sort of, but not really.

The fact it has "self" as a function argument to make it an instance method is a sure sign it's not truely OOP.  It's OOP-like and only barely. 

It's not just python though.  OOP-like languages include, PHP, C#, Javascript, Perl.
« Last Edit: May 17, 2020, 12:20:04 pm by paulca »
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 
The following users thanked this post: SiliconWizard

Offline bd139

  • Super Contributor
  • ***
  • Posts: 23059
  • Country: gb
Re: How many people code in C these days, and if so, why?
« Reply #419 on: May 17, 2020, 12:46:45 pm »
It’s duck typed. None of those concepts make sense without a static type system.
 

Offline jfiresto

  • Frequent Contributor
  • **
  • Posts: 865
  • Country: de
Re: How many people code in C these days, and if so, why?
« Reply #420 on: May 17, 2020, 01:08:36 pm »
Indeed, the four ideas mostly strike me as specific, implementation requirements to make certain, non-dynamic(?) languages object-oriented.

You could very well believe Python is object oriented after reading Alan Kay, who coined the term, or Brad Cox, who brought OO into the mainstream.
-John
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6648
  • Country: fi
    • My home page and email address
Re: How many people code in C these days, and if so, why?
« Reply #421 on: May 17, 2020, 02:28:31 pm »
One way to classify programming languages is by their abstractions (specifically, by the complexity of their abstractions, or how far those abstractions are from how the hardware works in reality).  (I actually prefer to classify programming languages by their paradigm, but bear with me here.)

At the lowest level, you have assembly languages, which are just different symbolic representations of the underlying machine code, with trivial abstractions like labels instead of addresses.

(Anything above that level is up to discussion, however; depending on how you define the complexity of abstractions.)

At the next level, you have low-level programming languages.  Nowadays (among actively-used programming languages), this includes C, Forth, and Fortran at least.

If we look at freestanding C, we find that it is an extremely simple and compact programming language, with its abstractions more like compatibility layer between different hardware architectures rather than abstractions that help human programmers.  In comparison, Forth is more abstract, as it behaves like a stack-based abstract computer.  And Fortran has all sorts of abstractions, including array slicing, that are not "natively" supported by hardware, whose intent is to make "programming" something humans can do without knowing how computers actually work.

In a very real way, freestanding C is the "simplest" portable programming language we have.

In that sense, it is obvious how and why C is still being used.  It is nowhere near perfect, as its "abstractions" – more like hardware compatibility features, really – no longer match the hardware, the hardware having vastly progressed forward, but the low-level programming languages staying stagnant, or just adding to instead of refining their abstractions/compatibility layers...  which should also explain the reason for my own rant at C standard development in this thread.
« Last Edit: May 17, 2020, 02:32:55 pm by Nominal Animal »
 

Offline olkipukki

  • Frequent Contributor
  • **
  • Posts: 790
  • Country: 00
Re: How many people code in C these days, and if so, why?
« Reply #422 on: May 17, 2020, 02:46:37 pm »
Abstraction - Nope.  No protection, no formal interface, no "Interface" concept.
Encapsulation - Nope.  No protection, no internal/private/hidden members, everything is public.
Inheritance - Sort of, but without the above it's a bit weak and allows you to do really messed up stuff that you really shouldn't.
Polymorphism - Again, sort of, but not really.


Let's keep as is.

If someone wants all-in-inclusive package, there are Ada and Esperanto around  >:D
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2247
  • Country: 00
Re: How many people code in C these days, and if so, why?
« Reply #423 on: May 17, 2020, 03:01:50 pm »
At the next level, you have low-level programming languages.  Nowadays (among actively-used programming languages), this includes C, Forth, and Fortran at least.

When I did my C programming course, it was considered a high-level programming language...  8)

The terms high-level and low-level are inherently relative. Some decades ago, the C language, and similar languages, were most often considered "high-level", as it supported concepts such as expression evaluation, parameterised recursive functions, and data types and structures, while assembly language was considered "low-level". Today, many programmers might refer to C as low-level, as it lacks a large runtime-system (no garbage collection, etc.), basically supports only scalar operations, and provides direct memory addressing. It, therefore, readily blends with assembly language and the machine level of CPUs and microcontrollers.

https://en.wikipedia.org/wiki/High-level_programming_language
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4159
  • Country: gb
Re: How many people code in C these days, and if so, why?
« Reply #424 on: May 17, 2020, 03:10:27 pm »
Wanted to point out, I like Python.  I like C, I like C++. I sort of like Java.  I like any language that lets me do a job with the least appropriate amount of effort.

Monoglots are frustrating.  An example:

We had a REST API service for registering job batches on a cluster.  When I was faced with this, in test, I used a single line of curl to push a new job or update an existing one.  The previous monoglotic Java engineers wrote an entire enterprise Java client with really funky non-standard commandline arguments.  Why?  The curl command takes 30 seconds and can be put into an sh file for later.  The java app took a week, runs in about 20 times the time, takes up 100Mb of RAM.

You "can" put a screw in with a hammer and you "can" put a nail in with a screwdriver, but doing so just makes you look unskilled.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf