Author Topic: Most Popular Programming Languages, Surveyed by Jetbrains  (Read 3114 times)

0 Members and 1 Guest are viewing this topic.

Online bd139

  • Super Contributor
  • ***
  • Posts: 13014
  • Country: gb
Re: Most Popular Programming Languages, Surveyed by Jetbrains
« Reply #50 on: August 26, 2019, 04:19:33 pm »
Just a point on GCC builds. GCC isn't particularly slow. But people forget that make and decent code organisation is where most of the win is if you want fast builds. Use -j.

These stupid projects you see with like 3 C files that are a meg each can go to hell. I've sliced up a few of those before. Mainly because they usually blow the heap on the machine and start swapping like fuck.
« Last Edit: August 26, 2019, 04:21:09 pm by bd139 »
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 4285
  • Country: fr
Re: Most Popular Programming Languages, Surveyed by Jetbrains
« Reply #51 on: August 29, 2019, 11:22:02 pm »
Of course, use proper organization for your builds. And yes, when you do so, GCC is perfectly fast enough.
The annoying occasional thing is when you modify a header file that's included almost in all your source files... I try to avoid including headers (except the system headers obviously) in too many source files though. Doing that usually shows poor partitioning of your code.
Another situation in which compile speed would matter is for automated builds (which are usually set with a rule of doing COMPLETE builds every time). Often does not matter a lot as the builds are scheduled at night time usually. But hey, some huge C++ projects can take literally HOURS to build... OK that's C++...

If you want a C compiler that's really fast, try TCC. https://en.wikipedia.org/wiki/Tiny_C_Compiler
It's blazingly fast. Probably at least 10 times faster than GCC or something. Of course, it does practically no optimization, and I don't know if I'd trust it much compared to GCC. But hey, for those missing the compile speed of Turbo Pascal and the likes, that will get you right back in the same seat. ;D

Edit: some real figures to illustrate. Using 'time' and compiling the SQLite "amalgamation", a single C file containing the whole SQLite 3 source code (~7.5 MiB, ~223 kLoC):
Code: [Select]
$ time tcc -c sqlite3.c

real    0m0,078s
user    0m0,000s
sys     0m0,000s

$ time gcc -c sqlite3.c

real    0m3,448s
user    0m0,000s
sys     0m0,000s

$ time gcc -O3 -c sqlite3.c

real    0m23,603s
user    0m0,000s
sys     0m0,000s

Of course the last one with -O3 is not fair (given that TCC has very basic optimizations), that was just to give an idea.
Even without optimizations (and granted, GCC still produces better code than TCC), that's a ~x44 factor in speed. ;D

It's really lightweight and fast. If you're looking for a small and fast C compiler for a small/old target, I definitely recommend taking a look at it. It's still C99 (and partly C11) compliant!

« Last Edit: September 09, 2019, 03:51:28 pm by SiliconWizard »
 

Offline 741

  • Regular Contributor
  • *
  • Posts: 152
  • Country: gb
    • Circuit & PCB Design (small PCB quantities OK)
