• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Programming!

Touched

Resident ASMAGICIAN
625
Posts
9
Years
  • Age 122
  • Seen Feb 1, 2018
It's certainly valid to learn how your code gets translated down to a machine's understanding using basic tools first, but dismissing IDEs entirely is also insane. You gain nothing by forcing yourself to do repetitive things on a text editor that an IDE can save time on (like autocomplete, live type inference, line-by-line error reporting etc.).

Maybe you are unfamiliar with Emacs, but it's a lot more extensible that any IDE will ever be. Not only can it be extended to have those features you've listed, but it can have pretty much anything you can think of. I use it as an IRC client and a hex editor for example. The key bindings certainly improve your productivity tenfold. Watch a video of someone live editing in Emacs if you want to see what I mean.

Too bad web technologies are exceptionally slow compared to native environments. For someone who's learning how to program, this can be just about the least intuitive way to go around doing it.

This was in response to someone suggesting that C# can be used to develop for mobile platforms - I was merely pointing out that it is not exceptional in this regard. But they're not that slow - for normal applications they sufficiently performant and much more convenient.

Maybe not Rust (although who knows), but at some point, some language certainly will. People probably once said the same thing about Pascal and Fortran. :)

Maybe I phrased that badly. I was trying to make the point that C is incredibly influential as far as language design and syntax are concerned. I was saying that its unlikely that any language will become more influential than C. As Rust (and most other "modern" languages) is/are already heavily influenced by C, any derived languages will also have thus been influenced by C. This influence can only grow.

Agreed; it's not really about the languages you know. It's about how quickly you're able to transition from one to the next.

It's important to realise that the language itself is not everything — you need to know all the main frameworks/libraries that really give the language its power. When learning a new environment, the hardest part is not the language; it's usually the frameworks (and the mindset behind them) that go with it.

Yes, I agree. Frameworks and language nuances are the most important bit about learning a new language. Keeping up with the times is also incredibly time consuming.
Knowledge of design patterns like MVC will certainly help with any future application development you might do.
 
2,709
Posts
18
Years
  • Age 30
  • Seen Feb 16, 2020
Maybe you are unfamiliar with Emacs, but it's a lot more extensible that any IDE will ever be. Not only can it be extended to have those features you've listed, but it can have pretty much anything you can think of. I use it as an IRC client and a hex editor for example. The key bindings certainly improve your productivity tenfold. Watch a video of someone live editing in Emacs if you want to see what I mean.

Then you have turned Emacs into an IDE. :) My gripe is not with Emacs in particular, it's with the idea that an out-of-the-box text editor is somehow objectively 'better' for every single use-case than an out-of-the-box IDE.

This was in response to someone suggesting that C# can be used to develop for mobile platforms - I was merely pointing out that it is not exceptional in this regard. But they're not that slow - for normal applications they sufficiently performant and much more convenient.

I'm afraid I'll still have to disagree; this depends on your definition of a 'normal' application. Truly responsive UI is very difficult to achieve relative to the efforts required in native environments. 'Much more convenient'? Highly doubt that as well. Caching and persistence is also still very much a gray area, especially when this is still dependent on a reliable connection.

Maybe I phrased that badly. I was trying to make the point that C is incredibly influential as far as language design and syntax are concerned. I was saying that its unlikely that any language will become more influential than C. As Rust (and most other "modern" languages) is/are already heavily influenced by C, any derived languages will also have thus been influenced by C. This influence can only grow.

Agreed; but the opportunity for a paradigm shift of the same magnitude isn't really a crazy thought. A language that completely throws away any predetermined notions from C is always just around the corner.
 

Touched

Resident ASMAGICIAN
625
Posts
9
Years
  • Age 122
  • Seen Feb 1, 2018
Then you have turned Emacs into an IDE. :) My gripe is not with Emacs in particular, it's with the idea that an out-of-the-box text editor is somehow objectively 'better' for every single use-case than an out-of-the-box IDE.

It's better because it's extensible. You can change and redefine basically anything you want. It also encourages you to personalise it, so basically it becomes yours. The fact that you can hack away at your editor while using it is pretty amazing. It's not so amazing out of the box per se - the keybindings take a while to get used to; but as you extend it, it becomes better than an IDE ever could be.