Re: Most Popular Programming Languages, Surveyed by Jetbrains
« Reply #52 on: October 14, 2019, 08:34:17 pm »
I like Delphi a lot for "PC" programming - a very productive lanuage and IDE. Also,  tons of free components out there. Delphi is now v. expensive, so I looked at Lazarus ('free delphi) recently. A variant called Laz4Android seems to be able to cross-compile to 'any' OS, eg palm, Android, Amiga, BeOS, Mac, ...

For Lazarus generally, the (Windows) exe files are far larger than Delphi's (to some extent that will be down to cross-platform compatibility, but even when the target is Windows, the exes are large). However I might have missed something as I've only done a fairly small amount with Lazarus. One thing is the debugger is awful, it cannot resolve anything above elementary types. Also some funnies like a different concept of graphical component 'top', 'left' etc, requiring conversion if porting from Delphi (the conversion often fails for unknown reasons).

But the big prize is sometning like serial coms on Android, which then communicates with custom hardware. Doing that as far as a compile is not too hard, but I've stalled on the deployment part. For Android, it looks like a main nuisance is how to get the target OS to trust your application.

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 4285
  • Country: fr
Re: Most Popular Programming Languages, Surveyed by Jetbrains
« Reply #53 on: October 14, 2019, 08:36:39 pm »
For Lazarus generally, the (Windows) exe files are far larger than Delphi's (to some extent that will be down to cross-platform compatibility, but even when the target is Windows, the exes are large). However I might have missed something as I've only done a fairly small amount with Lazarus.

You might want to check whether executables contain symbols. That would explain the very large size. If so, there should be an option to strip them.

 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 1900
  • Country: ca
Re: Most Popular Programming Languages, Surveyed by Jetbrains
« Reply #54 on: October 15, 2019, 03:10:24 am »
... so I looked at Lazarus ('free delphi) recently.

I looked at Free Pascal/Lazarus few years ago. It doesn't come anywhere close to the old Delphi compiler. Typical clumsy open source project.
 

Offline nigelwright7557

  • Regular Contributor
  • *
  • Posts: 216
  • Country: gb
    • Murton-Pike Systems
Re: Most Popular Programming Languages, Surveyed by Jetbrains
« Reply #55 on: December 28, 2019, 12:38:50 am »
It's amazing that pascal ( Delphi ) does not appear on that survey,  I guess Embarcadero is in trouble

When Windows came out I tried to get into Visual Studio but found it too hard.
A PC magazine had a free copy of Delphi 2.0 on it so I tried that and found it great.
In later years Visual Studio improved and became easier to use so I moved over to C# WPF.
Then I converted a big program C# to C++ for the extra speed C++ has in Windows graphics.
My latest program incarnation is C# .net core 3.1 with winforms and that is very fast with graphics.
PCBCAD51/PCBCAD360/PCBCAD720 PCB design software https://www.murtonpikesystems.co.uk
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 4285
  • Country: fr
Re: Most Popular Programming Languages, Surveyed by Jetbrains
« Reply #56 on: December 28, 2019, 12:54:01 am »
Another popular index, TIOBE: https://www.tiobe.com/tiobe-index/ places Delphi/Object Pascal at rank 12, which is not that bad.

It loses traction for sure, but I think it's not dead yet. One of the big benefits of using Delphi is that you can build native cross-platform apps with the same code base. For sure you can do this with other means, (Java included but Java doesn't quite get you native apps...) If you're not against Object Pascal, it works. I saw they just released a new version, so... Embarcadero is not dead yet.
 

Offline nigelwright7557

  • Regular Contributor
  • *
  • Posts: 216
  • Country: gb
    • Murton-Pike Systems
Re: Most Popular Programming Languages, Surveyed by Jetbrains
« Reply #57 on: February 13, 2020, 02:22:53 am »
Rust seems like the new alternative to C++. Its supposedly safer by detecting and not even allowing unsafe coding practices.

With C++ you can start reading/writing data outside bounds of arrays unless you use a try catch around the read/write which then causes an exception.

I get complete screwed up because i use C++ and C# at the similar times on projects.
:: and -> and . often get inter used and errors occur.


PCBCAD51/PCBCAD360/PCBCAD720 PCB design software https://www.murtonpikesystems.co.uk
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 1362
  • Country: fi
    • My home page and email address
Re: Most Popular Programming Languages, Surveyed by Jetbrains
« Reply #58 on: February 13, 2020, 02:54:18 am »
One thing I didn't see mentioned in this thread, is how useful it is to use different programming languages for different parts of the same project.

For example, I really like writing CPU and I/O-intensive code in C, but use Python for the UI.

That way, users and other developers can tweak the UI without having to worry about messing with the C code (assuming a sane interface is used between the two), and I can concentrate on getting it all to work well.  (I've said it before, but the best work I've ever done, was in a team with a visually-oriented graphic artist with zero coding experience, and an UX specialist with a bit of scripting experience.  We just meshed well.)
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 4285
  • Country: fr
Re: Most Popular Programming Languages, Surveyed by Jetbrains
« Reply #59 on: February 13, 2020, 03:56:06 pm »
One thing I didn't see mentioned in this thread, is how useful it is to use different programming languages for different parts of the same project.

For example, I really like writing CPU and I/O-intensive code in C, but use Python for the UI.

That way, users and other developers can tweak the UI without having to worry about messing with the C code (assuming a sane interface is used between the two), and I can concentrate on getting it all to work well.  (I've said it before, but the best work I've ever done, was in a team with a visually-oriented graphic artist with zero coding experience, and an UX specialist with a bit of scripting experience.  We just meshed well.)

I don't like Python personally (which is a detail), but other than that, I fully agree with this.

Separating the UI and the core of the application in general is a very sane idea for many reasons including security, reusability and portability. And as you said, it allows completely different people, with even different skillsets, to work on different parts without meddling with one another's part whatsoever.

In a couple late designs I've worked on, I have even gone as far as architecturing software so that the core functionalities would run in a separate process and communicate with the GUI through sockets (that way, you can even have remote control, since the GUI doesn't need to run on the same machine!) Can be developed with completely different languages, and naturally enforces full isolation, and perfectly defined interfaces. (May not work when you need really low UI latency, but other than that, works well for a large number of applications.)



« Last Edit: February 13, 2020, 04:01:01 pm by SiliconWizard »
 

Offline GeorgeOfTheJungle

  • Super Contributor
  • ***
  • Posts: 2410
  • Country: tr
Re: Most Popular Programming Languages, Surveyed by Jetbrains
« Reply #60 on: February 13, 2020, 04:57:03 pm »
These days I try to do web interfaces for everything. http://thedeviceip and there you go. All that's needed is a bunch of .js and .html text files. XMLHttpRequest works everywhere, and in modern-ish browsers can use WebSockets.
http://brave.com <- THE BEST BROWSER
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 1362
  • Country: fi
    • My home page and email address
Re: Most Popular Programming Languages, Surveyed by Jetbrains
« Reply #61 on: February 14, 2020, 12:36:52 am »
I don't like Python personally (which is a detail), but other than that, I fully agree with this.
Sure; the reason I like Python for this is that it is an interpreter, so the UI code is even end-user modifible without development tools.  It has issues, but right now, a Python3 + Qt5 environment is portable across all major and almost all minor OSes, and relatively easily installed on all.

In a couple late designs I've worked on, I have even gone as far as architecturing software so that the core functionalities would run in a separate process and communicate with the GUI through sockets (that way, you can even have remote control, since the GUI doesn't need to run on the same machine!)
I do this extremely often in Linux, using POSIX C for the back end (so not really Linux-specific, but portable in practice across all POSIXy systems).  Both for mundane stuff, but also for security sensitive things, with proper privilege separation.  Keeping things modular, with well thought-out socket interfaces, makes writing especially security-sensitive code much easier.  Better result.