I'm afraid I'll still have to disagree; this depends on your definition of a 'normal' application. Truly responsive UI is very difficult to achieve relative to the efforts required in native environments. 'Much more convenient'? Highly doubt that as well. Caching and persistence is also still very much a gray area, especially when this is still dependent on a reliable connection.

Maybe you're misunderstanding what I mean. It bundles all the assets into an application then renders it using the already present web renderers on the device. You don't need a connection all - it's a native app with a with code to bridge the gap between web and native apps - it's all local though. It simply enables you to use web technologies and frameworks to build an app.

By "normal" app, I just meant something that doesn't make to much use of native APIs - standardising the different APIs across multiple platforms is difficult. It is however, more convenient in many cases. You don't have to develop an app separately for multiple devices - you write it once and it works. This is especially useful if you already have a SPA web app - it takes little effort to port it to mobile.

Agreed; but the opportunity for a paradigm shift of the same magnitude isn't really a crazy thought. A language that completely throws away any predetermined notions from C is always just around the corner.

That would mean throwing a lot of our knowledge of language design out the window too; it certainly won't happen without a fundamental shift in hardware and the logic necessary to program it - but even quantum programming languages are influenced by C - in appearance at least.
 
2,709
Posts
18
Years
  • Age 30
  • Seen Feb 16, 2020
Maybe you're misunderstanding what I mean. It bundles all the assets into an application then renders it using the already present web renderers on the device. You don't need a connection all - it's a native app with a with code to bridge the gap between web and native apps - it's all local though. It simply enables you to use web technologies and frameworks to build an app.

Yup, I was only initially thinking about the extreme; sorry for misinterpreting.

By "normal" app, I just meant something that doesn't make to much use of native APIs - standardising the different APIs across multiple platforms is difficult. It is however, more convenient in many cases. You don't have to develop an app separately for multiple devices - you write it once and it works. This is especially useful if you already have a SPA web app - it takes little effort to port it to mobile.

You could argue that that approach isn't really ideal for quality software, though — multiplatform code is generally code that doesn't run very well on any platform — appealing to the lowest common denominator very quickly leads to not appealing to any particular strength in any type of hardware at all.

That would mean throwing a lot of our knowledge of language design out the window too; it certainly won't happen without a fundamental shift in hardware and the logic necessary to program it - but even quantum programming languages are influenced by C - in appearance at least.

Moving away from C definitely doesn't mean 'throwing a lot of language design knowledge' — imperative languages aren't the only type out there. Implying that a shift in hardware is required for a shift in language design is like saying that functional and logic-based languages couldn't exist at all, but they do.
 

Touched

Resident ASMAGICIAN
625
Posts
9
Years
  • Age 122
  • Seen Feb 1, 2018
Moving away from C definitely doesn't mean 'throwing a lot of language design knowledge' — imperative languages aren't the only type out there. Implying that a shift in hardware is required for a shift in language design is like saying that functional and logic-based languages couldn't exist at all, but they do.

I didn't mean to imply that imperative languages were the only types out there. However, imperative is one of the main paradigms. Thus if we lost it, we would be throwing quite a lot (notice I did not say all) of our principles of language design out. Most general-purpose languages today are multi-paradigm and contain a mix of styles - imperative being quite a large component of these languages. Languages that emphasise declarative styles more such as Haskell (Functional) and Prolog (Logic) are pretty niche.

As for the shift in hardware, I was trying to make a point that it would only make sense to depart from imperative programming entirely (in mainstream languages) if the paradigm no longer made sense. I make this point because in the end, all languages are reduced to a byte code which is unstructured and imperative.
 
1,235
Posts
10
Years
  • Seen Jun 17, 2017
All I can really say is that I enjoy C++ and will continue to learn it, and I'm still using Code::Blocks at the moment - however, I will try using a text editor for the experience.

----

Would anyone be able to help me with adding the RANDOM.ORG library to a program, and having the program request integers from it? I have absolutely no idea what I'm supposed to do with the library files. It seems like it would be really simple, but I am stumped ~_~

It's for my Mafia Player-Role List Generator, which I would much rather have its randomness sourced from random.org than the PRNG.
 

Touched

Resident ASMAGICIAN
625
Posts
9
Years
  • Age 122
  • Seen Feb 1, 2018
All I can really say is that I enjoy C++ and will continue to learn it, and I'm still using Code::Blocks at the moment - however, I will try using a text editor for the experience.

----

Would anyone be able to help me with adding the RANDOM.ORG library to a program, and having the program request integers from it? I have absolutely no idea what I'm supposed to do with the library files. It seems like it would be really simple, but I am stumped ~_~

It's for my Mafia Player-Role List Generator, which I would much rather have its randomness sourced from random.org than the PRNG.

If you want to access the internet for practise, you might want to try libcurl or something. cURL is a popular utility for data transfer and supports a wide variety of protocols, including HTTP(S).

It really depends on what compiler you're using and what platform you're on. On Linux, if you have libcurl installed you can just compile with the -lcurl flag and it will find and link in the library. On Windows it might be a bit more complicated, I don't know though. IDE's usually have their own configuration window for this kind of thing. First you'll want to try

Code:
#include <curl/curl.h>

And the compiler should complain. If it does, you need to configure the IDE to set the include path while compiling. Usually this is done in a project configuration menu. With GCC you simply need to add -I/path/to/includes. Once you have the header working, you need to point it to your shared library (.dll on Windows). Usually this just involves you setting the library paths in project configuration (this is much easier on command line imo)

Try compiling a basic example like https://raw.githubusercontent.com/bagder/curl/master/docs/examples/simple.c by itself first, then try to incorporate it into your project.
 
26
Posts
14
Years
At the current rate, while HTML/JS tech does offer an alternative to developing mobile apps, they're hardly comparable to your typical native app- at no fault of the technologies involved. Mobile browsers are still significantly underpowered compared to their desktop siblings, and while that's likely going to change as high-end and mid-range devices increase in power, you're still potentially offering an inferior experience for users on lower end devices. This is key, especially if you consider that the emerging economies outside of the West are going to be where the biggest boom for mobile is in the coming years as access to mobile devices and mobile internet increase.

If you're continuing to work with C++, I might recommend moving to Qt Creator instead. While Code::Blocks is a decent IDE, you'll benefit much more from Qt Creator and developing with the Qt platform in mind, especially now that Qt supports is fairly well supported across all the major operating systems, including Android, iOS, and Windows Phone. That's assuming that you're interested in writing user facing applications- if you're more interested in writing libraries and frameworks, Qt Creator doesn't have too much to offer that you can't get elsewhere.

As far as I can tell, though, RANDOM.ORG does not have a C++ specific library. They do offer an HTTP API, so you could access that from anywhere. If you're looking for a means to provide better randomness than the built in functionality, you can always use something like PCG, especially if you don't want to add internet functionality.
 
1,235
Posts
10
Years
  • Seen Jun 17, 2017
As far as I can tell, though, RANDOM.ORG does not have a C++ specific library. They do offer an HTTP API, so you could access that from anywhere. If you're looking for a means to provide better randomness than the built in functionality, you can always use something like PCG, especially if you don't want to add internet functionality.

Another thing you could potentially add is a Mersenne Twister RNG library. It's (From what I've heard) one of the best RNG libraries you can find - The Pokémon games use the same library for random number generation.
While it would perhaps be simpler to add a good PRNG to the program, it would provide potentially worse results than someone just directly going to RANDOM.ORG to generate it themselves, which would just defeat the purpose of the program.

When I add RANDOM.ORG to the program, if I can do it, it will retain the current random method of the bad PRNG that uses the Unix time as a seed as an option, but it will not be recommended.

If I fail to add RANDOM.ORG generation to the program, I might have to use a PRNG. But I'm hoping that won't happen, and as long as I can work it out I won't have to compromise. Especially since, as I said above, it would make the program mostly useless if it offers worse results.
 
1,235
Posts
10
Years
  • Seen Jun 17, 2017
Doesn't that also add an internet connection dependency to your application though?
Yes, but only if you use the RANDOM.ORG generation; I'm keeping offline generation as an option. And besides, you need an internet connection to actually be hosting a Mafia game here on the forums, which the purpose of the program is supposed to assist in.

I might even try adding one of the better offline PRNGs as an option as well, if I can work it out. I'll see.

Once I've finished everything else, how difficult is putting a console application to a GUI one if I've already made it work as a console application? I'll probably fail at it if I try, as it's still not something I've explored or learned yet. But I did manage to do a lot of other stuff, so the program is practically done aside from the random generation.
 
Back
Top