In these cases, the design documentation (why the socket interfaces were designed that way) is important to give future developers and maintainers an intuitive grasp of the approach, but it is sadly often omitted.  The implementation interface is of course absolutely required, and its specification must be maintained long-term, and only tends to get forgotten if the same developers work on both sides of the interface, or if the developers discuss the interface off-channel without documenting the proposed changes and applied changes affecting the interface.  (I've been burned by this several times, and refuse to officially discuss API/interface changes except in writing.  Otherwise the reality stretches too far from the documentation.)

I am still undecided whether documentation should be maintained in separate files, or extracted from the sources (via Doxygen/Sphinx/etc.); or rather, what the balance between the two should really be.  Design reports are best separate, I think; and library APIs extracted from sources; but for sockets, and file formats, I am just not decided.

Fortunately, all most commonly used programming languages support free-form comments, so that Doxygen/Sphinx/etc. -like generator tools can be used in projects using multiple programming languages.
« Last Edit: February 14, 2020, 12:38:34 am by Nominal Animal »
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 4285
  • Country: fr
Re: Most Popular Programming Languages, Surveyed by Jetbrains
« Reply #62 on: February 14, 2020, 02:02:47 pm »
I am still undecided whether documentation should be maintained in separate files, or extracted from the sources (via Doxygen/Sphinx/etc.); or rather, what the balance between the two should really be. 

Yeah, that's a very common question/issue, but rarely answered.

I see the benefits of documenting things inside the source code itself (so everything is in "one" place, and it shouuld be easier to make code and documentation consistent), but OTOH, it tends to take so much space that code itself becomes difficult to browse. Also, just like regular comments, there's still no guarantee that the comments will match the actual code, even if all is in the same place. Actually, this apparent ease compared to separate documentation makes it easy to just forget about updating the comments IME.

My prefered approach so far is to maintain separate documentation, with a clear indication of the exact version of the library/protocol/... it deals with. This way, if you ever modify the source code, the version  will change (it should if you work properly!), and won't match the documentation anymore, which forces you to update the documentation itself to keep in sync. It's more effective in practice IME, and has the benefit of "working" without having to actually look at the source code itself. You just need the version numbers, which in any decent worflow, should be correctly updated and maintained without much effort.



 

Online bd139

  • Super Contributor
  • ***
  • Posts: 13014
  • Country: gb
Re: Most Popular Programming Languages, Surveyed by Jetbrains
« Reply #63 on: February 14, 2020, 02:37:18 pm »
I prefer code generated documentation for API / interfaces and written document for functional notes then structural documentation that ties all the bits together.

In heavily componentised distributed systems with limited technical audience it's worth having runbooks for each component aimed at fast architectural and code level understanding.

I'm liking Go as a language at the moment for documentation, clarity, performance, workflow, maintainability for commercial delivery. Example package/component documentation: https://godoc.org/github.com/gorilla/websocket
 

Offline schmitt trigger

  • Super Contributor
  • ***
  • Posts: 1511
  • Country: mx
Re: Most Popular Programming Languages, Surveyed by Jetbrains
« Reply #64 on: February 14, 2020, 02:53:50 pm »
Someone has forgotten to include BASIC in the list.  >:D

Ducking the rotten eggs and running for cover.
 
The following users thanked this post: SilverSolder, bd139

Offline SilverSolder

  • Super Contributor
  • ***
  • Posts: 1149
  • Country: 00
Re: Most Popular Programming Languages, Surveyed by Jetbrains
« Reply #65 on: February 14, 2020, 04:24:39 pm »

In large companies, it is often hard to get approval for installing a programming environment (e.g. Delphi or whatever).

At such times, I have found VBA (Visual Basic for Applications) to be surprisingly powerful and usable...  VBA is present in most MS Office products (Excel, Word, ...)  and the corporate IT departments are usually forced to permit people to use Office,  so you can rely on it always being there!

 
The following users thanked this post: bd139

Online bd139

  • Super Contributor
  • ***
  • Posts: 13014
  • Country: gb
Re: Most Popular Programming Languages, Surveyed by Jetbrains
« Reply #66 on: February 14, 2020, 04:26:38 pm »
Yep at many a company I have used VBA in office to circumvent their "security controls". Remove explorer and run? No worries: Shell "C:\windows\explorer.exe"
 
The following users thanked this post: SilverSolder

Offline Bud

  • Super Contributor
  • ***
  • Posts: 3834
  • Country: ca
Re: Most Popular Programming Languages, Surveyed by Jetbrains
« Reply #67 on: February 14, 2020, 05:19:32 pm »
Strictly speaking VBA is a diluted version of VB, it is not as powerful. Good enough for doing Office related stuff but not really application programming.
Facebook-free life and Rigol-free shack.
 

Offline SilverSolder

  • Super Contributor
  • ***
  • Posts: 1149
  • Country: 00
Re: Most Popular Programming Languages, Surveyed by Jetbrains
« Reply #68 on: February 14, 2020, 05:25:30 pm »
Strictly speaking VBA is a diluted version of VB, it is not as powerful. Good enough for doing Office related stuff but not really application programming.

Agreed, but it is crazy powerful in many ways,  e.g. you can launch entire applications and remote control them from a VBA app...
 

Offline Mattjd

  • Regular Contributor
  • *
  • Posts: 202
  • Country: us
Re: Most Popular Programming Languages, Surveyed by Jetbrains
« Reply #69 on: February 14, 2020, 07:37:21 pm »
You guys mean the COM right? Like python has win32com module for that dynamically creates the object definitions

You can use that to control almost any application on windows that exposes its object library
 
The following users thanked this post: SilverSolder

Offline lone wolf1

  • Newbie
  • Posts: 3
  • Country: gb
Re: Most Popular Programming Languages, Surveyed by Jetbrains
« Reply #70 on: February 20, 2020, 05:33:23 pm »
Rust seems like the new alternative to C++. Its supposedly safer by detecting and not even allowing unsafe coding practices.

With C++ you can start reading/writing data outside bounds of arrays unless you use a try catch around the read/write which then causes an exception.

I get complete screwed up because i use C++ and C# at the similar times on projects.
:: and -> and . often get inter used and errors occur.

You can try and access an array outside of it's limits in nearly every language with run-time nasties.  The compilers don't do bounds checks as far as I'm aware.  It will make it into the run-time.  Of course good unit tests would detect it. 
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 4285
  • Country: fr
Re: Most Popular Programming Languages, Surveyed by Jetbrains
« Reply #71 on: February 20, 2020, 07:36:02 pm »
You can try and access an array outside of it's limits in nearly every language with run-time nasties.

Indeed. Whether it is caught at run-time depends on the language and platform, but in any case, this is still a bug that can have nasty consequences, even when the underlying system doesn't allow it to have an effect. If an attempt to access an array outside of its bounds is made, and nothing happens as a consequence - if it's caught - it can still be a problem as to the correctness of the program.

The compilers don't do bounds checks as far as I'm aware.

Decent compilers can catch out-of-bounds accesses at compile time when they can be inferred statically (from static analysis of the code). Unfortunately, many potential such accesses, apart from the trivial ones, can't be inferred statically.

Some high-level languages can mitigate this by forcing developers to use a "range" type for the indices that matches the array being accessed - effectively preventing any possibility of out-of-bounds access by design. You can do this with ADA for instance.

Of course you can also implement "safe" buffers in C. This takes extra work that some languages give you for free, but it's a possibility.

It will make it into the run-time.  Of course good unit tests would detect it.

And whatever is done at run-time when it's caught is still completely up to the developer. If you do nothing more than catch it, then it will prevent things like buffer overflows (overwriting the stack for instance), but as I said above, it can still have other consequences than can be just as bad in the end if you don't handle it gracefully - which is often much harder than it seems, so in practice many people just do nothing at all, while being weirdly proud of using such a nice language.

As to unit tests, they can only detect what was imagined when they were written. They can never be exhaustive.
 

Online bd139

  • Super Contributor
  • ***
  • Posts: 13014
  • Country: gb
Re: Most Popular Programming Languages, Surveyed by Jetbrains
« Reply #72 on: February 20, 2020, 08:59:29 pm »
Just a point on all this. While you can write a "safe programming language" and celebrate, it's an order more difficult to write something that is actually safe from a design perspective. I've seen all sorts of things pass through static analysers with flying colours only to walk up to the gate and find it looks like this. The frame and gate are made of the right materials but no one considered anything other than the gate.



My favourite was the authentication bypass on a tier 1 bank which was just a case of waiting a couple of minutes for the authentication token to expire. The new one was reissued incorrectly bypassing all authentication.  :palm: Why bother with the back door when the front door is broken :)
« Last Edit: February 20, 2020, 09:01:04 pm by bd139 »
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 4285
  • Country: fr
Re: Most Popular Programming Languages, Surveyed by Jetbrains
« Reply #73 on: February 22, 2020, 03:26:16 pm »
The above picture is a nice illustration for "unit testing". ;D
 

Online bd139

  • Super Contributor
  • ***
  • Posts: 13014
  • Country: gb
Re: Most Popular Programming Languages, Surveyed by Jetbrains
« Reply #74 on: February 22, 2020, 03:38:29 pm »
Badly done unit testing yes. Which is perhaps 95% of it from experience
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf